Merge remote-tracking branch 'origin/jtdev' into jtdev
| | |
| | | |
| | | private String gxType; |
| | | |
| | | public void setUpdateTime(){ |
| | | public void setCreateUpdateTime(){ |
| | | Date now = DateUtil.now(); |
| | | if (this.getId()== null) { |
| | | this.createTime = now; |
| | |
| | | private String gxType; |
| | | private String gxName; |
| | | private String createUser; |
| | | private String gxInfoId; |
| | | private String gxStepNum; |
| | | } |
| | |
| | | @Data |
| | | public class SgGxVO extends SgGxDO { |
| | | private List<SgGxStepDO> stepDOList; |
| | | private Integer gxStepCount; |
| | | } |
| | |
| | | */ |
| | | @GetMapping(value = "/page") |
| | | public R queryPageList(ProjectSearchDTO searchDTO, Query query) { |
| | | |
| | | IPage<SgGxVO> page = sgGxService.queryPageList(Condition.getPage(query), searchDTO); |
| | | return R.data(page); |
| | | } |
| | |
| | | package cn.gistack.sm.sg.controller; |
| | | |
| | | import cn.gistack.sm.sg.DO.SgGxStepDO; |
| | | import cn.gistack.sm.sg.DTO.ProjectSearchDTO; |
| | | import cn.gistack.sm.sg.VO.SgGxVO; |
| | | import cn.gistack.sm.sg.service.SgGxStepService; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import org.springblade.core.boot.ctrl.BladeController; |
| | | import org.springblade.core.mp.support.Condition; |
| | | import org.springblade.core.mp.support.Query; |
| | | import org.springblade.core.tool.api.R; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | |
| | | sgGxStepService.delete(id); |
| | | return R.success("删除成功"); |
| | | } |
| | | |
| | | /** |
| | | * 分页 |
| | | */ |
| | | @GetMapping(value = "/page") |
| | | public R queryPageList(ProjectSearchDTO searchDTO, Query query) { |
| | | IPage<SgGxStepDO> page = sgGxStepService.queryPageList(Condition.getPage(query), searchDTO); |
| | | return R.data(page); |
| | | } |
| | | |
| | | /** |
| | | * 详情 |
| | | */ |
| | | @GetMapping(value = "/detail") |
| | | public R queryPageList(String id) { |
| | | return R.data(sgGxStepService.getById(id)); |
| | | } |
| | | } |
| | |
| | | import cn.gistack.sm.sg.DO.SgGxStepDO; |
| | | import cn.gistack.sm.sg.DTO.ProjectSearchDTO; |
| | | import cn.gistack.sm.sg.VO.SgGxVO; |
| | | import cn.gistack.system.user.vo.UserVO; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | |
| | | */ |
| | | public interface SgGxMapper extends BaseMapper<SgGxDO> { |
| | | |
| | | List<SgGxVO> queryPageList(@Param("dto") ProjectSearchDTO dto); |
| | | List<SgGxVO> queryPageList(IPage<SgGxVO> page, @Param("dto") ProjectSearchDTO dto); |
| | | |
| | | List<SgGxStepDO> queryStepByIds(@Param("ids") List<Long> ids); |
| | | |
| | | SgGxDO selectByGxType(@Param("gxType") String gxType); |
| | | |
| | | SgGxVO getById(@Param("id") Long id); |
| | | } |
| | |
| | | <select id="queryPageList" resultType="cn.gistack.sm.sg.VO.SgGxVO"> |
| | | select * from YWXT.SG_GX gx where 1=1 |
| | | <if test="dto.gxType != null and dto.gxType != ''"> |
| | | and gx.gx_type = #{dto.gxType} |
| | | and gx.gx_type LIKE CONCAT('%', #{dto.gxType}, '%') |
| | | </if> |
| | | <if test="dto.gxName != null and dto.gxName != ''"> |
| | | and gx.gx_name = #{dto.gxName} |
| | | and gx.gx_name LIKE CONCAT('%', #{dto.gxName}, '%') |
| | | </if> |
| | | </select> |
| | | <select id="queryStepByIds" resultType="cn.gistack.sm.sg.DO.SgGxStepDO"> |
| | |
| | | <select id="selectByGxType" resultType="cn.gistack.sm.sg.VO.SgGxVO"> |
| | | select * from YWXT.SG_GX where gx_type = #{gxType} |
| | | </select> |
| | | <select id="getById" resultType="cn.gistack.sm.sg.VO.SgGxVO"> |
| | | select * from YWXT.SG_GX where id = #{id} |
| | | </select> |
| | | </mapper> |
| | |
| | | package cn.gistack.sm.sg.mapper; |
| | | |
| | | import cn.gistack.sm.sg.DO.SgGxStepDO; |
| | | import cn.gistack.sm.sg.DTO.ProjectSearchDTO; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | |
| | | public interface SgGxStepMapper extends BaseMapper<SgGxStepDO> { |
| | | |
| | | List<SgGxStepDO> selectByGxInfoId(@Param("gxInfoId") Long gxInfoId); |
| | | |
| | | List<SgGxStepDO> queryPageList(IPage<SgGxStepDO> page, @Param("dto") ProjectSearchDTO searchDTO); |
| | | } |
| | |
| | | <select id="selectByGxInfoId" resultType="cn.gistack.sm.sg.DO.SgGxStepDO"> |
| | | select * from YWXT.SG_GX_STEP step where step.GX_INFO_ID = #{gxInfoId} order by step.GX_STEP_NUM desc |
| | | </select> |
| | | <select id="queryPageList" resultType="cn.gistack.sm.sg.DO.SgGxStepDO"> |
| | | select * from YWXT.SG_GX_STEP step where 1=1 |
| | | <if test="dto.gxInfoId != null and dto.gxInfoId != ''"> |
| | | and step.GX_INFO_ID = #{dto.gxInfoId} |
| | | </if> |
| | | <if test="dto.gxStepNum != null and dto.gxStepNum != ''"> |
| | | and step.GX_STEP_NUM = #{dto.gxStepNum} |
| | | </if> |
| | | </select> |
| | | </mapper> |
| | |
| | | package cn.gistack.sm.sg.mapper; |
| | | |
| | | import cn.gistack.sm.sg.DO.SgGxStepDO; |
| | | import cn.gistack.sm.sg.DO.SgProjectInfoDO; |
| | | import cn.gistack.sm.sg.DTO.ProjectSearchDTO; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | |
| | | */ |
| | | public interface SgProjectInfoMapper extends BaseMapper<SgProjectInfoDO> { |
| | | |
| | | List<SgProjectInfoDO> queryPageList(@Param("dto") ProjectSearchDTO dto); |
| | | List<SgProjectInfoDO> queryPageList(IPage<SgProjectInfoDO> page, @Param("dto") ProjectSearchDTO dto); |
| | | } |
| | |
| | | package cn.gistack.sm.sg.service; |
| | | |
| | | import cn.gistack.sm.sg.DO.SgGxStepDO; |
| | | import cn.gistack.sm.sg.DTO.ProjectSearchDTO; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | void updateOne(SgGxStepDO sgGxStepDO); |
| | | |
| | | void delete(String id); |
| | | |
| | | IPage<SgGxStepDO> queryPageList(IPage<SgGxStepDO> page, @Param("dto") ProjectSearchDTO searchDTO); |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.core.toolkit.CollectionUtils; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import org.springblade.core.log.exception.ServiceException; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | |
| | | private SgGxMapper sgGxMapper; |
| | | @Override |
| | | public IPage<SgGxVO> queryPageList(IPage<SgGxVO> page, ProjectSearchDTO searchDTO) { |
| | | List<SgGxVO> list = sgGxMapper.queryPageList(searchDTO); |
| | | List<SgGxVO> list = sgGxMapper.queryPageList(page,searchDTO); |
| | | if (CollectionUtils.isNotEmpty(list)){ |
| | | List<Long> ids = list.stream().map(SgGxDO::getId).collect(Collectors.toList()); |
| | | List<SgGxStepDO> stepDOS = sgGxMapper.queryStepByIds(ids); |
| | | if (CollectionUtils.isNotEmpty(stepDOS)){ |
| | | Map<Long, List<SgGxStepDO>> map = stepDOS.stream().collect(Collectors.groupingBy(SgGxStepDO::getGxInfoId)); |
| | | for (SgGxVO sgGxDO : list) { |
| | | sgGxDO.setStepDOList(map.get(sgGxDO.getId())); |
| | | List<SgGxStepDO> sgGxStepDOS = map.get(sgGxDO.getId()); |
| | | if (CollectionUtils.isNotEmpty(sgGxStepDOS)){ |
| | | sgGxDO.setStepDOList(sgGxStepDOS); |
| | | sgGxDO.setGxStepCount(sgGxStepDOS.size()); |
| | | } |
| | | } |
| | | } |
| | | } |
| | |
| | | |
| | | @Override |
| | | public void add(SgGxDO sgGxDO) { |
| | | sgGxDO.setCreateUpdateTime(); |
| | | if (sgGxMapper.selectByGxType(sgGxDO.getGxType())!= null){ |
| | | throw new RuntimeException("工序类型已存在"); |
| | | throw new ServiceException("工序类型已存在"); |
| | | } |
| | | this.save(sgGxDO); |
| | | } |
| | | |
| | | @Override |
| | | public void update(SgGxDO sgGxDO) { |
| | | if (sgGxMapper.selectByGxType(sgGxDO.getGxType())!= null){ |
| | | throw new RuntimeException("工序类型已存在"); |
| | | sgGxDO.setCreateUpdateTime(); |
| | | SgGxDO one = sgGxMapper.selectByGxType(sgGxDO.getGxType()); |
| | | if (one != null && one.getId()!= sgGxDO.getId() ){ |
| | | throw new ServiceException("工序类型已存在"); |
| | | } |
| | | this.updateById(sgGxDO); |
| | | } |
| | | |
| | | @Override |
| | | public SgGxVO detail(Long id) { |
| | | SgGxVO byId = (SgGxVO) this.getById(id); |
| | | byId.setStepDOList(sgGxMapper.queryStepByIds(List.of(id))); |
| | | SgGxVO byId = sgGxMapper.getById(id); |
| | | List<SgGxStepDO> stepDOS = sgGxMapper.queryStepByIds(List.of(id)); |
| | | byId.setStepDOList(stepDOS); |
| | | return byId; |
| | | } |
| | | } |
| | |
| | | package cn.gistack.sm.sg.service.impl; |
| | | |
| | | import cn.gistack.sm.sg.DO.SgGxStepDO; |
| | | import cn.gistack.sm.sg.DTO.ProjectSearchDTO; |
| | | import cn.gistack.sm.sg.mapper.SgGxStepMapper; |
| | | import cn.gistack.sm.sg.service.SgGxStepService; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.core.toolkit.CollectionUtils; |
| | | import org.springblade.core.log.exception.ServiceException; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | |
| | | import java.lang.reflect.Array; |
| | | import java.util.Arrays; |
| | | import java.util.List; |
| | | |
| | | /** |
| | |
| | | public void delete(String id) { |
| | | SgGxStepDO sgGxStepDO = sgGxStepMapper.selectById(id); |
| | | List<SgGxStepDO> list= sgGxStepMapper.selectByGxInfoId(sgGxStepDO.getGxInfoId()); |
| | | if (sgGxStepDO.getGxStepNum().equals(list.get(0).getGxStepNum())){ |
| | | if (!sgGxStepDO.getGxStepNum().equals(list.get(0).getGxStepNum())){ |
| | | throw new ServiceException("请按顺序删除工序步骤"); |
| | | } |
| | | this.removeById(id); |
| | | } |
| | | |
| | | @Override |
| | | public IPage<SgGxStepDO> queryPageList(IPage<SgGxStepDO> page, ProjectSearchDTO searchDTO) { |
| | | List<SgGxStepDO> list = sgGxStepMapper.queryPageList(page,searchDTO); |
| | | return page.setRecords(list); |
| | | } |
| | | } |
| | |
| | | |
| | | @Override |
| | | public IPage<SgProjectInfoDO> queryPageList(IPage<SgProjectInfoDO> page, ProjectSearchDTO searchDTO) { |
| | | List<SgProjectInfoDO> sgProjectInfoDOS = baseMapper.queryPageList(searchDTO); |
| | | List<SgProjectInfoDO> sgProjectInfoDOS = baseMapper.queryPageList(page,searchDTO); |
| | | return page.setRecords(sgProjectInfoDOS); |
| | | } |
| | | } |
| | |
| | | tmp.totalDangerNum, |
| | | tmp.termiteNum, |
| | | tmp.otherNum, |
| | | ifnull(tmp.totalDanger,0) totalDanger, |
| | | ifnull(tmp.totalDangerSr,0) totalDangerSr, |
| | | ifnull(tmp.totalDangerCb,0) totalDangerCb, |
| | | ifnull(tmp.totalDangerDw,0) totalDangerDw, |
| | | |
| | | case when town."ad_grad" = 4 THEN town."ad_code" ELSE NULL END AS townCode, |
| | | case when town."ad_grad" = 4 THEN town."ad_name" ELSE NULL END AS townName, |
| | |
| | | |
| | | SUM(CASE WHEN (trgi."hazard_rating" != '无危害') THEN 1 ELSE 0 END) AS totalDangerNum, |
| | | SUM(CASE WHEN (trgi."investigation_variety" = '白蚁' and trgi."hazard_rating" != '无危害') THEN 1 ELSE 0 END) AS termiteNum, |
| | | SUM(CASE WHEN (trgi."investigation_variety" != '白蚁' and trgi."hazard_rating" != '无危害') THEN 1 ELSE 0 END) AS otherNum |
| | | SUM(CASE WHEN (trgi."investigation_variety" != '白蚁' and trgi."hazard_rating" != '无危害') THEN 1 ELSE 0 END) AS otherNum, |
| | | SUM(CASE WHEN (trgi."is_danger" != '否') THEN 1 ELSE 0 END) AS totalDanger, |
| | | SUM(CASE WHEN (json_value(trgi."danger_info", '$.sr') != '') THEN json_value(trgi."danger_info", '$.sr') ELSE 0 END) AS totalDangerSr, |
| | | SUM(CASE WHEN (json_value(trgi."danger_info", '$.cb') != '') THEN json_value(trgi."danger_info", '$.cb') ELSE 0 END) AS totalDangerCb, |
| | | SUM(CASE WHEN (json_value(trgi."danger_info", '$.dw') != '') THEN json_value(trgi."danger_info", '$.dw') ELSE 0 END) AS totalDangerDw |
| | | from sjzt_md."tb_res_general_investigation" trgi |
| | | where 1=1 |
| | | <if test="attResBase.tbYear !=null and attResBase.tbYear !=''"> |
| | |
| | | tmp.totalDangerNum, |
| | | tmp.termiteNum, |
| | | tmp.otherNum, |
| | | tmp.totalDangerLength |
| | | tmp.totalDangerLength, |
| | | ifnull(tmp.totalDanger,0) totalDanger, |
| | | ifnull(tmp.totalDangerSr,0) totalDangerSr, |
| | | ifnull(tmp.totalDangerCb,0) totalDangerCb, |
| | | ifnull(tmp.totalDangerDw,0) totalDangerDw |
| | | |
| | | from sjzt_md."tb_res_dyke" trd |
| | | left join "SJZT_MD"."tb_dyke_investigation_state" tdis on trd."guid" = tdis."dyke_guid" |
| | | left join YWXT."att_ad_base" aa on aa."guid" = trd."ad_code" |
| | |
| | | sum(temp2.totalDangerNum) as totalDangerNum, |
| | | sum(temp2.termiteNum) as termiteNum, |
| | | sum(temp2.otherNum) as otherNum, |
| | | SUM(CASE WHEN temp2.dangerLength THEN temp2.dangerLength ELSE 0 END) AS totalDangerLength |
| | | SUM(CASE WHEN temp2.dangerLength THEN temp2.dangerLength ELSE 0 END) AS totalDangerLength, |
| | | sum(temp2.totalDanger) as totalDanger, |
| | | sum(temp2.totalDangerSr) as totalDangerSr, |
| | | sum(temp2.totalDangerCb) as totalDangerCb, |
| | | sum(temp2.totalDangerDw) as totalDangerDw |
| | | from( |
| | | SELECT |
| | | TEMP1.*, |
| | |
| | | SUM(CASE WHEN (tdi."danger_length") THEN tdi."danger_length" ELSE 0 END) AS dangerLength, |
| | | SUM(CASE WHEN (tdi."hazard_rating" != '无危害') THEN 1 ELSE 0 END) AS totalDangerNum, |
| | | SUM(CASE WHEN (tdi."investigation_variety" = '白蚁' and tdi."hazard_rating" != '无危害') THEN 1 ELSE 0 END) AS termiteNum, |
| | | SUM(CASE WHEN (tdi."investigation_variety" != '白蚁' and tdi."hazard_rating" != '无危害') THEN 1 ELSE 0 END) AS otherNum |
| | | SUM(CASE WHEN (tdi."investigation_variety" != '白蚁' and tdi."hazard_rating" != '无危害') THEN 1 ELSE 0 END) AS otherNum, |
| | | SUM(CASE WHEN (tdi."is_danger" != '否') THEN 1 ELSE 0 END) AS totalDanger, |
| | | SUM(CASE WHEN (json_value(tdi."danger_info", '$.sr') != '') THEN json_value(tdi."danger_info", '$.sr') ELSE 0 END) AS totalDangerSr, |
| | | SUM(CASE WHEN (json_value(tdi."danger_info", '$.cb') != '') THEN json_value(tdi."danger_info", '$.cb') ELSE 0 END) AS totalDangerCb, |
| | | SUM(CASE WHEN (json_value(tdi."danger_info", '$.dw') != '') THEN json_value(tdi."danger_info", '$.dw') ELSE 0 END) AS totalDangerDw |
| | | from sjzt_md."tb_dyke_investigation" tdi |
| | | where 1=1 |
| | | <if test="vo.tbYear !=null and vo.tbYear !=''"> |
| | |
| | | private String countyName; |
| | | private String townCode; |
| | | private String townName; |
| | | private String totalDanger;// 致险总处数 |
| | | private String totalDangerSr;// 渗漏总处数 |
| | | private String totalDangerCb;// 穿坝总处数 |
| | | private String totalDangerDw;// 跌窝总处数 |
| | | |
| | | } |
| | |
| | | private String tbStateId; |
| | | |
| | | private String hasDanger; |
| | | |
| | | private String totalDanger;// 致险总处数 |
| | | private String totalDangerSr;// 渗漏总处数 |
| | | private String totalDangerCb;// 穿坝总处数 |
| | | private String totalDangerDw;// 跌窝总处数 |
| | | } |