forked from integrated_whb/integrated_whb
清单检查情况完善隐患排查清单
parent
05927c3048
commit
c886521b5b
|
@ -9,6 +9,7 @@ import com.zcloud.logs.LogAnno;
|
|||
import com.zcloud.service.check.*;
|
||||
import com.zcloud.service.corp.CorpInfoService;
|
||||
import com.zcloud.service.hidden.HiddenService;
|
||||
import com.zcloud.service.hiddenDangerCheckStandard.CustomCheckRecordService;
|
||||
import com.zcloud.service.offduty.OffDutyService;
|
||||
import com.zcloud.service.sms.SMSLogService;
|
||||
import com.zcloud.service.sms.SMSManagementService;
|
||||
|
@ -69,6 +70,7 @@ public class CheckRecordController extends BaseController {
|
|||
private ListDisableTimeService listDisableTimeService;
|
||||
@Autowired
|
||||
private SendMessageUtil sendMessageUtil;
|
||||
|
||||
/**
|
||||
* 新增
|
||||
*
|
||||
|
@ -79,7 +81,7 @@ public class CheckRecordController extends BaseController {
|
|||
// @RequiresPermissions("checkrecord:add")
|
||||
@ResponseBody
|
||||
@Transactional
|
||||
@LogAnno(menuType= "双重预防",menuServer= "隐患排查",instructionsOperate = "清单排查",instructionsType = "新增记录")
|
||||
@LogAnno(menuType = "双重预防", menuServer = "隐患排查", instructionsOperate = "清单排查", instructionsType = "新增记录")
|
||||
public Object add() throws Exception {
|
||||
Map<String, Object> map = new HashMap<String, Object>();
|
||||
String errInfo = "success";
|
||||
|
@ -101,7 +103,7 @@ public class CheckRecordController extends BaseController {
|
|||
PageData list = listmanagerService.findById(pd);
|
||||
String periodstart = "";
|
||||
String periodend = "";
|
||||
if(!list.get("TYPE").toString().equals("listType0005")) {
|
||||
if (!list.get("TYPE").toString().equals("listType0005")) {
|
||||
switch (list.get("PERIOD").toString()) {
|
||||
case "checkPeriod0001":
|
||||
periodstart = sysdate.getString("DAY_START");
|
||||
|
@ -243,7 +245,7 @@ public class CheckRecordController extends BaseController {
|
|||
// @RequiresPermissions("checkrecord:del")
|
||||
@ResponseBody
|
||||
@Transactional
|
||||
@LogAnno(menuType= "双重预防",menuServer= "隐患排查",instructionsOperate = "清单检查情况",instructionsType = "删除检查记录")
|
||||
@LogAnno(menuType = "双重预防", menuServer = "隐患排查", instructionsOperate = "清单检查情况", instructionsType = "删除检查记录")
|
||||
public Object delete() throws Exception {
|
||||
Map<String, String> map = new HashMap<String, String>();
|
||||
String errInfo = "success";
|
||||
|
@ -264,7 +266,7 @@ public class CheckRecordController extends BaseController {
|
|||
@RequestMapping(value = "/edit")
|
||||
// @RequiresPermissions("checkrecord:edit")
|
||||
@ResponseBody
|
||||
@LogAnno(menuType= "双重预防",menuServer= "隐患排查",instructionsOperate = "清单检查情况",instructionsType = "修改")
|
||||
@LogAnno(menuType = "双重预防", menuServer = "隐患排查", instructionsOperate = "清单检查情况", instructionsType = "修改")
|
||||
public Object edit() throws Exception {
|
||||
Map<String, Object> map = new HashMap<String, Object>();
|
||||
String errInfo = "success";
|
||||
|
@ -277,6 +279,7 @@ public class CheckRecordController extends BaseController {
|
|||
|
||||
/**
|
||||
* 获取隐患数据
|
||||
*
|
||||
* @param
|
||||
* @throws Exception
|
||||
*/
|
||||
|
@ -287,7 +290,7 @@ public class CheckRecordController extends BaseController {
|
|||
String errInfo = "success";
|
||||
PageData pd = new PageData();
|
||||
pd = this.getPageData();
|
||||
map.put("pd",listcheckitemService.findHidden(pd));
|
||||
map.put("pd", listcheckitemService.findHidden(pd));
|
||||
map.put("result", errInfo);
|
||||
return map;
|
||||
}
|
||||
|
@ -301,7 +304,7 @@ public class CheckRecordController extends BaseController {
|
|||
@RequestMapping(value = "/list")
|
||||
// @RequiresPermissions("checkrecord:list")
|
||||
@ResponseBody
|
||||
@LogAnno(menuType= "双重预防",menuServer= "隐患排查",instructionsOperate = "清单检查情况",instructionsType = "检查记录列表")
|
||||
@LogAnno(menuType = "双重预防", menuServer = "隐患排查", instructionsOperate = "清单检查情况", instructionsType = "检查记录列表")
|
||||
public Object list(Page page) throws Exception {
|
||||
Map<String, Object> map = new HashMap<String, Object>();
|
||||
String errInfo = "success";
|
||||
|
@ -443,11 +446,10 @@ public class CheckRecordController extends BaseController {
|
|||
varList = checkrecordService.list(page); // 列出CheckRecord列表
|
||||
}*/
|
||||
page.setPd(pd);
|
||||
List<PageData> varList = checkrecordService.list(page);
|
||||
PageData ls = listmanagerService.findById(pd);
|
||||
map.put("varList", varList);
|
||||
// 风险管控清单
|
||||
map.put("ls", listmanagerService.findById(pd));
|
||||
map.put("varList", checkrecordService.list(page));
|
||||
map.put("page", page);
|
||||
map.put("ls", ls);
|
||||
map.put("result", errInfo);
|
||||
return map;
|
||||
}
|
||||
|
@ -479,7 +481,7 @@ public class CheckRecordController extends BaseController {
|
|||
*/
|
||||
@RequestMapping(value = "/goEdit")
|
||||
@ResponseBody
|
||||
@LogAnno(menuType= "双重预防",menuServer= "隐患排查",instructionsOperate = "清单检查情况",instructionsType = "去修改页面获取数据")
|
||||
@LogAnno(menuType = "双重预防", menuServer = "隐患排查", instructionsOperate = "清单检查情况", instructionsType = "去修改页面获取数据")
|
||||
public Object goEdit() throws Exception {
|
||||
Map<String, Object> map = new HashMap<String, Object>();
|
||||
String errInfo = "success";
|
||||
|
@ -487,17 +489,17 @@ public class CheckRecordController extends BaseController {
|
|||
pd = this.getPageData();
|
||||
pd = checkrecordService.findById(pd); // 根据ID读取
|
||||
PageData condition = new PageData();
|
||||
condition.put("LISTMANAGER_ID",pd.getString("LISTMANAGER_ID"));
|
||||
condition.put("LISTMANAGER_ID", pd.getString("LISTMANAGER_ID"));
|
||||
PageData listManager = listmanagerService.findById(condition);
|
||||
pd.put("BAO_BAO_TYPE",listManager.getString("BAO_BAO_TYPE"));
|
||||
pd.put("BAO_BAO_TYPE", listManager.getString("BAO_BAO_TYPE"));
|
||||
PageData users = checkuserService.getCheckUser(pd);
|
||||
List<PageData> varList = recordItemService.listAll(pd);
|
||||
if(users != null) {
|
||||
if (users != null) {
|
||||
pd.put("USERS", users.get("USERS"));
|
||||
}
|
||||
PageData pd2 = new PageData();
|
||||
pd2.put("FOREIGN_KEY",pd.get("CHECKRECORD_ID"));
|
||||
pd2.put("TYPE","13");
|
||||
pd2.put("FOREIGN_KEY", pd.get("CHECKRECORD_ID"));
|
||||
pd2.put("TYPE", "13");
|
||||
List<PageData> qianming = imgFilesService.listAll(pd2);
|
||||
|
||||
|
||||
|
@ -510,7 +512,7 @@ public class CheckRecordController extends BaseController {
|
|||
|
||||
@RequestMapping(value = "/goMap")
|
||||
@ResponseBody
|
||||
@LogAnno(menuType= "双重预防",menuServer= "隐患排查",instructionsOperate = "清单检查情况",instructionsType = "获取地图信息")
|
||||
@LogAnno(menuType = "双重预防", menuServer = "隐患排查", instructionsOperate = "清单检查情况", instructionsType = "获取地图信息")
|
||||
public Object goMap() throws Exception {
|
||||
Map<String, Object> map = new HashMap<String, Object>();
|
||||
String errInfo = "success";
|
||||
|
@ -889,7 +891,7 @@ public class CheckRecordController extends BaseController {
|
|||
*/
|
||||
@RequestMapping(value = "/goIndexCount")
|
||||
@ResponseBody
|
||||
@LogAnno(menuType= "首页",menuServer= "首页",instructionsOperate = "首页",instructionsType = "去修改页面获取数据")
|
||||
@LogAnno(menuType = "首页", menuServer = "首页", instructionsOperate = "首页", instructionsType = "去修改页面获取数据")
|
||||
public Object goIndexCount() throws Exception {
|
||||
Map<String, Object> map = new HashMap<String, Object>();
|
||||
String errInfo = "success";
|
||||
|
@ -1219,7 +1221,7 @@ public class CheckRecordController extends BaseController {
|
|||
@RequestMapping(value = "/allList")
|
||||
// @RequiresPermissions("checkrecord:list")
|
||||
@ResponseBody
|
||||
@LogAnno(menuType= "双重预防",menuServer= "隐患排查",instructionsOperate = "检查记录管理",instructionsType = "检查记录列表")
|
||||
@LogAnno(menuType = "双重预防", menuServer = "隐患排查", instructionsOperate = "检查记录管理", instructionsType = "检查记录列表")
|
||||
public Object allList(Page page) throws Exception {
|
||||
Map<String, Object> map = new HashMap<String, Object>();
|
||||
String errInfo = "success";
|
||||
|
@ -1232,31 +1234,31 @@ public class CheckRecordController extends BaseController {
|
|||
npd.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID());
|
||||
npd.put("ISSUPERVISE", Jurisdiction.getISSUPERVISE());
|
||||
npd.put("SELF_DEPARTMENT_ID", Jurisdiction.getDEPARTMENT_ID());
|
||||
npd.put("ISMAIN",Jurisdiction.getIS_MAIN());
|
||||
pd.put("USER_ID",Jurisdiction.getUSER_ID());
|
||||
npd.put("ISMAIN", Jurisdiction.getIS_MAIN());
|
||||
pd.put("USER_ID", Jurisdiction.getUSER_ID());
|
||||
PageData cpd = new PageData();
|
||||
cpd = usersService.findById(pd);
|
||||
npd.put("ISLEADER", cpd.getString("ISLEADER"));
|
||||
if(cpd.getString("ISLEADER") != null && cpd.getString("ISLEADER").equals("1")){
|
||||
if (cpd.getString("ISLEADER") != null && cpd.getString("ISLEADER").equals("1")) {
|
||||
String DEPARTMENT_ID = npd.getString("SELF_DEPARTMENT_ID");
|
||||
String ids = departmentService.getDEPARTMENT_IDS(DEPARTMENT_ID);
|
||||
ids=npd.getString("SELF_DEPARTMENT_ID")+","+ids; //把自己部门插入进去
|
||||
if(ids!=null && Tools.notEmpty(ids)&& ids.lastIndexOf(",")>-1) {
|
||||
ids = ids.substring(0,ids.lastIndexOf(","));
|
||||
ids = npd.getString("SELF_DEPARTMENT_ID") + "," + ids; //把自己部门插入进去
|
||||
if (ids != null && Tools.notEmpty(ids) && ids.lastIndexOf(",") > -1) {
|
||||
ids = ids.substring(0, ids.lastIndexOf(","));
|
||||
npd.put("DEPARTMENT_IDS", ids.split(","));
|
||||
}else {
|
||||
} else {
|
||||
npd.put("DEPARTMENT_IDS", DEPARTMENT_ID);
|
||||
}
|
||||
}else {
|
||||
if(npd.getString("ISMAIN").equals("0")){
|
||||
npd.put("USER_ID",Jurisdiction.getUSER_ID());
|
||||
} else {
|
||||
if (npd.getString("ISMAIN").equals("0")) {
|
||||
npd.put("USER_ID", Jurisdiction.getUSER_ID());
|
||||
}
|
||||
}
|
||||
npd.put("LISTMANAGER_ID",pd.getString("LISTMANAGER_ID"));
|
||||
npd.put("DEPARTMENT_ID",pd.getString("DEPARTMENT_ID"));
|
||||
npd.put("TYPE",pd.getString("TYPE"));
|
||||
npd.put("STARTTIME",pd.getString("STARTTIME"));
|
||||
npd.put("ENDTIME",pd.getString("ENDTIME"));
|
||||
npd.put("LISTMANAGER_ID", pd.getString("LISTMANAGER_ID"));
|
||||
npd.put("DEPARTMENT_ID", pd.getString("DEPARTMENT_ID"));
|
||||
npd.put("TYPE", pd.getString("TYPE"));
|
||||
npd.put("STARTTIME", pd.getString("STARTTIME"));
|
||||
npd.put("ENDTIME", pd.getString("ENDTIME"));
|
||||
page.setPd(npd);
|
||||
List<PageData> varList = checkrecordService.list(page);
|
||||
map.put("varList", varList);
|
||||
|
@ -1268,6 +1270,7 @@ public class CheckRecordController extends BaseController {
|
|||
/**
|
||||
* 补录
|
||||
* TODO
|
||||
*
|
||||
* @param
|
||||
* @throws Exception
|
||||
*/
|
||||
|
@ -1275,7 +1278,7 @@ public class CheckRecordController extends BaseController {
|
|||
// @RequiresPermissions("checkrecord:add")
|
||||
@ResponseBody
|
||||
@Transactional
|
||||
@LogAnno(menuType= "双重预防",menuServer= "隐患排查",instructionsOperate = "清单检查情况",instructionsType = "补录")
|
||||
@LogAnno(menuType = "双重预防", menuServer = "隐患排查", instructionsOperate = "清单检查情况", instructionsType = "补录")
|
||||
public Object recording() throws Exception {
|
||||
Map<String, Object> map = new HashMap<String, Object>();
|
||||
String errInfo = "success";
|
||||
|
@ -1434,7 +1437,7 @@ public class CheckRecordController extends BaseController {
|
|||
*/
|
||||
@RequestMapping(value = "/monthStatistics")
|
||||
@ResponseBody
|
||||
@LogAnno(menuType= "双重预防",menuServer= "隐患排查",instructionsOperate = "员工清单检查情况",instructionsType = "员工清单检查情况(月)")
|
||||
@LogAnno(menuType = "双重预防", menuServer = "隐患排查", instructionsOperate = "员工清单检查情况", instructionsType = "员工清单检查情况(月)")
|
||||
public Object monthStatistics(Page page) throws Exception {
|
||||
Map<String, Object> map = new HashMap<String, Object>();
|
||||
String errInfo = "success";
|
||||
|
@ -1442,50 +1445,50 @@ public class CheckRecordController extends BaseController {
|
|||
PageData npd = new PageData();
|
||||
pd = this.getPageData();
|
||||
String month = pd.getString("MONTH");
|
||||
npd.put("CORPINFO_ID",Jurisdiction.getCORPINFO_ID());
|
||||
npd.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID());
|
||||
String DEPTIDS = pd.getString("DEPTIDS");
|
||||
if(Tools.notEmpty(DEPTIDS)) {
|
||||
if (Tools.notEmpty(DEPTIDS)) {
|
||||
String DEPT_IDS[] = DEPTIDS.split(",");
|
||||
npd.put("DEPT_IDS", DEPT_IDS);
|
||||
}
|
||||
npd.put("ISMAIN", Jurisdiction.getIS_MAIN());
|
||||
npd.put("ISSUPERVISE", Jurisdiction.getISSUPERVISE());
|
||||
npd.put("DEPARTMENT_ID", Jurisdiction.getDEPARTMENT_ID());
|
||||
pd.put("USER_ID",Jurisdiction.getUSER_ID());
|
||||
pd.put("USER_ID", Jurisdiction.getUSER_ID());
|
||||
PageData cpd = new PageData();
|
||||
cpd = usersService.findById(pd);
|
||||
npd.put("ISLEADER", cpd.getString("ISLEADER"));
|
||||
if(cpd.getString("ISLEADER") != null && cpd.getString("ISLEADER").equals("1")){
|
||||
if (cpd.getString("ISLEADER") != null && cpd.getString("ISLEADER").equals("1")) {
|
||||
String DEPARTMENT_ID = npd.getString("DEPARTMENT_ID");
|
||||
String ids = departmentService.getDEPARTMENT_IDS(DEPARTMENT_ID);
|
||||
ids=npd.getString("DEPARTMENT_ID")+","+ids; //把自己部门插入进去
|
||||
if(ids!=null && Tools.notEmpty(ids)&& ids.lastIndexOf(",")>-1) {
|
||||
ids = ids.substring(0,ids.lastIndexOf(","));
|
||||
ids = npd.getString("DEPARTMENT_ID") + "," + ids; //把自己部门插入进去
|
||||
if (ids != null && Tools.notEmpty(ids) && ids.lastIndexOf(",") > -1) {
|
||||
ids = ids.substring(0, ids.lastIndexOf(","));
|
||||
npd.put("DEPARTMENT_IDS", ids.split(","));
|
||||
}else {
|
||||
} else {
|
||||
npd.put("DEPARTMENT_IDS", DEPARTMENT_ID);
|
||||
}
|
||||
}else {
|
||||
if(npd.getString("ISMAIN").equals("0")){
|
||||
npd.put("USER_ID",Jurisdiction.getUSER_ID());
|
||||
} else {
|
||||
if (npd.getString("ISMAIN").equals("0")) {
|
||||
npd.put("USER_ID", Jurisdiction.getUSER_ID());
|
||||
}
|
||||
}
|
||||
String KEYWORDS = pd.getString("KEYWORDS"); // 关键词检索条件
|
||||
if (Tools.notEmpty(KEYWORDS))
|
||||
npd.put("KEYWORDS", KEYWORDS.trim());
|
||||
npd.put("USERNAME",pd.getString("USERNAME"));
|
||||
npd.put("USERNAME", pd.getString("USERNAME"));
|
||||
page.setPd(npd);
|
||||
List<PageData> lists = listmanagerService.getListByCorplistPage(page);
|
||||
|
||||
if(lists!=null && lists.size()>0){
|
||||
Map<String,Map> resmap = new HashMap<>();
|
||||
if (lists != null && lists.size() > 0) {
|
||||
Map<String, Map> resmap = new HashMap<>();
|
||||
List<String> listIds = new ArrayList<>();
|
||||
lists.forEach(list -> {
|
||||
resmap.put(list.getString("LISTMANAGER_ID"),new HashMap<String,Map>());
|
||||
resmap.put(list.getString("LISTMANAGER_ID"), new HashMap<String, Map>());
|
||||
listIds.add(list.getString("LISTMANAGER_ID"));
|
||||
if(DateSysUtil.isSameMonth(list.getString("CREATTIME"),month)){//如果清单创建时间是查询月
|
||||
List<String> datesInRange = DateSysUtil.getDatesInRange(month+"-01 00:00:00",list.getString("CREATTIME"));
|
||||
for (int i = 0; i < datesInRange.size()-1; i++) {
|
||||
if (DateSysUtil.isSameMonth(list.getString("CREATTIME"), month)) {//如果清单创建时间是查询月
|
||||
List<String> datesInRange = DateSysUtil.getDatesInRange(month + "-01 00:00:00", list.getString("CREATTIME"));
|
||||
for (int i = 0; i < datesInRange.size() - 1; i++) {
|
||||
Map<String, String> data = new HashMap<String, String>();
|
||||
data.put("TYPE", "3");
|
||||
data.put("HIDDEN_COUNT", "-");
|
||||
|
@ -1494,11 +1497,11 @@ public class CheckRecordController extends BaseController {
|
|||
}
|
||||
});
|
||||
|
||||
if(listIds.size() > 0){
|
||||
pd.put("LIST_IDS",listIds);
|
||||
if (listIds.size() > 0) {
|
||||
pd.put("LIST_IDS", listIds);
|
||||
List<PageData> recordList = checkrecordService.listForIdsAndMonth(pd);//获取查询月在检查周期内的检查记录
|
||||
recordList.forEach(record -> {
|
||||
List<String> datesInRange = DateSysUtil.getDatesInRange(record.getString("PERIODSTART"),record.getString("PERIODEND"));
|
||||
List<String> datesInRange = DateSysUtil.getDatesInRange(record.getString("PERIODSTART"), record.getString("PERIODEND"));
|
||||
for (int i = 0; i < datesInRange.size(); i++) {
|
||||
Map<String, String> data = new HashMap<String, String>();
|
||||
data.put("TYPE", record.getString("TYPE"));
|
||||
|
@ -1514,10 +1517,10 @@ public class CheckRecordController extends BaseController {
|
|||
});
|
||||
}
|
||||
|
||||
map.put("list",lists);
|
||||
map.put("resmap",resmap);
|
||||
map.put("list", lists);
|
||||
map.put("resmap", resmap);
|
||||
}
|
||||
map.put("page",page);
|
||||
map.put("page", page);
|
||||
map.put("result", "success");
|
||||
return map;
|
||||
}
|
||||
|
|
|
@ -491,7 +491,7 @@ public class CustomCheckRecordController extends BaseController {
|
|||
pd = this.getPageData();
|
||||
pd = customCheckRecordService.findById(pd); // 根据ID读取
|
||||
PageData condition = new PageData();
|
||||
condition.put("LISTMANAGER_ID",pd.getString("LISTMANAGER_ID"));
|
||||
condition.put("CUSTOM_ID",pd.getString("CUSTOM_ID"));
|
||||
PageData listManager = customService.findById(condition);
|
||||
pd.put("BAO_BAO_TYPE",listManager.getString("BAO_BAO_TYPE"));
|
||||
PageData users = checkuserService.getCheckUser(pd);
|
||||
|
|
|
@ -212,7 +212,8 @@
|
|||
<select id="datalistPage" parameterType="page" resultType="pd">
|
||||
|
||||
select
|
||||
f.LISTMANAGER_ID,
|
||||
'1' LIST_TYPE,
|
||||
f.LISTMANAGER_ID LIST_ID,
|
||||
f.LIST_NAME,
|
||||
f.CORPINFO_ID,
|
||||
f.CREATOR,
|
||||
|
@ -251,6 +252,12 @@
|
|||
f.LISTMANAGER_ID = #{pd.LISTMANAGER_ID}
|
||||
)
|
||||
</if>
|
||||
<if test="pd.CUSTOM_ID != null and pd.CUSTOM_ID != ''">
|
||||
and
|
||||
(
|
||||
f.LISTMANAGER_ID = #{pd.CUSTOM_ID}
|
||||
)
|
||||
</if>
|
||||
<if test="pd.DEPARTMENT_ID != null and pd.DEPARTMENT_ID != ''">
|
||||
and
|
||||
(
|
||||
|
@ -366,8 +373,182 @@
|
|||
</choose>
|
||||
</otherwise>
|
||||
</choose>
|
||||
order by IFNULL( f.CHECK_TIME, f.PERIODEND ) desc
|
||||
|
||||
UNION
|
||||
SELECT
|
||||
'2' LIST_TYPE,
|
||||
f.CUSTOM_ID LIST_ID,
|
||||
l.NAME LIST_NAME,
|
||||
f.CORPINFO_ID,
|
||||
f.CREATOR,
|
||||
f.CREATTIME,
|
||||
f.OPERATOR,
|
||||
f.OPERATTIME,
|
||||
f.ISDELETE,
|
||||
f.LONGITUDE,
|
||||
f.LATITUDE,
|
||||
f.CHECKRECORD_ID,
|
||||
f.CHECK_TIME,
|
||||
f.DESCR,
|
||||
f.FINISHED,
|
||||
f.TYPE,
|
||||
f.PERIODSTART DATESTART,
|
||||
f.PERIODEND DATEEND,
|
||||
u.NAME AS USER_NAME,
|
||||
su.NAME AS PRINCIPALNAME,
|
||||
(
|
||||
SELECT
|
||||
group_concat(
|
||||
IFNULL( bh.USER_NAME, chr.NAME ))
|
||||
FROM
|
||||
BUS_CHECKUSER bh
|
||||
LEFT JOIN sys_user chr ON chr.USER_ID = bh.USER_ID
|
||||
WHERE
|
||||
bh.CHECKRECORD_ID = f.CHECKRECORD_ID
|
||||
) CHECK_USERS
|
||||
FROM
|
||||
bus_hiddendangercheckstandard_checkrecord f
|
||||
LEFT JOIN SYS_USER u ON u.USERNAME = f.CREATOR
|
||||
LEFT JOIN bus_hiddendangercheckstandard_custom l ON l.CUSTOM_ID = f.CUSTOM_ID
|
||||
LEFT JOIN SYS_USER su ON su.USER_ID = l.USER_ID
|
||||
WHERE
|
||||
f.ISDELETE = '0'
|
||||
and f.CORPINFO_ID = #{pd.CORPINFO_ID} and f.FINISHED='1'
|
||||
|
||||
<if test="pd.KEYWORDS != null and pd.KEYWORDS != ''">
|
||||
and
|
||||
(
|
||||
f.LIST_NAME LIKE CONCAT(CONCAT('%', #{pd.KEYWORDS}),'%')
|
||||
)
|
||||
</if>
|
||||
<if test="pd.CUSTOM_ID != null and pd.CUSTOM_ID != ''">
|
||||
and
|
||||
(
|
||||
f.CUSTOM_ID = #{pd.CUSTOM_ID}
|
||||
)
|
||||
</if>
|
||||
<if test="pd.LISTMANAGER_ID != null and pd.LISTMANAGER_ID != ''">
|
||||
and
|
||||
(
|
||||
f.CUSTOM_ID = #{pd.LISTMANAGER_ID}
|
||||
)
|
||||
</if>
|
||||
<if test="pd.DEPARTMENT_ID != null and pd.DEPARTMENT_ID != ''">
|
||||
and
|
||||
(
|
||||
l.DEPARTMENT_ID = #{pd.DEPARTMENT_ID}
|
||||
)
|
||||
</if>
|
||||
<!-- <if test="pd.STARTTIME != null and pd.STARTTIME != ''">
|
||||
and DATE_FORMAT(f.CHECK_TIME,'%Y-%m-%d %H:%i:%s') >= CONCAT(#{pd.STARTTIME},':00')
|
||||
</if>
|
||||
<if test="pd.ENDTIME != null and pd.ENDTIME != ''">
|
||||
and DATE_FORMAT(f.CHECK_TIME,'%Y-%m-%d %H:%i:%s') <= CONCAT(#{pd.ENDTIME},':59')
|
||||
</if> -->
|
||||
<choose>
|
||||
<when test="pd.STARTTIME != null and pd.STARTTIME != '' and pd.ENDTIME != null and pd.ENDTIME != ''">
|
||||
and DATE_FORMAT(CONCAT(#{pd.STARTTIME},' 00:00:00'),'%Y-%m-%d %H:%i:%s') <= DATE_FORMAT(f.CREATTIME,'%Y-%m-%d %H:%i:%s')
|
||||
and DATE_FORMAT(CONCAT(#{pd.ENDTIME},' 23:59:59'),'%Y-%m-%d %H:%i:%s') >= DATE_FORMAT(f.CREATTIME,'%Y-%m-%d %H:%i:%s')
|
||||
</when>
|
||||
<otherwise>
|
||||
<if test="pd.STARTINSPECTTIME != null and pd.STARTINSPECTTIME != ''">
|
||||
and DATE_FORMAT(CONCAT(#{pd.STARTINSPECTTIME},' 00:00:00'),'%Y-%m-%d %H:%i:%s') <= DATE_FORMAT(f.PERIODEND,'%Y-%m-%d %H:%i:%s')
|
||||
</if>
|
||||
<if test="pd.ENDINSPECTTIME != null and pd.ENDINSPECTTIME != ''">
|
||||
and DATE_FORMAT(CONCAT(#{pd.ENDINSPECTTIME},' 23:59:59'),'%Y-%m-%d %H:%i:%s') >= DATE_FORMAT(f.PERIODSTART,'%Y-%m-%d %H:%i:%s')
|
||||
</if>
|
||||
</otherwise>
|
||||
</choose>
|
||||
<if test="pd.TYPE != null and pd.TYPE != ''">
|
||||
and f.TYPE= #{pd.TYPE}
|
||||
<!-- <choose>
|
||||
<when test='pd.TYPE=="1"'>
|
||||
order by IFNULL( f.CHECK_TIME, f.PERIODEND ) desc
|
||||
</when>
|
||||
<when test='pd.TYPE=="2"'>
|
||||
order by IFNULL( f.CHECK_TIME, f.PERIODEND ) desc
|
||||
</when>
|
||||
</choose> -->
|
||||
</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
|
||||
u.DEPARTMENT_ID 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.ISLEADER != null and pd.ISLEADER != "" and pd.ISLEADER == "1"'>
|
||||
and
|
||||
EXISTS (
|
||||
SELECT
|
||||
1
|
||||
FROM
|
||||
BUS_CHECKUSER bh
|
||||
LEFT JOIN SYS_USER chr ON chr.USER_ID = bh.USER_ID
|
||||
WHERE
|
||||
bh.CHECKRECORD_ID = f.CHECKRECORD_ID
|
||||
AND ((chr.DEPARTMENT_ID IN ( SELECT SUB_DEPARTMENT_ID FROM oa_supervision_department
|
||||
osd WHERE osd.SUP_DEPARTMENT_ID = #{pd.SELF_DEPARTMENT_ID} AND osd.ISDELETE = '0' AND
|
||||
osd.CORPINFO_ID = #{pd.CORPINFO_ID} ) )
|
||||
or (chr.DEPARTMENT_ID IN
|
||||
<foreach item="item" index="index"
|
||||
collection="pd.DEPARTMENT_IDS" open="(" separator="," close=")">
|
||||
'${item}'
|
||||
</foreach>) )
|
||||
)
|
||||
</when>
|
||||
<otherwise>
|
||||
and
|
||||
EXISTS (
|
||||
SELECT
|
||||
1
|
||||
FROM
|
||||
BUS_CHECKUSER bh
|
||||
LEFT JOIN SYS_USER chr ON chr.USER_ID = bh.USER_ID
|
||||
WHERE
|
||||
(bh.CHECKRECORD_ID = f.CHECKRECORD_ID
|
||||
or chr.USER_ID = #{pd.USER_ID})
|
||||
AND chr.DEPARTMENT_ID IN ( SELECT SUB_DEPARTMENT_ID FROM oa_supervision_department osd WHERE osd.SUP_DEPARTMENT_ID = #{pd.SELF_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"'>
|
||||
and
|
||||
EXISTS (
|
||||
SELECT
|
||||
1
|
||||
FROM
|
||||
BUS_CHECKUSER bh
|
||||
LEFT JOIN SYS_USER chr ON chr.USER_ID = bh.USER_ID
|
||||
WHERE
|
||||
bh.CHECKRECORD_ID = f.CHECKRECORD_ID
|
||||
AND chr.DEPARTMENT_ID IN
|
||||
<foreach item="item" index="index"
|
||||
collection="pd.DEPARTMENT_IDS" open="(" separator="," close=")">
|
||||
'${item}'
|
||||
</foreach> )
|
||||
|
||||
</when>
|
||||
<when test="pd.SELF_DEPARTMENT_ID != null and pd.SELF_DEPARTMENT_ID != ''">
|
||||
and l.DEPARTMENT_ID=#{pd.SELF_DEPARTMENT_ID}
|
||||
and l.USER_ID = #{pd.USER_ID}
|
||||
</when>
|
||||
<otherwise>
|
||||
</otherwise>
|
||||
</choose>
|
||||
</otherwise>
|
||||
</choose>
|
||||
ORDER BY IFNULL( CHECK_TIME,DATEEND) desc
|
||||
</select>
|
||||
|
||||
|
||||
|
|
|
@ -157,8 +157,7 @@
|
|||
select
|
||||
<include refid="Field"></include>,
|
||||
(select h.HIDDEN_ID from BUS_HIDDENDANGERCHECKSTANDARD_HIDDEN h where h.RECORDITEM_ID=f.RECORDITEM_ID and h.CHECKRECORD_ID=f.CHECKRECORD_ID and h.ISDELETE= '0') as HIDDEN_ID,
|
||||
( select count(1) from bus_imgfiles i where i.FOREIGN_KEY = f.RECORDITEM_ID and i.TYPE = '14' ) AS IMGCOUNT,
|
||||
r.IDENTIFICATION_ID
|
||||
( select count(1) from bus_imgfiles i where i.FOREIGN_KEY = f.RECORDITEM_ID and i.TYPE = '14' ) AS IMGCOUNT
|
||||
from
|
||||
<include refid="tableName"></include> f
|
||||
where f.CHECKRECORD_ID=#{CHECKRECORD_ID}
|
||||
|
|
|
@ -210,7 +210,6 @@
|
|||
order by IFNULL( f.CHECK_TIME, f.PERIODEND ) desc
|
||||
</select>
|
||||
<select id="datalistPage" parameterType="page" resultType="pd">
|
||||
|
||||
select
|
||||
f.CUSTOM_ID,
|
||||
f.CORPINFO_ID,
|
||||
|
@ -247,7 +246,7 @@
|
|||
<if test="pd.CUSTOM_ID != null and pd.CUSTOM_ID != ''">
|
||||
and
|
||||
(
|
||||
f.CUSTOM_ID = #{CUSTOM_ID}
|
||||
f.CUSTOM_ID = #{pd.CUSTOM_ID}
|
||||
)
|
||||
</if>
|
||||
<if test="pd.DEPARTMENT_ID != null and pd.DEPARTMENT_ID != ''">
|
||||
|
|
Loading…
Reference in New Issue