Merge remote-tracking branch 'origin/dev' into dev

pull/4/head
chenxinying 2024-02-03 14:05:40 +08:00
commit e103c37e86
15 changed files with 1435 additions and 24 deletions

View File

@ -1867,4 +1867,65 @@ public class AppHiddenController extends BaseController {
map.put("result",errInfo);
return map;
}
/**
*
*
* @param
* @throws Exception
*/
@RequestMapping(value = "/listRiskStandard")
@ResponseBody
public Object listRiskStandard() throws Exception {
Map<String, Object> map = new HashMap<String, Object>();
String errInfo = "success";
PageData pd = new PageData();
Page page = new Page();
pd = this.getPageData();
page.setCurrentPage(Integer.parseInt(pd.get("currentPage").toString()));
page.setShowCount(Integer.parseInt(pd.get("showCount").toString()));
page.setTotalResult(Integer.parseInt(pd.get("totalResult").toString()));
// String DEPARTMENT_ID = pd.getString("USERDEPT");
// String ids = departmentService.getDEPARTMENT_IDS(DEPARTMENT_ID);
// if(ids!=null && Tools.notEmpty(ids)) {
// ids = ids.substring(0,ids.lastIndexOf(","));
// pd.put("DEPARTMENT_IDS", ids.split(","));
// }
String KEYWORDS = pd.getString("KEYWORDS"); // 关键词检索条件
if (Tools.notEmpty(KEYWORDS))
pd.put("KEYWORDS", KEYWORDS.trim());
String HIDDENDESCR = pd.getString("HIDDENDESCR"); // 关键词检索条件
if (Tools.notEmpty(HIDDENDESCR))
pd.put("HIDDENDESCR", HIDDENDESCR.trim());
String ISQUALIFIED = pd.getString("ISQUALIFIED"); // 关键词检索条件
if (Tools.notEmpty(ISQUALIFIED))
pd.put("ISQUALIFIED", ISQUALIFIED.trim());
String HIDDENLEVELE = pd.getString("HIDDENLEVELE"); // 关键词检索条件
if (Tools.notEmpty(HIDDENLEVELE))
pd.put("HIDDENLEVELE", HIDDENLEVELE.trim());
String STARTTIME = pd.getString("STARTTIME"); // 关键词检索条件
if (Tools.notEmpty(STARTTIME))
pd.put("STARTTIME", STARTTIME.trim());
String ENDTIME = pd.getString("ENDTIME"); // 关键词检索条件
if (Tools.notEmpty(ENDTIME))
pd.put("ENDTIME", ENDTIME.trim());
if (pd.get("isIndex") != null && Tools.notEmpty(pd.get("isIndex").toString())
&& pd.get("isIndex").toString().equals("1")) {
pd.put("SELF_USER_ID", pd.get("SELFUSERID"));
}
pd.put("ISMAIN", "0");
String DISPOSESTATE = pd.getString("DISPOSESTATE"); // 关键词检索条件
if (Tools.notEmpty(DISPOSESTATE)) {
pd.put("DISPOSESTATE", DISPOSESTATE.trim());
pd.put("SELFUSERID", pd.get("SELFUSERID"));
pd.put("USERDEPT", pd.get("USERDEPT"));
}
page.setPd(pd);
List<PageData> varList = hiddenService.listRiskStandard(page); // 列出Hidden列表
varList = hiddenUserService.getRiskStandardHiddenFindUser(varList);
map.put("varList", varList);
map.put("page", page);
map.put("result", errInfo);
return map;
}
}

View File

