| | |
| | | </if> |
| | | </select> |
| | | <select id="getUserByIds" resultType="java.util.Map"> |
| | | select u.id ,u.real_name ,d.full_name as deptName from ywxt.blade_user u inner join ywxt.blade_dept d on u.dept_id = d.id where 1 = 1 |
| | | select u.id ,u.real_name ,d.full_name as deptName from ywxt.blade_user u inner join ywxt.blade_dept d on u.dept_id = convert(varchar(100),d.id) where 1 = 1 |
| | | <if test="ids != null and ids.size>0"> |
| | | AND u.id in |
| | | <foreach collection="ids" item="item" index="index" open="(" separator="," close=")"> |
| | |
| | | |
| | | String getname(String code); |
| | | |
| | | List<SgProjectInfoVO> progressList1(IPage<SgProjectInfoVO> page, @Param("dto") ProjectSearchDTO dto); |
| | | |
| | | List<SgProjectInfoVO> queryStepByProject1(@Param("dto") ProjectSearchDTO searchDTO); |
| | | |
| | | //List<String> getProjectIds(String code,@Param("grad") String grad ); |
| | | } |
| | |
| | | pro.id, |
| | | pro.project_name, |
| | | pro.lon_lat, |
| | | pro.status, |
| | | dria."county_cd" AS countyCode, |
| | | att."guid" AS cityCode, |
| | | ad."ad_code" AS provinceCode |
| | | pro.status |
| | | FROM |
| | | ywxt.sg_project_info pro |
| | | WHERE 1=1 |
| | |
| | | <select id="getname" resultType="java.lang.String"> |
| | | select DISTINCT "bas_guid" from SJZT_DW."dim_res_info_a" where "bas_name" = #{code} |
| | | </select> |
| | | <select id="progressList1" resultType="cn.gistack.sm.sg.VO.SgProjectInfoVO"> |
| | | select pro.id, |
| | | pro.project_name, |
| | | pro.lon_lat, |
| | | pro.status |
| | | from |
| | | (SELECT |
| | | pro.id, |
| | | pro.project_name, |
| | | pro.lon_lat, |
| | | pro.status, |
| | | dria."county_cd" AS countyCode, |
| | | att."guid" AS cityCode, |
| | | ad."ad_code" AS provinceCode |
| | | FROM |
| | | ywxt.sg_project_info pro |
| | | LEFT JOIN SJZT_DW."dim_res_info_a" dria ON dria."res_cd" = pro.sk_id |
| | | LEFT JOIN YWXT."att_ad_base" att ON att."ad_code" = dria."city_cd" |
| | | LEFT JOIN YWXT."att_ad_base" ad ON att."p_ad_code" = ad."ad_code" |
| | | LEFT JOIN YWXT."att_ad_base" aad ON aad."ad_code" = ad."p_ad_code") pro |
| | | LEFT JOIN YWXT."att_ad_base" a ON ( |
| | | ( pro.countyCode = a."guid" ) |
| | | OR ( pro.cityCode = a."guid" ) |
| | | OR ( pro.provinceCode = a."guid" )) |
| | | WHERE 1=1 and a."p_ad_code" = #{dto.adCode} |
| | | <if test="dto.status != null"> |
| | | and pro.status = #{dto.status} |
| | | </if> |
| | | <if test="dto.projectName != null and dto.projectName != ''"> |
| | | and pro.project_name like CONCAT(CONCAT('%',#{dto.projectName}),'%') |
| | | </if> |
| | | </select> |
| | | <select id="queryStepByProject1" resultType="cn.gistack.sm.sg.VO.SgProjectInfoVO"> |
| | | select |
| | | pro.id, |
| | | pro.project_name, |
| | | pro.gxId, |
| | | pro.gx_name, |
| | | pro.device_name, |
| | | pro.device_type, |
| | | pro.typeName, |
| | | pro.dId, |
| | | pro.gx_step_name, |
| | | pro.gx_step_num, |
| | | pro.stepId, |
| | | pro.reportStatus, |
| | | pro.deviceStatus, |
| | | pro.projectStatus, |
| | | pro.reportId, |
| | | pro.lon_lat |
| | | from |
| | | (SELECT |
| | | pro.id, |
| | | pro.project_name, |
| | | gx.id AS gxId, |
| | | gx.gx_name, |
| | | d.device_name, |
| | | d.device_type, |
| | | dict."DICT_VALUE" AS typeName, |
| | | d.id AS dId, |
| | | step.gx_step_name, |
| | | step.gx_step_num, |
| | | step.id AS stepId, |
| | | re.STATUS AS reportStatus, |
| | | d.STATUS AS deviceStatus, |
| | | pro.STATUS AS projectStatus, |
| | | re.id AS reportId, |
| | | pro.lon_lat, |
| | | dria."county_cd" AS countyCode, |
| | | att."guid" AS cityCode, |
| | | ad."ad_code" AS provinceCode |
| | | FROM |
| | | ywxt.sg_project_info pro |
| | | LEFT JOIN ywxt.sg_device d ON pro.id = d.program_id |
| | | LEFT JOIN YWXT."BLADE_DICT_BIZ" AS dict ON d.device_type = dict.DICT_KEY |
| | | AND dict.CODE = 'SG_DEVICE_TYPE' |
| | | LEFT JOIN ywxt.sg_gx gx ON d.device_type = gx.gx_type |
| | | LEFT JOIN ywxt.sg_gx_step step ON gx.id = step.gx_info_id |
| | | LEFT JOIN ywxt.sg_progress_report re ON re.gx_step_id = step.id |
| | | AND re.gx_device_id = d.id |
| | | LEFT JOIN SJZT_DW."dim_res_info_a" dria ON dria."res_cd" = pro.sk_id |
| | | LEFT JOIN YWXT."att_ad_base" att ON att."ad_code" = dria."city_cd" |
| | | LEFT JOIN YWXT."att_ad_base" ad ON att."p_ad_code" = ad."ad_code" |
| | | LEFT JOIN YWXT."att_ad_base" aad ON aad."ad_code" = ad."p_ad_code") pro |
| | | LEFT JOIN YWXT."att_ad_base" a ON ( |
| | | ( pro.countyCode = a."guid" ) |
| | | OR ( pro.cityCode = a."guid" ) |
| | | OR ( pro.provinceCode = a."guid" )) |
| | | WHERE 1=1 and a."p_ad_code" = #{dto.adCode} |
| | | <if test="dto.projectId != null and dto.projectId != ''"> |
| | | and pro.id = #{dto.projectId} |
| | | </if> |
| | | <if test="dto.projectName != null and dto.projectName != ''"> |
| | | and pro.project_name like CONCAT(CONCAT('%', #{dto.projectName}), '%') |
| | | </if> |
| | | <if test="dto.status != null"> |
| | | and pro.status = #{dto.status} |
| | | </if> |
| | | <if test="dto.projectIds != null and dto.projectIds.size > 0"> |
| | | and pro.id in |
| | | <foreach collection="dto.projectIds" item="id" separator="," open="(" close=")"> |
| | | #{id} |
| | | </foreach> |
| | | </if> |
| | | </select> |
| | | <!-- <select id="getProjectIds" resultType="java.lang.String">--> |
| | | |
| | | <!-- </select>--> |
| | |
| | | @Override |
| | | public boolean saveById(SgDeviceDO sgDeviceDO) { |
| | | QueryWrapper<SgProgressReportDO> queryWrapper = new QueryWrapper<>(); |
| | | SgProgressReportDO sgProgressReportDO = sgProgressReportMapper.selectOne(queryWrapper.eq("profram_id", sgDeviceDO.getId()).eq("gx_step_id",26)); |
| | | SgProgressReportDO sgProgressReportDO = sgProgressReportMapper.selectOne(queryWrapper.eq("profram_id", sgDeviceDO.getProgramId()).eq("gx_step_id",26)); |
| | | if (sgProgressReportDO != null) { |
| | | if(sgProgressReportDO.getStatus().equals(2)){ |
| | | throw new ServiceException("施工验收完成不能增加设备"); |
| | |
| | | sgProgressReportDO.setCreateTime(now); |
| | | //如果为草稿状态,单纯插入 |
| | | if(sgProgressReportDO.getStatus()==4){ |
| | | sgProgressReportMapper.insert(sgProgressReportDO); |
| | | return; |
| | | QueryWrapper<SgProgressReportDO> wrappers = new QueryWrapper<>(); |
| | | wrappers.eq("profram_id", sgProgressReportDO.getProframId()).eq("status", 4).eq("gx_step_id", sgProgressReportDO.getGxStepId()) |
| | | .eq("gx_device_id",sgProgressReportDO.getGxDeviceId()); |
| | | if(sgProgressReportMapper.selectOne(wrappers) == null){ |
| | | sgProgressReportMapper.insert(sgProgressReportDO); |
| | | return; |
| | | }else { |
| | | throw new ServiceException("已有草稿数据,无法保存"); |
| | | } |
| | | |
| | | } |
| | | QueryWrapper<SgProgressReportDO> wrappers = new QueryWrapper<>(); |
| | | wrappers.eq("profram_id", sgProgressReportDO.getProframId()).ne("status", 4).eq("gx_step_name", "施工准备"); |
| | |
| | | sgProgressReportVO.setDeviceName(sgDeviceDO.getDeviceName()); |
| | | }else { |
| | | sgProgressReportVO.setDeviceName("");} |
| | | List<SgReportUserDO> list = new LambdaQueryChainWrapper<>(sgReportUserMapper).eq(SgReportUserDO::getReportId, id).orderByAsc(SgReportUserDO::getId).list(); |
| | | List<SgReportUserDO> list = new LambdaQueryChainWrapper<>(sgReportUserMapper).eq(SgReportUserDO::getReportId,id).orderByAsc(SgReportUserDO::getId).list(); |
| | | List<Long> ids = list.stream().map(s -> s.getUserId()).collect(Collectors.toList()); |
| | | List<Map<String,Object>> users = sgProgressReportMapper.getUserByIds(ids); |
| | | for (Map<String, Object> user : users) { |
| | |
| | | @Override |
| | | public List<SgProjectInfoVO> progressList(ProjectSearchDTO searchDTO) { |
| | | List<SgProjectInfoVO> list = new ArrayList<>(); |
| | | List<SgProjectInfoDO> projectProgress = getProjectProgress(sgProjectInfoMapper.queryStepByProject(searchDTO)); |
| | | List<SgProjectInfoDO> projectProgress = new ArrayList<>(); |
| | | if(!searchDTO.getAdCode().isEmpty()){ |
| | | projectProgress = getProjectProgress(sgProjectInfoMapper.queryStepByProject1(searchDTO)); |
| | | }else { |
| | | projectProgress = getProjectProgress(sgProjectInfoMapper.queryStepByProject(searchDTO)); |
| | | } |
| | | |
| | | if (CollectionUtils.isNotEmpty(projectProgress)){ |
| | | projectProgress.forEach(s->{ |
| | | SgProjectInfoVO sgProjectInfoVO = new SgProjectInfoVO(); |
| | |
| | | */ |
| | | @Override |
| | | public IPage<SgProjectInfoVO> progressPage(IPage<SgProjectInfoVO> page, ProjectSearchDTO searchDTO) { |
| | | List<SgProjectInfoVO> list = sgProjectInfoMapper.progressList(page, searchDTO); |
| | | List<SgProjectInfoVO> list = new ArrayList<>(); |
| | | if(!searchDTO.getAdCode().isEmpty()){ |
| | | list = sgProjectInfoMapper.progressList1(page, searchDTO); |
| | | }else { |
| | | list = sgProjectInfoMapper.progressList(page, searchDTO); |
| | | } |
| | | |
| | | List<Long> ids = list.stream().map(SgProjectInfoVO::getId).collect(Collectors.toList()); |
| | | searchDTO.setProjectIds(ids); |
| | | List<SgProjectInfoDO> projectProgress = getProjectProgress(sgProjectInfoMapper.queryStepByProject(searchDTO)); |
| | | List<SgProjectInfoDO> projectProgress = new ArrayList<>(); |
| | | if(!searchDTO.getAdCode().isEmpty()){ |
| | | projectProgress = getProjectProgress(sgProjectInfoMapper.queryStepByProject1(searchDTO)); |
| | | }else { |
| | | projectProgress = getProjectProgress(sgProjectInfoMapper.queryStepByProject(searchDTO)); |
| | | } |
| | | |
| | | if (CollectionUtils.isNotEmpty(projectProgress)){ |
| | | Map<Long, String> progressMap = projectProgress.stream().filter(s->s!=null && s.getProjectProgress() !=null).collect(Collectors.toMap(SgProjectInfoDO::getId, SgProjectInfoDO::getProjectProgress)); |
| | | list.forEach(s->{ |
| | |
| | | FROM |
| | | sjzt_md."tb_project" a |
| | | LEFT JOIN ( SELECT * FROM sjzt_md."tb_project_schedule" |
| | | WHERE 1=1 |
| | | WHERE "check_state" = 3 |
| | | <if test="params.tbYear != null and params.tbYear !=''"> |
| | | AND "year" = #{params.tbYear} |
| | | </if> |
| | |
| | | FROM |
| | | sjzt_md."tb_project" a |
| | | LEFT JOIN ( SELECT * FROM sjzt_md."tb_project_schedule" |
| | | WHERE 1=1 |
| | | WHERE "check_state" = 3 |
| | | <if test="params.tbYear != null and params.tbYear !=''"> |
| | | AND "year" = #{params.tbYear} |
| | | </if> |