| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100 |
- package cn.com.lzt.schedule.service.impl;
- import cn.com.lzt.common.util.StringUtil;
- import cn.com.lzt.schedule.service.ScheduleSuperivseService;
- import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
- import com.baomidou.mybatisplus.core.metadata.IPage;
- import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
- import com.daju.common.util.DataPage;
- import com.daju.mix.dao.entity.TBScheduleSuperivse;
- import com.daju.mix.dao.mapper.TBScheduleSuperivseMapper;
- import com.daju.mix.dao.service.impl.BaseServiceImpl;
- import org.apache.commons.lang3.StringUtils;
- import org.jeecgframework.core.constant.Globals;
- import org.jeecgframework.core.util.JeecgDataAutorUtils;
- import org.jeecgframework.core.util.ResourceUtil;
- import org.jeecgframework.web.system.pojo.base.TSUser;
- import org.springframework.stereotype.Service;
- import javax.servlet.http.HttpServletRequest;
- import java.util.Map;
- /**
- * @author :sahib.kio.m
- * @date :Created in 2021/8/10 下午3:18
- */
- @Service
- public class ScheduleSuperivseServiceImpl extends BaseServiceImpl<TBScheduleSuperivseMapper, TBScheduleSuperivse> implements ScheduleSuperivseService {
- public DataPage superivseList(HttpServletRequest request, Map<String, String> param) {
- DataPage result = new DataPage();
- int page = 1;
- if(param.containsKey("page")){
- page = Integer.valueOf(param.get("page"));
- }
- int rows = 999;
- if(param.containsKey("rows")){
- rows = Integer.valueOf(param.get("rows"));
- }
- String code = param.get("code");
- String superviseDate = param.get("supervise.date");
- String dealStatus = param.get("deal.status");
- String userId = param.get("user.id.str");
- String type = param.get("type");
- String source = param.get("source");
- String area = param.get("area");
- String responsible = param.get("responsible.user.str");
- String leader = param.get("leader.user.str");
- String status = param.get("status");
- QueryWrapper<?> queryWrapper = new QueryWrapper<>();
- // boolean queryUserState = false;
- String selectSql = " SELECT TBSS.* " +
- "FROM T_B_SCHEDULE_SUPERIVSE TBSS WHERE 1 = 1\n";
- if(!StringUtil.isEmpty(code)){
- selectSql += "and TBSS.code like '%" + code + "%'";
- }
- if(!StringUtil.isEmpty(superviseDate)){
- selectSql += "and TBSS.supervise_date = '" + superviseDate + "'";
- }
- if(!StringUtil.isEmpty(dealStatus)){
- selectSql += "and TBSS.deal_status = '" + dealStatus + "'";
- }
- if(!StringUtil.isEmpty(userId)){
- // queryUserState = true;
- selectSql += "and TBSS.user_id in (select id from t_s_base_user where realname like '%" + userId + "%')";
- }
- String MENU_DATA_AUTHOR_RULE_SQL = JeecgDataAutorUtils.loadDataSearchConditonSQLString();
- if(StringUtils.isNotEmpty(MENU_DATA_AUTHOR_RULE_SQL)){
- selectSql += MENU_DATA_AUTHOR_RULE_SQL;
- }
- if(!StringUtil.isEmpty(type)){
- selectSql += "and TBSS.type = '" + type + "'";
- }
- if(!StringUtil.isEmpty(source)){
- selectSql += "and TBSS.source = '" + source + "'";
- }
- if(!StringUtil.isEmpty(area)){
- selectSql += "and TBSS.area = '" + area + "'";
- }
- if(!StringUtil.isEmpty(responsible)){
- // queryUserState = true;
- selectSql += "and TBSS.responsible_user_id in (select id from t_s_base_user where realname like '%" + responsible + "%')";
- }
- if(!StringUtil.isEmpty(leader)){
- // queryUserState = true;
- selectSql += "and TBSS.leader_user_id in (select id from t_s_base_user where realname like '%" + leader + "%')";
- }
- if(!StringUtil.isEmpty(status)){
- selectSql += "and TBSS.status = '" + status + "'";
- }
- // if(!queryUserState){
- // selectSql += " and (TBSS.user_id like '%"+userIdQuery+"%' or TBSS.responsible_user_id like '%"+userIdQuery+"%' or TBSS.leader_user_id like '%"+userIdQuery+"%') ";
- // }
- selectSql += "\torder by TBSS.create_date desc ";
- IPage<Map<String, Object>> mapPage = getBaseMapper().queryMapPageBySql(new Page<>(page, rows), queryWrapper, selectSql);
- result.setList(mapPage.getRecords());
- result.setTotalCount((int) mapPage.getTotal());
- return result;
- }
- }
|