@ -17,10 +17,7 @@ import com.zcloud.service.hidden.HiddenService;
import com.zcloud.service.hiddenApi.HiddenApiService;
import com.zcloud.service.hiddenApi.HiddenCheckApiService;
import com.zcloud.service.hiddenApi.HiddenExamineApiService;
import com.zcloud.service.hiddenDangerCheckStandard.CustomHiddenExamineService;
import com.zcloud.service.hiddenDangerCheckStandard.CustomHiddenService;
import com.zcloud.service.hiddenDangerCheckStandard.CustomHiddenUserService;
import com.zcloud.service.hiddenDangerCheckStandard.CustomItemService;
import com.zcloud.service.hiddenDangerCheckStandard.*;
import com.zcloud.service.inspection.SafetyEnvironmentalService;
import com.zcloud.service.sms.MSMLoginService;
import com.zcloud.service.sms.SMSManagementService;
@ -75,9 +72,9 @@ public class AppCustomHiddenController extends BaseController {
@Autowired
private DepartmentService departmentService;
@Autowired
private HiddenSchemeService hiddenSchemeService;
private CustomHiddenSchemeService customHiddenSchemeService;
@Autowired
private HiddenCheckService hiddenCheckService;
private CustomHiddenCheckService customHiddenCheckService;
@Autowired
private CorpInfoService corpinfoService;
@Autowired
@ -605,7 +602,7 @@ public class AppCustomHiddenController extends BaseController {
/*pd2.put("TYPE",5);
List<PageData> cImgs = imgFilesService.listAll(pd2);//验收图片
*/ //查询整改方案
PageData hs = hiddenSchemeService.findByHdId(pd);
PageData hs = customHiddenSchemeService.findByHdId(pd);
List<PageData> sImgs = new ArrayList<PageData>();
if(hs != null && hs.getString("HIDDENSCHEME_ID") != null) {
@ -615,7 +612,7 @@ public class AppCustomHiddenController extends BaseController {
sImgs = imgFilesService.listAll(pd3);//方案图片
}
List<PageData> checkList = hiddenCheckService.listAll(pd);
List<PageData> checkList = customHiddenCheckService.listAll(pd);
if(checkList != null && checkList.size() > 0) {
PageData pd3 = new PageData();
pd3.put("TYPE",5);
@ -911,7 +908,7 @@ public class AppCustomHiddenController extends BaseController {
map.put("msg", "文件格式不正确!");
return map;
}
PageData hs = hiddenSchemeService.findById(pd);
PageData hs = customHiddenSchemeService.findById(pd);
String ffile = DateUtil.getDays();
// String filePath = PathUtil.getProjectpath() + Const.FILEPATHFILE + ffile; //文件上传路径
// String fileName = FileUpload.fileUp(file, filePath, this.get32UUID()); //执行上传
@ -920,7 +917,7 @@ public class AppCustomHiddenController extends BaseController {
smb.sshSftp(file, fileName, Const.FILEPATHFILE + ffile);
pd.put("FILEPATH", Const.FILEPATHFILE + ffile + "/" + fileName);
hs.put("ISDELETE", "0");
hiddenSchemeService.edit(hs);
customHiddenSchemeService.edit(hs);
}
return map;
@ -948,7 +945,7 @@ public class AppCustomHiddenController extends BaseController {
customHiddenService.rectify(pd);
pd.put("HIDDENSCHEME_ID", this.get32UUID()); // 主键
hiddenSchemeService.deleteHd(pd);
customHiddenSchemeService.deleteHd(pd);
if (Tools.notEmpty(pd.get("HAVESCHEME").toString())) {
pd.put("CREATOR", pd.get("USER_ID")); //
pd.put("CREATTIME", DateUtil.date2Str(new Date())); //
@ -956,9 +953,9 @@ public class AppCustomHiddenController extends BaseController {
pd.put("OPERATTIME", DateUtil.date2Str(new Date())); //
pd.put("ISDELETE", "0"); // 是否删除 1 删除 0未删除
pd.put("CORPINFO_ID", pd.get("CORPINFO_ID")); // 企业id
hiddenSchemeService.save(pd);
customHiddenSchemeService.save(pd);
}
this.hiddenCheckService.delete(pd);
this.customHiddenCheckService.delete(pd);
if(Tools.notEmpty(pd.getString("CHECKOR"))){//判断验收人是否空,否就发送站内信
PageData mes = new PageData();
PageData hiddenPd = customHiddenService.findById(pd);
@ -979,7 +976,7 @@ public class AppCustomHiddenController extends BaseController {
other.put("DEPARTMENT_ID", json.get("DEPARTMENT_ID"));
other.put("USER_ID", json.get("USER_ID"));
other.put("STATUS", "0");
hiddenCheckService.save(other);
customHiddenCheckService.save(other);
PageData hiddenPd = customHiddenService.findById(pd);
messageService.sendMessageByParameter("HIDDEN_MAIL_004","友情提示:有一条隐患需要验收",
hiddenPd.getString("CORPINFO_ID"),json.get("USER_ID").toString(),hiddenPd.getString("HIDDEN_ID"),
@ -1031,7 +1028,7 @@ public class AppCustomHiddenController extends BaseController {
file.delete();
}
}
hiddenSchemeService.deleteHd(pd);
customHiddenSchemeService.deleteHd(pd);
imgFilesService.deleteList(pic);
}
@ -1054,24 +1051,24 @@ public class AppCustomHiddenController extends BaseController {
PageData pd = new PageData();
pd = this.getPageData();
if (pd.get("ISQUALIFIED").equals("1")) { //验收合格
List<PageData> pd2 = (List<PageData>) this.hiddenCheckService.findByHidden(pd); //获取这个隐患的验收人信息
List<PageData> pd2 = (List<PageData>) this.customHiddenCheckService.findByHidden(pd); //获取这个隐患的验收人信息
if(pd2.size()>0){
for(PageData checklist: pd2){
pd.put("STATUS", 1);
pd.put("HIDDENCHECK_ID", checklist.get("HIDDENCHECK_ID"));
pd.put("DEPARTMENT_ID", checklist.get("DEPARTMENT_ID"));
pd.put("USER_ID", checklist.get("USER_ID"));
hiddenCheckService.edit(pd);
customHiddenCheckService.edit(pd);
}
}
// List<PageData> checkList = hiddenCheckService.listAll(pd);
// List<PageData> checkList = customHiddenCheckService.listAll(pd);
// for (PageData check : checkList) {
// if (check.get("STATUS").toString().equals("0")) {
// break;
// }
// }
List<PageData> checkList = hiddenCheckService.listAll(pd);
List<PageData> checkList = customHiddenCheckService.listAll(pd);
for (PageData check : checkList) {
if (check.get("STATUS").toString().equals("0")) {
map.put("result", errInfo);
@ -1221,7 +1218,7 @@ public class AppCustomHiddenController extends BaseController {
/*
* pd2.put("TYPE",5); List<PageData> cImgs = imgFilesService.listAll(pd2);//验收图片 d770367816c34f53bf22177da3965f6c
*/ // 查询整改方案
PageData hs = hiddenSchemeService.findByHdId(pd);
PageData hs = customHiddenSchemeService.findByHdId(pd);
List<PageData> sImgs = new ArrayList<PageData>();
if (hs != null && hs.getString("HIDDENSCHEME_ID") != null) {
@ -1238,7 +1235,7 @@ public class AppCustomHiddenController extends BaseController {
sImgs.addAll(sImgs2);
}
List<PageData> checkList = hiddenCheckService.listAll(pd);
List<PageData> checkList = customHiddenCheckService.listAll(pd);
if (checkList != null && checkList.size() > 0) {
PageData pd3 = new PageData();
pd3.put("TYPE", 5);
@ -1860,7 +1857,7 @@ public class AppCustomHiddenController extends BaseController {
String errInfo = "success";
PageData pd = new PageData();
pd = this.getPageData();
List<PageData> checkList = (List<PageData>) hiddenCheckService.findByHidden(pd);
List<PageData> checkList = (List<PageData>) customHiddenCheckService.findByHidden(pd);
if(checkList.size()>0){
for(PageData arr:checkList){
if(arr.getString("STATUS").equals("1")){

View File

@ -63,5 +63,6 @@ public interface HiddenUserMapper{
void deleteByHidden (PageData pd);
List<PageData> verifylist(PageData pd);
List<PageData> listRiskStandardAllUser(PageData pd);
}

View File

@ -308,5 +308,11 @@ public interface HiddenMapper{
PageData findByEmisId(PageData pd);
List<PageData> getListForemisdatalistPage(Page page);
/**
* @param page
* @throws Exception
*/
List<PageData> riskStandardlistPage(Page page);
}

View File

@ -0,0 +1,77 @@
package com.zcloud.mapper.datasource.hiddenDangerCheckStandard;
import com.zcloud.entity.Page;
import com.zcloud.entity.PageData;
import java.util.List;
/**
*
* luoxiaobao
* 2021-01-15
* www.zcloudchina.com
*/
public interface CustomHiddenSchemeMapper {
/**
* @param pd
* @throws Exception
*/
void save(PageData pd);
/**
* @param pd
* @throws Exception
*/
void delete(PageData pd);
/**
* @param pd
* @throws Exception
*/
void deleteHd(PageData pd);
/**
* @param pd
* @throws Exception
*/
void edit(PageData pd);
/**
* @param page
* @throws Exception
*/
List<PageData> datalistPage(Page page);
/**()
* @param pd
* @throws Exception
*/
List<PageData> listAll(PageData pd);
/**id
* @param pd
* @throws Exception
*/
PageData findById(PageData pd);
/**id
* @param pd
* @throws Exception
*/
PageData findByHdId(PageData pd);
/**
* @param ArrayDATA_IDS
* @throws Exception
*/
void deleteAll(String[] ArrayDATA_IDS);
/**()
* @param pd
* @throws Exception
*/
List<PageData> listExport(PageData pd);
}

View File

@ -91,5 +91,13 @@ public interface HiddenUserService{
* @throws Exception
*/
void deleteByHidden (PageData pd) throws Exception;
/**
*
* @param varList
* @return
* @throws Exception
*/
public List<PageData> getRiskStandardHiddenFindUser(List<PageData> varList) throws Exception;
}

View File

@ -192,5 +192,66 @@ public class HiddenUserServiceImpl implements HiddenUserService{
public void deleteByHidden(PageData pd) throws Exception {
hiddenuserMapper.deleteByHidden(pd);
}
/**
*
* @param varList
* @return
* @throws Exception
*/
public List<PageData> getRiskStandardHiddenFindUser(List<PageData> varList) throws Exception{
if(varList.size() == 0){
return varList;
}
Map<String,Integer> mapKey = new HashMap<>();
String [] hiddenIds = new String[varList.size()];
for (int i =0 ;i<varList.size();i++){
hiddenIds[i] = varList.get(i).getString("HIDDEN_ID");
mapKey.put(varList.get(i).getString("HIDDEN_ID"),i);
}
List<PageData> hiddenFindUserList = this.getRiskStandardHiddenUserByHiddenIds(hiddenIds,"1");
Map<String,Object> hiddenUserMap = new HashMap<>();
for (PageData pageData : hiddenFindUserList){
String hiddenId = pageData.getString("HIDDEN_ID");
String userName = pageData.getString("NAME") +";";
String deptName = pageData.getString("deptName")+";";
if(hiddenUserMap.containsKey(hiddenId + "findUserNames")){
userName += hiddenUserMap.get(hiddenId +"findUserNames");
deptName += hiddenUserMap.get(hiddenId +"findDeptNames");
}
hiddenUserMap.put(hiddenId +"findUserNames",userName);
hiddenUserMap.put(hiddenId +"findDeptNames",deptName);
}
for (PageData pageData:varList){
String hiddenId = pageData.getString("HIDDEN_ID");
if(hiddenUserMap.containsKey(hiddenId + "findUserNames")){
pageData.put("findUserNames" ,hiddenUserMap.get(hiddenId + "findUserNames") );
if(pageData.getString("findUserNames").lastIndexOf(";") == pageData.getString("findUserNames").length() - 1){ //判断最后一个的索引是否是;
pageData.put("findUserNames" ,pageData.getString("findUserNames").substring(0,pageData.getString("findUserNames").length() - 1));
}
}
if(hiddenUserMap.containsKey(hiddenId + "findDeptNames")){
pageData.put("findDeptNames" ,hiddenUserMap.get(hiddenId + "findDeptNames") );
if(pageData.getString("findDeptNames").lastIndexOf(";") == pageData.getString("findDeptNames").length() - 1){ //判断最后一个的索引是否是;
pageData.put("findDeptNames" ,pageData.getString("findDeptNames").substring(0,pageData.getString("findDeptNames").length() - 1));
}
}
}
return varList;
}
/**
* ids
* @param hiddenIds
* @return
* @throws Exception
*/
public List<PageData> getRiskStandardHiddenUserByHiddenIds (String [] hiddenIds ,String type) throws Exception{
PageData pageData = new PageData();
pageData.put("TYPE",type);
if(hiddenIds.length>0){
pageData.put("hiddenIds",hiddenIds);
}
return hiddenuserMapper.listRiskStandardAllUser(pageData);
}
}

View File

@ -371,5 +371,11 @@ public interface HiddenService{
public PageData findByEmisId(PageData pd)throws Exception;
public List<PageData> getListForemis(Page page)throws Exception;
/**
* @param page
* @throws Exception
*/
public List<PageData> listRiskStandard(Page page)throws Exception;
}

View File

@ -786,5 +786,13 @@ public class HiddenServiceImpl implements HiddenService {
.head(excel.getHead())
.doWrite(excel.getHand());
}
/**
* @param page
* @throws Exception
*/
public List<PageData> listRiskStandard(Page page)throws Exception{
return hiddenMapper.riskStandardlistPage(page);
}
}

View File

@ -0,0 +1,78 @@
package com.zcloud.service.hiddenDangerCheckStandard;
import com.zcloud.entity.Page;
import com.zcloud.entity.PageData;
import java.util.List;
/**
*
* luoxiaobao
* 2021-01-15
* www.zcloudchina.com
*/
public interface CustomHiddenSchemeService {
/**
* @param pd
* @throws Exception
*/
public void save(PageData pd)throws Exception;
/**
* @param pd
* @throws Exception
*/
public void delete(PageData pd)throws Exception;
/**
* @param pd
* @throws Exception
*/
public void deleteHd(PageData pd)throws Exception;
/**
* @param pd
* @throws Exception
*/
public void edit(PageData pd)throws Exception;
/**
* @param page
* @throws Exception
*/
public List<PageData> list(Page page)throws Exception;
/**()
* @param pd
* @throws Exception
*/
public List<PageData> listAll(PageData pd)throws Exception;
/**id
* @param pd
* @throws Exception
*/
public PageData findById(PageData pd)throws Exception;
/**id
* @param pd
* @throws Exception
*/
public PageData findByHdId(PageData pd)throws Exception;
/**
* @param ArrayDATA_IDS
* @throws Exception
*/
public void deleteAll(String[] ArrayDATA_IDS)throws Exception;
/**()
* @param pd
* @throws Exception
*/
public List<PageData> listExport(PageData pd)throws Exception;
}

View File

@ -0,0 +1,108 @@
package com.zcloud.service.hiddenDangerCheckStandard.impl;
import com.zcloud.entity.Page;
import com.zcloud.entity.PageData;
import com.zcloud.mapper.datasource.hidden.HiddenSchemeMapper;
import com.zcloud.mapper.datasource.hiddenDangerCheckStandard.CustomHiddenSchemeMapper;
import com.zcloud.service.hidden.HiddenSchemeService;
import com.zcloud.service.hiddenDangerCheckStandard.CustomHiddenSchemeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.List;
/**
*
* luoxiaobao
* 2021-01-15
* www.zcloudchina.com
*/
@Service
@Transactional //开启事物
public class CustomHiddenSchemeServiceImpl implements CustomHiddenSchemeService {
@Autowired
private CustomHiddenSchemeMapper customHiddenSchemeMapper;
/**
* @param pd
* @throws Exception
*/
public void save(PageData pd)throws Exception{
customHiddenSchemeMapper.save(pd);
}
/**
* @param pd
* @throws Exception
*/
public void delete(PageData pd)throws Exception{
customHiddenSchemeMapper.delete(pd);
}
/**
* @param pd
* @throws Exception
*/
public void deleteHd(PageData pd)throws Exception{
customHiddenSchemeMapper.deleteHd(pd);
}
/**
* @param pd
* @throws Exception
*/
public void edit(PageData pd)throws Exception{
customHiddenSchemeMapper.edit(pd);
}
/**
* @param page
* @throws Exception
*/
public List<PageData> list(Page page)throws Exception{
return customHiddenSchemeMapper.datalistPage(page);
}
/**()
* @param pd
* @throws Exception
*/
public List<PageData> listAll(PageData pd)throws Exception{
return customHiddenSchemeMapper.listAll(pd);
}
/**id
* @param pd
* @throws Exception
*/
public PageData findById(PageData pd)throws Exception{
return customHiddenSchemeMapper.findById(pd);
}
/**id
* @param pd
* @throws Exception
*/
public PageData findByHdId(PageData pd)throws Exception{
return customHiddenSchemeMapper.findByHdId(pd);
}
/**
* @param ArrayDATA_IDS
* @throws Exception
*/
public void deleteAll(String[] ArrayDATA_IDS)throws Exception{
customHiddenSchemeMapper.deleteAll(ArrayDATA_IDS);
}
/**()
* @param pd
* @throws Exception
*/
public List<PageData> listExport(PageData pd)throws Exception{
return customHiddenSchemeMapper.listExport(pd);
}
}

View File

@ -177,9 +177,13 @@ public class VideoManagerServiceImpl implements VideoManagerService {
// 八项作业摄像头
List<PageData> eightWorkVideoList = eightWorkVideoManagerMapper.listAll(pageData);
return getMapCameraList(eightWorkVideoList, ryCameraList);
default:
return null;
case "videoAIAnalysis":
// Ai 报警视频分析 全部的摄像头
List<PageData> dataList = videomanagerMapper.listAll(pageData);
return getMapCameraList(dataList, ryCameraList);
}
return new ArrayList<>();
}
private List<PageData> getMapCameraList(List<PageData> eightWorkVideoList, JSONObject ryCameraList) {

View File

@ -162,4 +162,48 @@
where f.USER_ID = #{USER_ID}
and f.TYPE = 3
</select>
<!-- 列表(全部) -->
<select id="listRiskStandardAllUser" parameterType="pd" resultType="pd">
select
<include refid="Field"></include>, u.* ,dept.NAME as deptName
from
<include refid="tableName"></include> f
left join sys_user u on u.USER_ID = f.USER_ID
left join oa_department dept on dept.DEPARTMENT_ID = u.DEPARTMENT_ID
where 1=1
<if test="TYPE != null and TYPE != ''"><!-- 关键词检索 -->
and TYPE = #{TYPE}
</if>
<if test="hiddenIds != null and hiddenIds != ''">
and HIDDEN_ID in
<foreach item="item" index="index" collection="hiddenIds" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<if test="HIDDEN_ID != null and HIDDEN_ID != ''">
and HIDDEN_ID = #{HIDDEN_ID}
</if>
union
select
<include refid="Field"></include>, u.* ,dept.NAME as deptName
from
BUS_HIDDENDANGERCHECKSTANDARD_HIDDEN_USER f
left join sys_user u on u.USER_ID = f.USER_ID
left join oa_department dept on dept.DEPARTMENT_ID = u.DEPARTMENT_ID
where 1=1
<if test="TYPE != null and TYPE != ''"><!-- 关键词检索 -->
and TYPE = #{TYPE}
</if>
<if test="hiddenIds != null and hiddenIds != ''">
and HIDDEN_ID in
<foreach item="item" index="index" collection="hiddenIds" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<if test="HIDDEN_ID != null and HIDDEN_ID != ''">
and HIDDEN_ID = #{HIDDEN_ID}
</if>
</select>
</mapper>

View File

@ -3081,4 +3081,660 @@
HIDDEN_ID = #{HIDDEN_ID}
</insert>
<!-- 列表 -->
<select id="riskStandardlistPage" parameterType="page" resultType="pd">
select * from (
select
f.HIDDEN_ID, '1' HIDDEN_RISKSTANDARD, f.LISTMANAGER_ID, f.RISKITEM_ID, f.CHECKRECORD_ID, f.RECORDITEM_ID,
f.SOURCE,
<!-- f.RISK_UNIT, f.IDENTIFICATION, f.RISK_DESCR, f.RISK_POSITION, f.LEVEL,
lci.RISKPOINT_ID,-->
f.CHECK_CONTENT, f.HIDDENDESCR, f.HIDDENPART,
f.CREATOR, f.CREATTIME, f.RECTIFYDESCR, f.RECTIFICATIONTYPE, f.RECTIFICATIONOR, f.RECTIFICATIONTIME,
f.HIDDENLEVEL, f.STATE, f.CHECKDEPT, f.CHECKOR, f.CHECKTIME, f.CHECKDESCR,
f.ISQUALIFIED, f.ISDELETE, f.CORPINFO_ID,
f.HIDDENFINDDEPT, f.RECTIFICATIONDEADLINE, f.RECTIFICATIONDEPT,
f.REVIEWOR, f.REVIEWTIME, f.REVIEWDEPT,
f.LONGITUDE, f.LATITUDE,
f.HAVESCHEME, f.HAVEPLAN,
f.HIDDENTYPE, f.HIDDENTYPE1, f.HIDDENTYPE2, f.HIDDENTYPE3, f.HIDDENTYPE_NAME,
f.ISCONFIRM, f.OPERATTIME, f.HIDDEN_CATEGORY,
cr.NAME CREATORNAME,
re.NAME RECTIFICATIONORNAME,
ch.NAME CHECKORNAME,
rev.NAME REVIEWORNAME,
crd.NAME HIDDENFINDDEPTNAME,
red.NAME RECTIFICATIONDEPTNAME,
chd.NAME CHECKDEPTNAME,
lv.NAME HIDDENLEVELNAME,
(select group_concat(chr.NAME) from BUS_HIDDENCHECK bh left join sys_user chr on chr.USER_ID=bh.USER_ID where bh.HIDDEN_ID=f.HIDDEN_ID ) CHECKNAME,
(select group_concat(bh.USER_ID) from BUS_HIDDENCHECK bh where bh.HIDDEN_ID=f.HIDDEN_ID ) CHECKUSERS,
(select group_concat(bh.USER_ID) from BUS_HIDDENCHECK bh where bh.HIDDEN_ID=f.HIDDEN_ID and bh.STATUS = 0 ) UNCHECKUSERS
from
<include refid="tableName"></include> f
left join sys_user cr on cr.USER_ID = f.CREATOR
left join sys_user re on re.USER_ID = f.RECTIFICATIONOR
left join sys_user ch on ch.USER_ID = f.CHECKOR
left join sys_user rev on rev.USER_ID = f.REVIEWOR
left join oa_department crd on crd.DEPARTMENT_ID = f.HIDDENFINDDEPT
left join oa_department red on red.DEPARTMENT_ID = f.RECTIFICATIONDEPT
left join oa_department chd on chd.DEPARTMENT_ID = f.CHECKDEPT
left join BUS_LIST_CHECKITEM lci on f.RISKITEM_ID = lci.LISTCHECKITEM_ID
left join <include refid="dicTableName"></include> lv on f.HIDDENLEVEL = lv.BIANMA
<if test="pd.APPSERACH != null and pd.APPSERACH != ''">
left join BUS_HIDDENCHECK bhc on bhc.HIDDEN_ID = f.HIDDEN_ID and bhc.USER_ID = #{pd.SELFUSERID}
</if>
where f.ISDELETE = '0' and f.STATE != '0'
<if test="pd.KEYWORDS != null and pd.KEYWORDS != ''"><!-- 关键词检索 -->
and
(
<!-- f.RISK_UNIT LIKE CONCAT(CONCAT('%', #{pd.KEYWORDS}),'%')
or
f.RISK_POSITION LIKE CONCAT(CONCAT('%', #{pd.KEYWORDS}),'%')
or
f.CHECK_CONTENT LIKE CONCAT(CONCAT('%', #{pd.KEYWORDS}),'%')
or-->
f.HIDDENDESCR LIKE CONCAT(CONCAT('%', #{pd.KEYWORDS}),'%')
)
</if>
<if test="pd.APPSERACH != null and pd.APPSERACH != ''">
and( f.CREATOR = #{pd.SELFUSERID} or f.RECTIFICATIONOR = #{pd.SELFUSERID} or bhc.USER_ID = #{pd.SELFUSERID})
</if>
<if test="pd.HIDDENDESCR != null and pd.HIDDENDESCR != ''"><!-- 关键词检索 -->
and f.HIDDENDESCR LIKE CONCAT(CONCAT('%', #{pd.HIDDENDESCR}),'%')
</if>
<if test="pd.ISQUALIFIED != null and pd.ISQUALIFIED != ''"><!-- 关键词检索 -->
and f.ISQUALIFIED = #{pd.ISQUALIFIED}
</if>
<if test="pd.HIDDENLEVEL != null and pd.HIDDENLEVEL != ''"><!-- 关键词检索 -->
and f.HIDDENLEVEL = #{pd.HIDDENLEVEL}
</if>
<if test="pd.STARTTIME != null and pd.STARTTIME != ''"><!-- 关键词检索 -->
and f.CREATTIME &gt;= #{pd.STARTTIME}
</if>
<if test="pd.ENDTIME != null and pd.ENDTIME != ''">
and f.CREATTIME &lt;= #{pd.ENDTIME}
</if>
<if test="pd.STATE != null and pd.STATE !='' and pd.STATE != 0 and pd.STATE != 99" >
and f.STATE = #{pd.STATE}
</if>
<if test="pd.STATE != null and pd.STATE !='' and pd.STATE == 99" > <!-- BI页面未整改点进来之后 状态搜索框不搜索数据 数据显示未整改和已过期状态-->
and f.STATE in ('1','-1')
</if>
<!-- <if test="pd.SELF_USER_ID != null and pd.SELF_USER_ID != ''">-->
<!-- and f.CREATOR = #{pd.SELF_USER_ID}-->
<!-- </if>-->
<if test="pd.CREATORNAME != null and pd.CREATORNAME != ''">
and cr.NAME LIKE CONCAT(CONCAT('%', #{pd.CREATORNAME}),'%')
</if>
<if test="pd.DISPOSESTATE != null and pd.DISPOSESTATE != ''"><!-- 关键词检索 -->
<if test="pd.DISPOSESTATE==1"><!-- 发现/整改 -->
<if test="pd.ISMAIN != null and pd.ISMAIN != ''">
<choose>
<when test="pd.ISMAIN == 1">
AND f.CORPINFO_ID = #{pd.CORPINFO_ID}
</when>
<otherwise>
and (f.RECTIFICATIONOR = #{pd.SELFUSERID}
or f.CREATOR = #{pd.SELFUSERID})
</otherwise>
</choose>
</if>
and f.STATE in('1','-1')
</if>
<if test="pd.DISPOSESTATE==2"><!-- 整改 -->
<if test="pd.ISMAIN != null and pd.ISMAIN != ''">
<choose>
<when test="pd.ISMAIN == 1">
AND f.CORPINFO_ID = #{pd.CORPINFO_ID}
</when>
<otherwise>
and f.RECTIFICATIONOR = #{pd.SELFUSERID}
</otherwise>
</choose>
</if>
and f.STATE in('1','-1')
</if>
<if test="pd.DISPOSESTATE==3"><!-- 验收 -->
and f.STATE = '3'
<if test="pd.ISMAIN != null and pd.ISMAIN != ''">
<choose>
<when test="pd.ISMAIN == 1">
AND f.CORPINFO_ID = #{pd.CORPINFO_ID}
</when>
<otherwise>
and
(
select count(1)
from BUS_HIDDENCHECK bh
where
bh.HIDDEN_ID=f.HIDDEN_ID
and bh.USER_ID=#{pd.SELFUSERID}
and bh.STATUS=0
)>0
</otherwise>
</choose>
</if>
</if>
<if test="pd.DISPOSESTATE==4"><!-- 已验收 -->
and f.STATE = '4'
<choose>
<when test="pd.ISMAIN == 1">
AND f.CORPINFO_ID = #{pd.CORPINFO_ID}
</when>
<otherwise>
<choose>
<when test="pd.isIndex != null and pd.isIndex != '' and pd.isIndex == 1">
and f.CREATOR = #{pd.SELF_USER_ID}
</when>
<otherwise>
and (
f.RECTIFICATIONOR = #{pd.SELFUSERID}
or f.CREATOR = #{pd.SELFUSERID}
or (
select count(1)
from BUS_HIDDENCHECK bh
where
bh.HIDDEN_ID=f.HIDDEN_ID
and bh.USER_ID=#{pd.SELFUSERID}
)>0
)
</otherwise>
</choose>
</otherwise>
</choose>
</if>
<if test="pd.DISPOSESTATE==5"><!-- 已超时APP使用不判断ISMAIN -->
<choose>
<when test="pd.isIndex != null and pd.isIndex != '' and pd.isIndex == 1">
and f.RECTIFICATIONOR = #{pd.SELFUSERID}
</when>
<otherwise>
and (
f.RECTIFICATIONOR = #{pd.SELFUSERID}
or f.CREATOR = #{pd.SELFUSERID}
)
</otherwise>
</choose>
and f.STATE = '-1'
</if>
<if test="pd.DISPOSESTATE==-1"><!-- 所有 -->
<if test="pd.CORPINFO_ID != null and pd.CORPINFO_ID != ''"><!-- 关键词检索 -->
and
f.CORPINFO_ID = #{pd.CORPINFO_ID}
</if>
<choose>
<when test='pd.ISMAIN != null and pd.ISMAIN != "" and pd.ISMAIN == "1"'>
<if test="pd.DEPT_IDS != null and pd.DEPT_IDS != ''">
and
f.HIDDENFINDDEPT in
<foreach item="item" index="index"
collection="pd.DEPT_IDS" open="(" separator="," close=")">
'${item}'
</foreach>
</if>
</when>
<otherwise>
<choose>
<when test='pd.ISSUPERVISE != null and pd.ISSUPERVISE != "" and pd.ISSUPERVISE == "1"'>
<choose>
<when test="pd.DEPT_IDS != null and pd.DEPT_IDS != ''">
and
f.HIDDENFINDDEPT in
<foreach item="item" index="index"
collection="pd.DEPT_IDS" open="(" separator="," close=")">
'${item}'
</foreach>
</when>
<otherwise>
and
(f.HIDDENFINDDEPT in (
select
SUB_DEPARTMENT_ID
from
oa_supervision_department osd
where
osd.SUP_DEPARTMENT_ID = #{pd.DEPARTMENT_ID}
and osd.ISDELETE = '0'
and osd.CORPINFO_ID = #{pd.CORPINFO_ID}
) or f.RECTIFICATIONDEPT in (
select
SUB_DEPARTMENT_ID
from
oa_supervision_department osd
where
osd.SUP_DEPARTMENT_ID = #{pd.DEPARTMENT_ID}
and osd.ISDELETE = '0'
and osd.CORPINFO_ID = #{pd.CORPINFO_ID}
) )
</otherwise>
</choose>
</when>
<when test='pd.ISLEADER != null and pd.ISLEADER != "" and pd.ISLEADER == "1"'>
<choose>
<when test="pd.DEPT_IDS != null and pd.DEPT_IDS != ''">
and
f.HIDDENFINDDEPT in
<foreach item="item" index="index"
collection="pd.DEPT_IDS" open="(" separator="," close=")">
'${item}'
</foreach>
</when>
<otherwise>
and
(f.HIDDENFINDDEPT in
<foreach item="item" index="index"
collection="pd.DEPARTMENT_IDS" open="(" separator="," close=")">
'${item}'
</foreach>) or (f.RECTIFICATIONDEPT in
<foreach item="item" index="index"
collection="pd.DEPARTMENT_IDS" open="(" separator="," close=")">
'${item}'
</foreach>)
</otherwise>
</choose>
</when>
<when test="pd.DEPARTMENT_ID != null and pd.DEPARTMENT_ID != ''">
and (f.HIDDENFINDDEPT=#{pd.DEPARTMENT_ID} or f.RECTIFICATIONDEPT = #{pd.DEPARTMENT_ID})
</when>
<otherwise>
</otherwise>
</choose>
</otherwise>
</choose>
<if test="pd.STATE != null and pd.STATE != '' and pd.STATE != 99"><!-- 关键词检索 -->
and
f.STATE = #{pd.STATE}
</if>
</if>
</if>
<!-- <if test="pd.DEPARTMENT_ID != null and pd.DEPARTMENT_ID != ''">关键词检索
and f.HIDDENFINDDEPT = #{pd.DEPARTMENT_ID}
</if> -->
<!-- 由BI页跳转过来参数 -->
<if test="pd.IS_DAY != null and pd.IS_DAY != ''"><!-- 由BI页跳转过来参数 -->
and
TO_DAYS(f.CREATTIME) = TO_DAYS(NOW())
</if>
<if test="pd.IS_WEEK != null and pd.IS_WEEK != ''"><!-- 由BI页跳转过来参数 -->
and
YEARWEEK(DATE_FORMAT(f.CREATTIME,'%Y-%m-%d'),1) = YEARWEEK(NOW(),1)
</if>
<if test="pd.IS_XUN != null and pd.IS_XUN != ''"><!-- 由BI页跳转过来参数 -->
<if test="pd.STARTTIME != null and pd.STARTTIME != ''"><!-- 由BI页跳转过来参数 -->
and f.CREATTIME &gt;= #{pd.STARTTIME}
</if>
<if test="pd.ENDTIME != null and pd.ENDTIME != ''">
and f.CREATTIME &lt;= #{pd.ENDTIME}
</if>
</if>
<if test="pd.IS_MONTH != null and pd.IS_MONTH != ''"><!-- 由BI页跳转过来参数 -->
and
DATE_FORMAT(f.CREATTIME,'%Y%m') = DATE_FORMAT(CURDATE(),'%Y%m')
</if>
<if test="pd.IS_QUARTER != null and pd.IS_QUARTER != ''"><!-- 由BI页跳转过来参数 -->
and f.CREATTIME BETWEEN #{pd.STARTTIME} and #{pd.ENDTIME}
</if>
<if test="pd.IS_YEAR != null and pd.IS_YEAR != ''"><!-- 由BI页跳转过来参数 -->
and
YEAR(f.CREATTIME)=YEAR(NOW())
</if>
<if test="pd.BISTATE != null and pd.BISTATE != ''"><!-- 由BI页跳转过来参数 -->
<choose>
<when test='pd.BISTATE=="1"'>
and f.STATE != '0'
</when>
<when test='pd.BISTATE=="2"'>
and f.STATE != '4'
</when>
<when test='pd.BISTATE=="3"'>
and f.STATE = '4'
</when>
</choose>
</if>
<if test="pd.ANALYSIS != null and pd.ANALYSIS != ''"><!-- 持续改进用字段 -->
and not exists (select 1 from BUS_RISKPOINT_ANALYSIS ra where ra.HIDDEN_ID = f.HIDDEN_ID)
</if>
<if test="pd.RECTIFICATIONDEPT != null and pd.RECTIFICATIONDEPT != ''">
and f.RECTIFICATIONDEPT = #{pd.RECTIFICATIONDEPT}
</if>
union
select
f.HIDDEN_ID, '2' HIDDEN_RISKSTANDARD, f.CUSTOM_ID, f.CUSTOM_ITEM_ID, f.CHECKRECORD_ID, f.RECORDITEM_ID,
f.SOURCE,
<!-- f.CHECK_CATEGORY, f.CHECK_CATEGORY_NAME, f.CHECK_ITEM, f.CHECK_ITEM_NAME, f.CHECK_STANDARD, f.REFERENCE_BASIS,
lci.RISKPOINT_ID,-->
f.CHECK_CONTENT, f.HIDDENDESCR, f.HIDDENPART,
f.CREATOR, f.CREATTIME, f.RECTIFYDESCR, f.RECTIFICATIONTYPE, f.RECTIFICATIONOR, f.RECTIFICATIONTIME,
f.HIDDENLEVEL, f.STATE, f.CHECKDEPT, f.CHECKOR, f.CHECKTIME, f.CHECKDESCR,
f.ISQUALIFIED, f.ISDELETE, f.CORPINFO_ID,
f.HIDDENFINDDEPT, f.RECTIFICATIONDEADLINE, f.RECTIFICATIONDEPT,
f.REVIEWOR, f.REVIEWTIME, f.REVIEWDEPT,
f.LONGITUDE, f.LATITUDE,
f.HAVESCHEME, f.HAVEPLAN,
f.HIDDENTYPE, f.HIDDENTYPE1, f.HIDDENTYPE2, f.HIDDENTYPE3, f.HIDDENTYPE_NAME,
f.ISCONFIRM, f.OPERATTIME, f.HIDDEN_CATEGORY,
cr.NAME CREATORNAME,
re.NAME RECTIFICATIONORNAME,
ch.NAME CHECKORNAME,
rev.NAME REVIEWORNAME,
crd.NAME HIDDENFINDDEPTNAME,
red.NAME RECTIFICATIONDEPTNAME,
chd.NAME CHECKDEPTNAME,
lv.NAME HIDDENLEVELNAME,
(select group_concat(chr.NAME) from BUS_HIDDENDANGERCHECKSTANDARD_HIDDENCHECK bh left join sys_user chr on chr.USER_ID=bh.USER_ID where bh.HIDDEN_ID=f.HIDDEN_ID ) CHECKNAME,
(select group_concat(bh.USER_ID) from BUS_HIDDENDANGERCHECKSTANDARD_HIDDENCHECK bh where bh.HIDDEN_ID=f.HIDDEN_ID ) CHECKUSERS,
(select group_concat(bh.USER_ID) from BUS_HIDDENDANGERCHECKSTANDARD_HIDDENCHECK bh where bh.HIDDEN_ID=f.HIDDEN_ID and bh.STATUS = 0 ) UNCHECKUSERS
from BUS_HIDDENDANGERCHECKSTANDARD_HIDDEN f
left join sys_user cr on cr.USER_ID = f.CREATOR
left join sys_user re on re.USER_ID = f.RECTIFICATIONOR
left join sys_user ch on ch.USER_ID = f.CHECKOR
left join sys_user rev on rev.USER_ID = f.REVIEWOR
left join oa_department crd on crd.DEPARTMENT_ID = f.HIDDENFINDDEPT
left join oa_department red on red.DEPARTMENT_ID = f.RECTIFICATIONDEPT
left join oa_department chd on chd.DEPARTMENT_ID = f.CHECKDEPT
left join BUS_HIDDENDANGERCHECKSTANDARD_CUSTOM_ITEM lci on f.CUSTOM_ITEM_ID = lci.CUSTOM_ID
left join <include refid="dicTableName"></include> lv on f.HIDDENLEVEL = lv.BIANMA
<if test="pd.APPSERACH != null and pd.APPSERACH != ''">
left join BUS_HIDDENCHECK bhc on bhc.HIDDEN_ID = f.HIDDEN_ID and bhc.USER_ID = #{pd.SELFUSERID}
</if>
where f.ISDELETE = '0' and f.STATE != '0'
<if test="pd.KEYWORDS != null and pd.KEYWORDS != ''"><!-- 关键词检索 -->
and
(
<!-- f.RISK_UNIT LIKE CONCAT(CONCAT('%', #{pd.KEYWORDS}),'%')
or
f.RISK_POSITION LIKE CONCAT(CONCAT('%', #{pd.KEYWORDS}),'%')
or
f.CHECK_CONTENT LIKE CONCAT(CONCAT('%', #{pd.KEYWORDS}),'%')
or-->
f.HIDDENDESCR LIKE CONCAT(CONCAT('%', #{pd.KEYWORDS}),'%')
)
</if>
<if test="pd.APPSERACH != null and pd.APPSERACH != ''">
and( f.CREATOR = #{pd.SELFUSERID} or f.RECTIFICATIONOR = #{pd.SELFUSERID} or bhc.USER_ID = #{pd.SELFUSERID})
</if>
<if test="pd.HIDDENDESCR != null and pd.HIDDENDESCR != ''"><!-- 关键词检索 -->
and f.HIDDENDESCR LIKE CONCAT(CONCAT('%', #{pd.HIDDENDESCR}),'%')
</if>
<if test="pd.ISQUALIFIED != null and pd.ISQUALIFIED != ''"><!-- 关键词检索 -->
and f.ISQUALIFIED = #{pd.ISQUALIFIED}
</if>
<if test="pd.HIDDENLEVEL != null and pd.HIDDENLEVEL != ''"><!-- 关键词检索 -->
and f.HIDDENLEVEL = #{pd.HIDDENLEVEL}
</if>
<if test="pd.STARTTIME != null and pd.STARTTIME != ''"><!-- 关键词检索 -->
and f.CREATTIME &gt;= #{pd.STARTTIME}
</if>
<if test="pd.ENDTIME != null and pd.ENDTIME != ''">
and f.CREATTIME &lt;= #{pd.ENDTIME}
</if>
<if test="pd.STATE != null and pd.STATE !='' and pd.STATE != 0 and pd.STATE != 99" >
and f.STATE = #{pd.STATE}
</if>
<if test="pd.STATE != null and pd.STATE !='' and pd.STATE == 99" > <!-- BI页面未整改点进来之后 状态搜索框不搜索数据 数据显示未整改和已过期状态-->
and f.STATE in ('1','-1')
</if>
<!-- <if test="pd.SELF_USER_ID != null and pd.SELF_USER_ID != ''">-->
<!-- and f.CREATOR = #{pd.SELF_USER_ID}-->
<!-- </if>-->
<if test="pd.CREATORNAME != null and pd.CREATORNAME != ''">
and cr.NAME LIKE CONCAT(CONCAT('%', #{pd.CREATORNAME}),'%')
</if>
<if test="pd.DISPOSESTATE != null and pd.DISPOSESTATE != ''"><!-- 关键词检索 -->
<if test="pd.DISPOSESTATE==1"><!-- 发现/整改 -->
<if test="pd.ISMAIN != null and pd.ISMAIN != ''">
<choose>
<when test="pd.ISMAIN == 1">
AND f.CORPINFO_ID = #{pd.CORPINFO_ID}
</when>
<otherwise>
and (f.RECTIFICATIONOR = #{pd.SELFUSERID}
or f.CREATOR = #{pd.SELFUSERID})
</otherwise>
</choose>
</if>
and f.STATE in('1','-1')
</if>
<if test="pd.DISPOSESTATE==2"><!-- 整改 -->
<if test="pd.ISMAIN != null and pd.ISMAIN != ''">
<choose>
<when test="pd.ISMAIN == 1">
AND f.CORPINFO_ID = #{pd.CORPINFO_ID}
</when>
<otherwise>
and f.RECTIFICATIONOR = #{pd.SELFUSERID}
</otherwise>
</choose>
</if>
and f.STATE in('1','-1')
</if>
<if test="pd.DISPOSESTATE==3"><!-- 验收 -->
and f.STATE = '3'
<if test="pd.ISMAIN != null and pd.ISMAIN != ''">
<choose>
<when test="pd.ISMAIN == 1">
AND f.CORPINFO_ID = #{pd.CORPINFO_ID}
</when>
<otherwise>
and
(
select count(1)
from BUS_HIDDENCHECK bh
where
bh.HIDDEN_ID=f.HIDDEN_ID
and bh.USER_ID=#{pd.SELFUSERID}
and bh.STATUS=0
)>0
</otherwise>
</choose>
</if>
</if>
<if test="pd.DISPOSESTATE==4"><!-- 已验收 -->
and f.STATE = '4'
<choose>
<when test="pd.ISMAIN == 1">
AND f.CORPINFO_ID = #{pd.CORPINFO_ID}
</when>
<otherwise>
<choose>
<when test="pd.isIndex != null and pd.isIndex != '' and pd.isIndex == 1">
and f.CREATOR = #{pd.SELF_USER_ID}
</when>
<otherwise>
and (
f.RECTIFICATIONOR = #{pd.SELFUSERID}
or f.CREATOR = #{pd.SELFUSERID}
or (
select count(1)
from BUS_HIDDENCHECK bh
where
bh.HIDDEN_ID=f.HIDDEN_ID
and bh.USER_ID=#{pd.SELFUSERID}
)>0
)
</otherwise>
</choose>
</otherwise>
</choose>
</if>
<if test="pd.DISPOSESTATE==5"><!-- 已超时APP使用不判断ISMAIN -->
<choose>
<when test="pd.isIndex != null and pd.isIndex != '' and pd.isIndex == 1">
and f.RECTIFICATIONOR = #{pd.SELFUSERID}
</when>
<otherwise>
and (
f.RECTIFICATIONOR = #{pd.SELFUSERID}
or f.CREATOR = #{pd.SELFUSERID}
)
</otherwise>
</choose>
and f.STATE = '-1'
</if>
<if test="pd.DISPOSESTATE==-1"><!-- 所有 -->
<if test="pd.CORPINFO_ID != null and pd.CORPINFO_ID != ''"><!-- 关键词检索 -->
and
f.CORPINFO_ID = #{pd.CORPINFO_ID}
</if>
<choose>
<when test='pd.ISMAIN != null and pd.ISMAIN != "" and pd.ISMAIN == "1"'>
<if test="pd.DEPT_IDS != null and pd.DEPT_IDS != ''">
and
f.HIDDENFINDDEPT in
<foreach item="item" index="index"
collection="pd.DEPT_IDS" open="(" separator="," close=")">
'${item}'
</foreach>
</if>
</when>
<otherwise>
<choose>
<when test='pd.ISSUPERVISE != null and pd.ISSUPERVISE != "" and pd.ISSUPERVISE == "1"'>
<choose>
<when test="pd.DEPT_IDS != null and pd.DEPT_IDS != ''">
and
f.HIDDENFINDDEPT in
<foreach item="item" index="index"
collection="pd.DEPT_IDS" open="(" separator="," close=")">
'${item}'
</foreach>
</when>
<otherwise>
and
(f.HIDDENFINDDEPT in (
select
SUB_DEPARTMENT_ID
from
oa_supervision_department osd
where
osd.SUP_DEPARTMENT_ID = #{pd.DEPARTMENT_ID}
and osd.ISDELETE = '0'
and osd.CORPINFO_ID = #{pd.CORPINFO_ID}
) or f.RECTIFICATIONDEPT in (
select
SUB_DEPARTMENT_ID
from
oa_supervision_department osd
where
osd.SUP_DEPARTMENT_ID = #{pd.DEPARTMENT_ID}
and osd.ISDELETE = '0'
and osd.CORPINFO_ID = #{pd.CORPINFO_ID}
) )
</otherwise>
</choose>
</when>
<when test='pd.ISLEADER != null and pd.ISLEADER != "" and pd.ISLEADER == "1"'>
<choose>
<when test="pd.DEPT_IDS != null and pd.DEPT_IDS != ''">
and
f.HIDDENFINDDEPT in
<foreach item="item" index="index"
collection="pd.DEPT_IDS" open="(" separator="," close=")">
'${item}'
</foreach>
</when>
<otherwise>
and
(f.HIDDENFINDDEPT in
<foreach item="item" index="index"
collection="pd.DEPARTMENT_IDS" open="(" separator="," close=")">
'${item}'
</foreach>) or (f.RECTIFICATIONDEPT in
<foreach item="item" index="index"
collection="pd.DEPARTMENT_IDS" open="(" separator="," close=")">
'${item}'
</foreach>)
</otherwise>
</choose>
</when>
<when test="pd.DEPARTMENT_ID != null and pd.DEPARTMENT_ID != ''">
and (f.HIDDENFINDDEPT=#{pd.DEPARTMENT_ID} or f.RECTIFICATIONDEPT = #{pd.DEPARTMENT_ID})
</when>
<otherwise>
</otherwise>
</choose>
</otherwise>
</choose>
<if test="pd.STATE != null and pd.STATE != '' and pd.STATE != 99"><!-- 关键词检索 -->
and
f.STATE = #{pd.STATE}
</if>
</if>
</if>
<!-- <if test="pd.DEPARTMENT_ID != null and pd.DEPARTMENT_ID != ''">关键词检索
and f.HIDDENFINDDEPT = #{pd.DEPARTMENT_ID}
</if> -->
<!-- 由BI页跳转过来参数 -->
<if test="pd.IS_DAY != null and pd.IS_DAY != ''"><!-- 由BI页跳转过来参数 -->
and
TO_DAYS(f.CREATTIME) = TO_DAYS(NOW())
</if>
<if test="pd.IS_WEEK != null and pd.IS_WEEK != ''"><!-- 由BI页跳转过来参数 -->
and
YEARWEEK(DATE_FORMAT(f.CREATTIME,'%Y-%m-%d'),1) = YEARWEEK(NOW(),1)
</if>
<if test="pd.IS_XUN != null and pd.IS_XUN != ''"><!-- 由BI页跳转过来参数 -->
<if test="pd.STARTTIME != null and pd.STARTTIME != ''"><!-- 由BI页跳转过来参数 -->
and f.CREATTIME &gt;= #{pd.STARTTIME}
</if>
<if test="pd.ENDTIME != null and pd.ENDTIME != ''">
and f.CREATTIME &lt;= #{pd.ENDTIME}
</if>
</if>
<if test="pd.IS_MONTH != null and pd.IS_MONTH != ''"><!-- 由BI页跳转过来参数 -->
and
DATE_FORMAT(f.CREATTIME,'%Y%m') = DATE_FORMAT(CURDATE(),'%Y%m')
</if>
<if test="pd.IS_QUARTER != null and pd.IS_QUARTER != ''"><!-- 由BI页跳转过来参数 -->
and f.CREATTIME BETWEEN #{pd.STARTTIME} and #{pd.ENDTIME}
</if>
<if test="pd.IS_YEAR != null and pd.IS_YEAR != ''"><!-- 由BI页跳转过来参数 -->
and
YEAR(f.CREATTIME)=YEAR(NOW())
</if>
<if test="pd.BISTATE != null and pd.BISTATE != ''"><!-- 由BI页跳转过来参数 -->
<choose>
<when test='pd.BISTATE=="1"'>
and f.STATE != '0'
</when>
<when test='pd.BISTATE=="2"'>
and f.STATE != '4'
</when>
<when test='pd.BISTATE=="3"'>
and f.STATE = '4'
</when>
</choose>
</if>
<!-- <if test="pd.ANALYSIS != null and pd.ANALYSIS != ''">&lt;!&ndash; 持续改进用字段 &ndash;&gt;-->
<!-- and not exists (select 1 from BUS_RISKPOINT_ANALYSIS ra where ra.HIDDEN_ID = f.HIDDEN_ID)-->
<!-- </if>-->
<if test="pd.RECTIFICATIONDEPT != null and pd.RECTIFICATIONDEPT != ''">
and f.RECTIFICATIONDEPT = #{pd.RECTIFICATIONDEPT}
</if>
) z where 1 = 1
<if test="pd.HIDDEN_RISKSTANDARD != null and pd.HIDDEN_RISKSTANDARD != ''">
and z.HIDDEN_RISKSTANDARD = #{pd.HIDDEN_RISKSTANDARD}
</if>
order by z.CREATTIME desc
</select>
</mapper>

View File

@ -0,0 +1,296 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.zcloud.mapper.datasource.hiddenDangerCheckStandard.CustomHiddenSchemeMapper">
<!--表名 -->
<sql id="tableName">
BUS_HIDDENDANGERCHECKSTANDARD_HIDDENSCHEME
</sql>
<!--数据字典表名 -->
<sql id="dicTableName">
SYS_DICTIONARIES
</sql>
<!-- 字段 -->
<sql id="Field">
f.HIDDEN_ID,
f.SCREENINGDATE,
f.CUSTOM_NAME,
f.GOVERNSTANDARDS,
f.GOVERNMETHOD,
f.EXPENDITURE,
f.PRINCIPAL,
f.PROGRAMMING,
f.TIMELIMITFOR,
f.FILEPATH,
f.JOBREQUIREMENT,
f.OTHERBUSINESS,
f.CORPINFO_ID,
f.CREATOR,
f.CREATTIME,
f.OPERATOR,
f.OPERATTIME,
f.ISDELETE,
f.HIDDENSCHEME_ID
</sql>
<!-- 字段用于新增 -->
<sql id="Field2">
HIDDEN_ID,
SCREENINGDATE,
CUSTOM_NAME,
GOVERNSTANDARDS,
GOVERNMETHOD,
EXPENDITURE,
PRINCIPAL,
PROGRAMMING,
TIMELIMITFOR,
FILEPATH,
JOBREQUIREMENT,
OTHERBUSINESS,
CORPINFO_ID,
CREATOR,
CREATTIME,
OPERATOR,
OPERATTIME,
ISDELETE,
HIDDENSCHEME_ID
</sql>
<!-- 字段值 -->
<sql id="FieldValue">
#{HIDDEN_ID},
#{SCREENINGDATE},
#{CUSTOM_NAME},
#{GOVERNSTANDARDS},
#{GOVERNMETHOD},
#{EXPENDITURE},
#{PRINCIPAL},
#{PROGRAMMING},
#{TIMELIMITFOR},
#{FILEPATH},
#{JOBREQUIREMENT},
#{OTHERBUSINESS},
#{CORPINFO_ID},
#{CREATOR},
#{CREATTIME},
#{OPERATOR},
#{OPERATTIME},
#{ISDELETE},
#{HIDDENSCHEME_ID}
</sql>
<!-- 新增-->
<insert id="save" parameterType="pd">
insert into
<include refid="tableName"></include>
(
<include refid="Field2"></include>
) values (
<include refid="FieldValue"></include>
)
</insert>
<!-- 删除-->
<delete id="delete" parameterType="pd">
update
<include refid="tableName"></include>
set
ISDELETE = '1'
where
HIDDENSCHEME_ID = #{HIDDENSCHEME_ID}
</delete>
<!-- 删除-->
<delete id="deleteHd" parameterType="pd">
update
<include refid="tableName"></include>
set
ISDELETE = '1'
where
HIDDEN_ID = #{HIDDEN_ID}
and ISDELETE = '0'
</delete>
<!-- 修改 -->
<update id="edit" parameterType="pd">
update
<include refid="tableName"></include>
set
FILEPATH = #{FILEPATH},
ISDELETE = #{ISDELETE},
HIDDENSCHEME_ID = HIDDENSCHEME_ID
where
HIDDENSCHEME_ID = #{HIDDENSCHEME_ID}
</update>
<!-- 通过ID获取数据 -->
<select id="findById" parameterType="pd" resultType="pd">
select
<include refid="Field"></include>
from
<include refid="tableName"></include> f
where
f.HIDDENSCHEME_ID = #{HIDDENSCHEME_ID}
</select>
<!-- 通过ID获取数据 -->
<select id="findByHdId" parameterType="pd" resultType="pd">
select
<include refid="Field"></include>
from
<include refid="tableName"></include> f
where
f.HIDDEN_ID = #{HIDDEN_ID}
and f.ISDELETE = '0'
</select>
<!-- 列表 -->
<select id="datalistPage" parameterType="page" resultType="pd">
select
<include refid="Field"></include>
from
<include refid="tableName"></include> f
where f.ISDELETE = '0'
<if test="pd.KEYWORDS != null and pd.KEYWORDS != ''"><!-- 关键词检索 -->
and
(
<!-- 根据需求自己加检索条件
字段1 LIKE CONCAT(CONCAT('%', #{pd.KEYWORDS}),'%')
or
字段2 LIKE CONCAT(CONCAT('%', #{pd.KEYWORDS}),'%')
-->
)
</if>
</select>
<!-- 列表(全部) -->
<select id="listAll" parameterType="pd" resultType="pd">
select
<include refid="Field"></include>
from
<include refid="tableName"></include> f
where 1=1
<if test="CORPINFO_ID !=null and CORPINFO_ID !=''">
and CORPINFO_ID = #{CORPINFO_ID}
</if>
</select>
<!-- 批量删除 -->
<delete id="deleteAll" parameterType="String">
update
<include refid="tableName"></include>
set
ISDELETE = '1'
where
HIDDENSCHEME_ID in
<foreach item="item" index="index" collection="ArrayDATA_IDS" open="(" separator="," close=")">
#{item}
</foreach>
</delete>
<!-- 列表(全部) -->
<select id="listExport" parameterType="pd" resultType="pd">
select
<include refid="Field"></include>
from
<include refid="tableName"></include> f
where 1=1
<if test="HIDDEN_ID != null and HIDDEN_ID != ''"><!-- 关键词检索 -->
and
f.HIDDEN_ID=#{HIDDEN_ID}
</if>
and EXISTS (
select
1
from bus_hidden h
where
h.hidden_id = f.hidden_id and
h.ISDELETE = '0' and h.STATE != '0'
<if test="SOURCE != null and SOURCE != ''">
and h.SOURCE=#{SOURCE}
</if>
<if test="IS_CANCEL != null and IS_CANCEL != ''"><!-- 是否作废 -->
and h.CHECKRECORD_ID is null
</if>
<if test="CORPINFO_ID != null and CORPINFO_ID != ''">
and h.CORPINFO_ID = #{CORPINFO_ID}
</if>
<if test="FIND_CHECKRECORD_ID != null and FIND_CHECKRECORD_ID != ''">
and h.CHECKRECORD_ID=#{CHECKRECORD_ID}
</if>
<if test="KEYWORDS != null and KEYWORDS != ''"><!-- 关键词检索 -->
and
(
h.RISK_UNIT LIKE CONCAT(CONCAT('%', #{KEYWORDS}),'%')
or
h.RISK_POSITION LIKE CONCAT(CONCAT('%', #{KEYWORDS}),'%')
or
h.CHECK_CONTENT LIKE CONCAT(CONCAT('%', #{KEYWORDS}),'%')
or
h.HIDDENDESCR LIKE CONCAT(CONCAT('%', #{KEYWORDS}),'%')
)
</if>
<if test="HIDDENDESCR != null and HIDDENDESCR != ''"><!-- 关键词检索 -->
and h.HIDDENDESCR LIKE CONCAT(CONCAT('%', #{HIDDENDESCR}),'%')
</if>
<if test="ISQUALIFIED != null and ISQUALIFIED != ''"><!-- 关键词检索 -->
and h.ISQUALIFIED = #{ISQUALIFIED}
</if>
<if test="DEPARTMENT_ID != null and DEPARTMENT_ID != ''"><!-- 关键词检索 -->
and h.HIDDENFINDDEPT = #{DEPARTMENT_ID}
</if>
<if test="HIDDENLEVEL != null and HIDDENLEVEL != ''"><!-- 关键词检索 -->
and h.HIDDENLEVEL = #{HIDDENLEVEL}
</if>
<if test="STARTTIME != null and STARTTIME != ''"><!-- 关键词检索 -->
and h.CREATTIME &gt;= #{STARTTIME}
</if>
<if test="ENDTIME != null and ENDTIME != ''">
and h.CREATTIME &lt;= #{ENDTIME}
</if>
<if test="STATE != null and STATE !='' and STATE != 0" >
and h.STATE = #{STATE}
</if>
<if test="SELF_USER_ID != null and SELF_USER_ID != ''">
and h.CREATOR = #{SELF_USER_ID}
</if>
<if test="DISPOSESTATE != null and DISPOSESTATE != ''"><!-- 关键词检索 -->
<if test="DISPOSESTATE==2"><!-- 整改 -->
and h.RECTIFICATIONOR = #{SELFUSERID}
and h.STATE in('1','-1')
</if>
<if test="DISPOSESTATE==3"><!-- 验收 -->
and h.STATE = '3'
and (select count(1) from BUS_HIDDENCHECK bh where bh.USER_ID=#{SELFUSERID} and bh.HIDDEN_ID=h.HIDDEN_ID and bh.STATUS=0)>0
</if>
<if test="DISPOSESTATE==4"><!-- 已验收 -->
and h.STATE = '4'
and (h.RECTIFICATIONOR = #{SELFUSERID} or h.CREATOR = #{SELFUSERID} or (select count(1) from BUS_HIDDENCHECK bh where bh.USER_ID=#{SELFUSERID} and bh.HIDDEN_ID=h.HIDDEN_ID)>0)
</if>
<if test="DISPOSESTATE==-1"><!-- 所有 -->
<if test="CORPINFO_ID != null and CORPINFO_ID != ''"><!-- 关键词检索 -->
and
h.CORPINFO_ID = #{CORPINFO_ID}
</if>
<if test="STATE != null and STATE != ''"><!-- 关键词检索 -->
and
h.STATE = #{STATE}
</if>
</if>
</if>
<if test="HIDDEN_IDS != null and HIDDEN_IDS != ''"><!-- 关键词检索 -->
and
(
h.HIDDEN_ID in
<foreach item="item" index="index" collection="HIDDEN_IDS" open="(" separator="," close=")">
#{item}
</foreach>
)
</if>
)
</select>
</mapper>