Commit 17d4e54c authored by 鲁鸿波's avatar 鲁鸿波

监督检查管理开发,危险作业监督检查修改

parent 820577c2
...@@ -10,6 +10,7 @@ import com.testor.module.emergency.model.vo.TContingencyPlanVO; ...@@ -10,6 +10,7 @@ import com.testor.module.emergency.model.vo.TContingencyPlanVO;
import com.testor.module.hazard.model.domain.THazardLicenseSignatureRecord; import com.testor.module.hazard.model.domain.THazardLicenseSignatureRecord;
import com.testor.module.hazard.model.dto.THazardWorkPlanCheckDelParam; import com.testor.module.hazard.model.dto.THazardWorkPlanCheckDelParam;
import com.testor.module.hazard.model.dto.THazardWorkPlanCheckParam; import com.testor.module.hazard.model.dto.THazardWorkPlanCheckParam;
import com.testor.module.safe.model.dto.TSafeHazardOrgParam;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
...@@ -38,6 +39,8 @@ import com.tongtech.tfw.backend.core.helper.bean.BeanHelper; ...@@ -38,6 +39,8 @@ import com.tongtech.tfw.backend.core.helper.bean.BeanHelper;
import com.testor.module.hazard.model.domain.THazardWorkPlanCheck; import com.testor.module.hazard.model.domain.THazardWorkPlanCheck;
import com.testor.module.hazard.service.THazardWorkPlanCheckService; import com.testor.module.hazard.service.THazardWorkPlanCheckService;
import javax.servlet.http.HttpServletResponse;
/** /**
* 危险作业计划监督检查Controller * 危险作业计划监督检查Controller
* *
...@@ -138,6 +141,27 @@ public class THazardWorkPlanCheckController extends SuperController ...@@ -138,6 +141,27 @@ public class THazardWorkPlanCheckController extends SuperController
return baseResponse; return baseResponse;
} }
@ApiOperation(value = "PC端监督检查管理列表", notes = "List THazardWorkPlanCheck with page")
@PostMapping(value = "/selectTHazardWorkPlanCheckManageList")
public BaseResponse<BaseResponseList<THazardWorkPlanCheck>> selectTHazardWorkPlanCheckManageList(@RequestBody THazardWorkPlanCheckParam param){
BaseResponse<BaseResponseList<THazardWorkPlanCheck>> baseResponse=new BaseResponse<>();
param.setCreateBy(getUserId());
Page<THazardWorkPlanCheck> resultList = tHazardWorkPlanCheckService.selectTHazardWorkPlanCheckManageList(param);
BaseResponseList<THazardWorkPlanCheck> baseResponseList=new BaseResponseList<>();
baseResponseList.setData(resultList.getRecords());
baseResponseList.setTotal(resultList.getTotal());
baseResponse.setData(baseResponseList);
return baseResponse;
}
@ApiOperation(value = "导出PC端监督检查管理列表 ", notes = "Get TSafeHazardOrg By Id")
@PostMapping(value = "/exportEntity")
public BaseResponse exportEntity(@RequestBody THazardWorkPlanCheckParam param, HttpServletResponse response) {
BaseResponse baseResponse = new BaseResponse<>();
tHazardWorkPlanCheckService.exportEntity(param, response);
return baseResponse;
}
@ApiOperation(value = "获取 危险作业计划监督检查详情 ", notes = "Get THazardWorkPlanCheck By Id") @ApiOperation(value = "获取 危险作业计划监督检查详情 ", notes = "Get THazardWorkPlanCheck By Id")
@GetMapping(value = "/detail") @GetMapping(value = "/detail")
public BaseResponse<THazardWorkPlanCheck> detail(String id){ public BaseResponse<THazardWorkPlanCheck> detail(String id){
......
...@@ -35,6 +35,22 @@ public interface THazardWorkPlanCheckDao extends SuperDao<THazardWorkPlanCheck> ...@@ -35,6 +35,22 @@ public interface THazardWorkPlanCheckDao extends SuperDao<THazardWorkPlanCheck>
*/ */
Page<THazardWorkPlanCheck> selectAppTHazardWorkPlanCheckList(IPage page, @Param("param") THazardWorkPlanCheckParam tHazardWorkPlanCheckParam); Page<THazardWorkPlanCheck> selectAppTHazardWorkPlanCheckList(IPage page, @Param("param") THazardWorkPlanCheckParam tHazardWorkPlanCheckParam);
/**
* App查询危险作业计划监督检查管理列表
*
* @param tHazardWorkPlanCheckParam 危险作业计划监督检查主键
* @return 危险作业计划监督检查
*/
Page<THazardWorkPlanCheck> selectTHazardWorkPlanCheckManageList(IPage page, @Param("param") THazardWorkPlanCheckParam tHazardWorkPlanCheckParam);
/**
* App查询危险作业计划监督检查管理列表
*
* @param tHazardWorkPlanCheckParam 危险作业计划监督检查主键
* @return 危险作业计划监督检查
*/
Page<THazardWorkPlanCheck> selectTHazardWorkPlanCheckManageExportList(@Param("param") THazardWorkPlanCheckParam tHazardWorkPlanCheckParam);
/** /**
* 查询危险作业计划监督检查详情 * 查询危险作业计划监督检查详情
* @param id * @param id
......
...@@ -109,6 +109,20 @@ public class THazardWorkPlanCheck extends SuperModel ...@@ -109,6 +109,20 @@ public class THazardWorkPlanCheck extends SuperModel
@TableField("basic_unit") @TableField("basic_unit")
private String basicUnit; private String basicUnit;
/**
* 检查单位id
*/
@ApiModelProperty(value = "检查单位id")
@TableField("check_id")
private String checkId;
/**
* 基层单位id
*/
@ApiModelProperty(value = "基层单位id")
@TableField("basic_id")
private String basicId;
/** /**
* 监督检查状态(1 暂存 2正式) * 监督检查状态(1 暂存 2正式)
*/ */
...@@ -126,9 +140,9 @@ public class THazardWorkPlanCheck extends SuperModel ...@@ -126,9 +140,9 @@ public class THazardWorkPlanCheck extends SuperModel
private Date checkSignatureTime; private Date checkSignatureTime;
/** /**
* 签字人姓名 * 检查人姓名
*/ */
@ApiModelProperty(value = "签字人姓名") @ApiModelProperty(value = "检查人姓名")
@TableField("check_name") @TableField("check_name")
private String checkName; private String checkName;
......
package com.testor.module.hazard.model.dto; package com.testor.module.hazard.model.dto;
import com.baomidou.mybatisplus.annotation.TableField;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
...@@ -19,6 +20,7 @@ import com.testor.module.hazard.model.domain.THazardWorkPlanCheck; ...@@ -19,6 +20,7 @@ import com.testor.module.hazard.model.domain.THazardWorkPlanCheck;
@EqualsAndHashCode(callSuper = true) @EqualsAndHashCode(callSuper = true)
public class THazardWorkPlanCheckParam extends THazardWorkPlanCheck { public class THazardWorkPlanCheckParam extends THazardWorkPlanCheck {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "每页数量") @ApiModelProperty(value = "每页数量")
private String limit; private String limit;
...@@ -31,4 +33,16 @@ public class THazardWorkPlanCheckParam extends THazardWorkPlanCheck { ...@@ -31,4 +33,16 @@ public class THazardWorkPlanCheckParam extends THazardWorkPlanCheck {
@ApiModelProperty(value = "排序方式") @ApiModelProperty(value = "排序方式")
private String orderType; private String orderType;
/**
* 单位id集合
*/
@ApiModelProperty(value = "单位id集合")
private List<String> orgIdList;
@ApiModelProperty(value = "检查开始时间")
private String startTime;
@ApiModelProperty(value = "检查结束时间")
private String endTime;
} }
package com.testor.module.hazard.model.vo;
import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.testor.common.util.excel.LocalDateTimeConverter;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.format.annotation.DateTimeFormat;
import java.util.Date;
/**
* @author rsq
* @program zlmy_boot
* @return
**/
@Data
@AllArgsConstructor
@NoArgsConstructor
public class HazardWorkPlanCheckVO {
@ExcelProperty(value = "序号", index = 0)
private Integer number;
@ExcelProperty(value = "隐患编号", index = 1)
private String code;
@ExcelProperty(value = "基层单位", index = 2)
private String basicUnit;
@ExcelProperty(value = "检查单位", index = 3)
private String checkUnit;
@ExcelProperty(value = "作业类型", index = 4)
private String workType;
@ExcelProperty(value = "作业级别", index = 5)
private String workLevel;
@ExcelProperty(value = "相关方作业", index = 6)
private String stakeholderWork;
@ExcelProperty(value = "是否合规", index = 7)
private String isCompliant;
@ExcelProperty(value = "问题类别", index = 8)
private String problemType;
@ExcelProperty(value = "检查描述", index = 9)
private String checkDescription;
@ExcelProperty(value = "检查人", index = 10)
private String checkName;
@ExcelProperty(value = "检查时间", index = 11)
private Date checkTime;
}
...@@ -6,9 +6,11 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page; ...@@ -6,9 +6,11 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.testor.module.hazard.model.domain.THazardWorkPlan; import com.testor.module.hazard.model.domain.THazardWorkPlan;
import com.testor.module.hazard.model.domain.THazardWorkPlanCheck; import com.testor.module.hazard.model.domain.THazardWorkPlanCheck;
import com.testor.module.hazard.model.dto.THazardWorkPlanCheckParam; import com.testor.module.hazard.model.dto.THazardWorkPlanCheckParam;
import com.testor.module.safe.model.dto.TSafeHazardOrgParam;
import com.tongtech.tfw.backend.common.models.supers.SuperService; import com.tongtech.tfw.backend.common.models.supers.SuperService;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import javax.servlet.http.HttpServletResponse;
import java.util.List; import java.util.List;
/** /**
...@@ -36,6 +38,14 @@ public interface THazardWorkPlanCheckService extends SuperService<THazardWorkPla ...@@ -36,6 +38,14 @@ public interface THazardWorkPlanCheckService extends SuperService<THazardWorkPla
*/ */
Page<THazardWorkPlanCheck> selectAppTHazardWorkPlanCheckList(THazardWorkPlanCheckParam tHazardWorkPlanCheckParam); Page<THazardWorkPlanCheck> selectAppTHazardWorkPlanCheckList(THazardWorkPlanCheckParam tHazardWorkPlanCheckParam);
/**
* 查询危险作业计划监督检查管理列表
*
* @param tHazardWorkPlanCheckParam 危险作业计划监督检查主键
* @return 危险作业计划监督检查
*/
Page<THazardWorkPlanCheck> selectTHazardWorkPlanCheckManageList(THazardWorkPlanCheckParam tHazardWorkPlanCheckParam);
/** /**
* 新增危险作业监督检查 * 新增危险作业监督检查
* @param addRequest * @param addRequest
...@@ -50,4 +60,12 @@ public interface THazardWorkPlanCheckService extends SuperService<THazardWorkPla ...@@ -50,4 +60,12 @@ public interface THazardWorkPlanCheckService extends SuperService<THazardWorkPla
*/ */
THazardWorkPlanCheck detail(String id); THazardWorkPlanCheck detail(String id);
/**
* 导出PC端监督检查管理列表
* @param param
* @param response
* @return
*/
void exportEntity(THazardWorkPlanCheckParam param, HttpServletResponse response);
} }
package com.testor.module.hazard.service.impl; package com.testor.module.hazard.service.impl;
import cn.hutool.core.util.ObjectUtil; import cn.hutool.core.util.ObjectUtil;
import com.alibaba.excel.EasyExcel;
import com.alibaba.excel.EasyExcelFactory;
import com.alibaba.excel.ExcelWriter;
import com.alibaba.excel.write.metadata.WriteSheet;
import com.alibaba.excel.write.style.column.LongestMatchColumnWidthStyleStrategy;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.testor.module.emergency.model.vo.TContingencyPlanVO; import com.testor.module.emergency.model.vo.TContingencyPlanVO;
...@@ -8,14 +13,26 @@ import com.testor.module.hazard.dao.THazardWorkPlanCheckDao; ...@@ -8,14 +13,26 @@ import com.testor.module.hazard.dao.THazardWorkPlanCheckDao;
import com.testor.module.hazard.model.domain.THazardWorkPlan; import com.testor.module.hazard.model.domain.THazardWorkPlan;
import com.testor.module.hazard.model.domain.THazardWorkPlanCheck; import com.testor.module.hazard.model.domain.THazardWorkPlanCheck;
import com.testor.module.hazard.model.dto.THazardWorkPlanCheckParam; import com.testor.module.hazard.model.dto.THazardWorkPlanCheckParam;
import com.testor.module.hazard.model.vo.HazardWorkPlanCheckVO;
import com.testor.module.hazard.service.THazardWorkPlanCheckService; import com.testor.module.hazard.service.THazardWorkPlanCheckService;
import com.testor.module.notice.dao.TSysOrgDao;
import com.testor.module.safe.model.vo.TSafeHazardExportVO;
import com.testor.module.safe.service.impl.TSafeHazardOrgServiceImpl;
import com.tongtech.tfw.backend.core.helper.IdHelper; import com.tongtech.tfw.backend.core.helper.IdHelper;
import com.tongtech.tfw.backend.core.helper.ObjectHelper; import com.tongtech.tfw.backend.core.helper.ObjectHelper;
import com.tongtech.tfw.backend.core.helper.bean.BeanHelper; import com.tongtech.tfw.backend.core.helper.bean.BeanHelper;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import com.tongtech.tfw.backend.common.models.supers.SuperServiceImpl; import com.tongtech.tfw.backend.common.models.supers.SuperServiceImpl;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.net.URLEncoder;
import java.util.ArrayList;
import java.util.Collections; import java.util.Collections;
import java.util.List; import java.util.List;
...@@ -28,9 +45,15 @@ import java.util.List; ...@@ -28,9 +45,15 @@ import java.util.List;
@Service @Service
public class THazardWorkPlanCheckServiceImpl extends SuperServiceImpl<THazardWorkPlanCheckDao, THazardWorkPlanCheck> implements THazardWorkPlanCheckService public class THazardWorkPlanCheckServiceImpl extends SuperServiceImpl<THazardWorkPlanCheckDao, THazardWorkPlanCheck> implements THazardWorkPlanCheckService
{ {
private static final Logger logger = LoggerFactory.getLogger(TSafeHazardOrgServiceImpl.class);
@Autowired(required = false) @Autowired(required = false)
private THazardWorkPlanCheckDao tHazardWorkPlanCheckDao; private THazardWorkPlanCheckDao tHazardWorkPlanCheckDao;
@Autowired
private TSysOrgDao orgDao;
@Override @Override
public Page<THazardWorkPlanCheck> selectTHazardWorkPlanCheckList(THazardWorkPlanCheckParam tHazardWorkPlanCheckParam) { public Page<THazardWorkPlanCheck> selectTHazardWorkPlanCheckList(THazardWorkPlanCheckParam tHazardWorkPlanCheckParam) {
IPage<THazardWorkPlanCheck> page = new Page<>(Long.valueOf(tHazardWorkPlanCheckParam.getPage()), Long.valueOf(tHazardWorkPlanCheckParam.getLimit())); IPage<THazardWorkPlanCheck> page = new Page<>(Long.valueOf(tHazardWorkPlanCheckParam.getPage()), Long.valueOf(tHazardWorkPlanCheckParam.getLimit()));
...@@ -43,6 +66,15 @@ public class THazardWorkPlanCheckServiceImpl extends SuperServiceImpl<THazardWor ...@@ -43,6 +66,15 @@ public class THazardWorkPlanCheckServiceImpl extends SuperServiceImpl<THazardWor
return this.baseMapper.selectAppTHazardWorkPlanCheckList(page,tHazardWorkPlanCheckParam); return this.baseMapper.selectAppTHazardWorkPlanCheckList(page,tHazardWorkPlanCheckParam);
} }
@Override
public Page<THazardWorkPlanCheck> selectTHazardWorkPlanCheckManageList(THazardWorkPlanCheckParam tHazardWorkPlanCheckParam) {
IPage<THazardWorkPlanCheck> page = new Page<>(Long.valueOf(tHazardWorkPlanCheckParam.getPage()), Long.valueOf(tHazardWorkPlanCheckParam.getLimit()));
if(null != tHazardWorkPlanCheckParam.getOrgIdList() && tHazardWorkPlanCheckParam.getOrgIdList().size()>0){
tHazardWorkPlanCheckParam.setOrgIdList(orgDao.selectAllSubId(tHazardWorkPlanCheckParam.getOrgIdList()));
}
return this.baseMapper.selectTHazardWorkPlanCheckManageList(page,tHazardWorkPlanCheckParam);
}
@Override @Override
public THazardWorkPlanCheck addEntity(THazardWorkPlanCheck addRequest) { public THazardWorkPlanCheck addEntity(THazardWorkPlanCheck addRequest) {
if(ObjectHelper.isNotEmpty(addRequest)){ if(ObjectHelper.isNotEmpty(addRequest)){
...@@ -65,5 +97,47 @@ public class THazardWorkPlanCheckServiceImpl extends SuperServiceImpl<THazardWor ...@@ -65,5 +97,47 @@ public class THazardWorkPlanCheckServiceImpl extends SuperServiceImpl<THazardWor
return this.baseMapper.detail(id); return this.baseMapper.detail(id);
} }
@Override
public void exportEntity(THazardWorkPlanCheckParam param, HttpServletResponse response) {
try{
List<HazardWorkPlanCheckVO> hazardWorkPlanCheckVOList = new ArrayList<>();
Page<THazardWorkPlanCheck> tHazardWorkPlanCheckPage = this.baseMapper.selectTHazardWorkPlanCheckManageExportList(param);
List<THazardWorkPlanCheck> records = tHazardWorkPlanCheckPage.getRecords();
int i = 1;
for (THazardWorkPlanCheck entity : records) {
HazardWorkPlanCheckVO vo = new HazardWorkPlanCheckVO();
BeanUtils.copyProperties(entity, vo); // 复制属性
vo.setNumber(i);
i =i+1;
hazardWorkPlanCheckVOList.add(vo);
}
logger.info("**************************************写入模板*****************************");
// response.setContentType("application/vnd.ms-excel");
// response.setCharacterEncoding("utf-8");
// String fileName = URLEncoder.encode("隐患台账", "utf-8");
// response.setHeader("Content-Disposition", "attachment;filename=" + fileName + ".xlsx");
// response.addHeader("Pargam", "no-cache");
// response.addHeader("Cache-Control", "no-cache");
String fileName = "隐患台账";
response.setContentType("application/vnd.ms-excel;charset=utf-8");
response.setHeader("Content-Disposition", "attachment;filename=" + URLEncoder.encode(fileName, "UTF-8") + ".xlsx");
WriteSheet dealerSheet = EasyExcel.writerSheet(0, "监督检查导出明细")
.registerWriteHandler(new LongestMatchColumnWidthStyleStrategy()).head(HazardWorkPlanCheckVO.class).build();
ExcelWriter build = EasyExcelFactory.write(response.getOutputStream()).build();
build.write(hazardWorkPlanCheckVOList,dealerSheet);
build.finish();
} catch (UnsupportedEncodingException e) {
throw new RuntimeException(e);
} catch (IOException e) {
throw new RuntimeException(e);
}
}
} }
...@@ -21,4 +21,6 @@ public interface TSysOrgDao extends SuperDao<TSysOrg> { ...@@ -21,4 +21,6 @@ public interface TSysOrgDao extends SuperDao<TSysOrg> {
List<TreeVO> findTreeByPid(@Param("id") Integer id) ; List<TreeVO> findTreeByPid(@Param("id") Integer id) ;
List<String> selectAllSubId(@Param("orgIds") List<String> orgIds);
} }
...@@ -19,4 +19,22 @@ ...@@ -19,4 +19,22 @@
select org_id , org_name , parent_id from t_sys_org where parent_id = #{id} select org_id , org_name , parent_id from t_sys_org where parent_id = #{id}
</select> </select>
<!--查询父id下所有的子id-->
<select id="selectAllSubId" resultType="string">
SELECT org_id FROM t_sys_org
WHERE status = '0' and is_dept = '0'
START WITH parent_id in
<foreach item="id" collection="orgIds" open="(" separator="," close=")">
#{id}
</foreach>
CONNECT BY PRIOR org_id = parent_id
union all
SELECT org_id FROM t_sys_org
WHERE status = '0' and is_dept = '0' and org_id in
<foreach item="id" collection="orgIds" open="(" separator="," close=")">
#{id}
</foreach>
</select>
</mapper> </mapper>
\ No newline at end of file
...@@ -38,6 +38,106 @@ ...@@ -38,6 +38,106 @@
order by hwpc.check_time desc order by hwpc.check_time desc
</select> </select>
<select id="selectTHazardWorkPlanCheckManageList" resultMap="BaseResultMap">
select hwpc.*,hwp.code code,hwp.work_type workType,hwp.work_level workLevel,hwp.stakeholder_work stakeholderWork
from t_hazard_work_plan_check hwpc
left join t_hazard_work_plan hwp on hwpc.plan_id = hwp.id
where hwpc.status = '0'
<if test="param.code!=null and param.code!=''">
and hwp.code like concat('%', #{param.code}, '%')
</if>
<if test="param.workType!=null and param.workType!=''">
and hwp.work_type = #{param.workType}
</if>
<if test="param.workLevel!=null and param.workLevel!=''">
and hwp.work_level = #{param.workLevel}
</if>
<if test="param.stakeholderWork!=null and param.stakeholderWork!=''">
and hwp.stakeholder_work = #{param.stakeholderWork}
</if>
<if test="param.isCompliant!=null and param.isCompliant!=''">
and hwpc.is_compliant = #{param.isCompliant}
</if>
<if test="param.problemType!=null and param.problemType!=''">
and hwpc.problem_type = #{param.problemType}
</if>
<if test="param.checkDescription!=null and param.checkDescription!=''">
and hwpc.check_description like concat('%', #{param.checkDescription}, '%')
</if>
<if test="param.checkName!=null and param.checkName!=''">
and hwpc.check_name like concat('%', #{param.checkName}, '%')
</if>
<if test="param.startTime != null and param.endTime != null">
and hwpc.check_time between #{param.startTime} and #{param.endTime}
</if>
<if test="param.orgIdList != null and param.orgIdList.size()>0">
and (
<foreach item="id" collection="param.orgIdList" separator=" OR ">
hwpc.basic_id LIKE concat('%', #{id}, '%')
</foreach>
)
</if>
order by hwpc.check_time desc
</select>
<select id="selectTHazardWorkPlanCheckManageExportList" resultMap="BaseResultMap">
select
hwpc.id,hwpc.plan_id,hwpc.check_time,hwpc.is_compliant,dd4.dict_value problem_type,hwpc.check_description,hwpc.check_images,hwpc.check_signature,hwpc.status,
hwpc.create_by,hwpc.create_date,hwpc.update_by,hwpc.update_date,hwpc.remarks,hwpc.check_unit,hwpc.basic_unit,hwpc.check_status,hwpc.check_signature_time,hwpc.check_name,hwpc.check_id,hwpc.basic_id,
hwp.code code,
dd.dict_value as workType,
dd2.dict_value workLevel,
dd3.dict_value stakeholderWork
from
t_hazard_work_plan_check hwpc
left join
t_hazard_work_plan hwp on hwpc.plan_id = hwp.id
left join
t_sys_dict_data dd on hwp.work_type = dd.dict_data_id
left join
t_sys_dict_data dd2 on hwp.work_level = dd2.dict_data_id
left join
t_sys_dict_data dd3 on hwp.stakeholder_work = dd3.dict_data_id
left join
t_sys_dict_data dd4 on hwpc.problem_type = dd4.dict_data_id
where hwpc.status = '0'
<if test="param.code!=null and param.code!=''">
and hwp.code like concat('%', #{param.code}, '%')
</if>
<if test="param.workType!=null and param.workType!=''">
and hwp.work_type = #{param.workType}
</if>
<if test="param.workLevel!=null and param.workLevel!=''">
and hwp.work_level = #{param.workLevel}
</if>
<if test="param.stakeholderWork!=null and param.stakeholderWork!=''">
and hwp.stakeholder_work = #{param.stakeholderWork}
</if>
<if test="param.isCompliant!=null and param.isCompliant!=''">
and hwpc.is_compliant = #{param.isCompliant}
</if>
<if test="param.problemType!=null and param.problemType!=''">
and hwpc.problem_type = #{param.problemType}
</if>
<if test="param.checkDescription!=null and param.checkDescription!=''">
and hwpc.check_description like concat('%', #{param.checkDescription}, '%')
</if>
<if test="param.checkName!=null and param.checkName!=''">
and hwpc.check_name like concat('%', #{param.checkName}, '%')
</if>
<if test="param.startTime != null and param.endTime != null">
and hwpc.check_time between #{param.startTime} and #{param.endTime}
</if>
<if test="param.orgIdList != null and param.orgIdList.size()>0">
and (
<foreach item="id" collection="param.orgIdList" separator=" OR ">
hwpc.basic_id LIKE concat('%', #{id}, '%')
</foreach>
)
</if>
order by hwpc.check_time desc
</select>
<select id="detail" resultMap="BaseResultMap"> <select id="detail" resultMap="BaseResultMap">
select hwpc.*,hwp.code code,hwp.work_type workType,hwp.work_level workLevel,hwp.stakeholder_work stakeholderWork select hwpc.*,hwp.code code,hwp.work_type workType,hwp.work_level workLevel,hwp.stakeholder_work stakeholderWork
from t_hazard_work_plan_check hwpc from t_hazard_work_plan_check hwpc
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment