封装数据发送(九公司消息发送)

pet
shanao 2024-10-23 14:16:31 +08:00
parent 1a26abd93a
commit c2c3897979
9 changed files with 896 additions and 804 deletions

View File

@ -3,7 +3,6 @@ package com.zcloud.controller.app.inspection;
import com.zcloud.controller.base.BaseController; import com.zcloud.controller.base.BaseController;
import com.zcloud.entity.Page; import com.zcloud.entity.Page;
import com.zcloud.entity.PageData; import com.zcloud.entity.PageData;
import com.zcloud.entity.hotWorkApplication.Node;
import com.zcloud.entity.hotWorkApplication.NodeApp; import com.zcloud.entity.hotWorkApplication.NodeApp;
import com.zcloud.entity.hotWorkApplication.Overseer; import com.zcloud.entity.hotWorkApplication.Overseer;
import com.zcloud.service.bus.HiddenService; import com.zcloud.service.bus.HiddenService;
@ -14,7 +13,6 @@ import com.zcloud.service.inspection.SafetyEnvironmentalInspectorService;
import com.zcloud.service.inspection.SafetyEnvironmentalService; import com.zcloud.service.inspection.SafetyEnvironmentalService;
import com.zcloud.service.system.DepartmentService; import com.zcloud.service.system.DepartmentService;
import com.zcloud.util.*; import com.zcloud.util.*;
import org.apache.commons.io.FileUtils;
import org.apache.commons.lang.StringUtils; import org.apache.commons.lang.StringUtils;
import org.apache.shiro.authz.annotation.RequiresPermissions; import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
@ -26,9 +24,7 @@ import org.springframework.web.multipart.MultipartFile;
import org.springframework.web.servlet.ModelAndView; import org.springframework.web.servlet.ModelAndView;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.io.File;
import java.util.*; import java.util.*;
import java.util.stream.Collectors;
/** /**
* *
@ -58,7 +54,9 @@ public class AppSafetyEnvironmentalController extends BaseController {
private NoticeCorpUtil noticeCorpUtil; private NoticeCorpUtil noticeCorpUtil;
/** /**
*
*
* @param page * @param page
* @throws Exception * @throws Exception
*/ */
@ -79,7 +77,9 @@ public class AppSafetyEnvironmentalController extends BaseController {
return map; return map;
} }
/** /**
*
*
* @param * @param
* @throws Exception * @throws Exception
*/ */
@ -121,7 +121,9 @@ public class AppSafetyEnvironmentalController extends BaseController {
return map; return map;
} }
/** /**
*
*
* @param * @param
* @throws Exception * @throws Exception
*/ */
@ -139,7 +141,9 @@ public class AppSafetyEnvironmentalController extends BaseController {
return map; return map;
} }
/** /**
*
*
* @param * @param
* @throws Exception * @throws Exception
*/ */
@ -157,7 +161,9 @@ public class AppSafetyEnvironmentalController extends BaseController {
return map; return map;
} }
/** /**
*
*
* @param * @param
* @throws Exception * @throws Exception
*/ */
@ -194,7 +200,9 @@ public class AppSafetyEnvironmentalController extends BaseController {
return map; return map;
} }
/** /**
*
*
* @param * @param
* @throws Exception * @throws Exception
*/ */
@ -230,7 +238,9 @@ public class AppSafetyEnvironmentalController extends BaseController {
return map; return map;
} }
/** /**
*
*
* @param * @param
* @throws Exception * @throws Exception
*/ */
@ -248,7 +258,9 @@ public class AppSafetyEnvironmentalController extends BaseController {
return map; return map;
} }
/** /**
*
*
* @param * @param
* @throws Exception * @throws Exception
*/ */
@ -275,7 +287,9 @@ public class AppSafetyEnvironmentalController extends BaseController {
return map; return map;
} }
/**excel /**
* excel
*
* @param * @param
* @throws Exception * @throws Exception
*/ */
@ -335,7 +349,9 @@ public class AppSafetyEnvironmentalController extends BaseController {
return mv; return mv;
} }
/** /**
*
*
* @param * @param
* @throws Exception * @throws Exception
*/ */
@ -371,7 +387,9 @@ public class AppSafetyEnvironmentalController extends BaseController {
return map; return map;
} }
/**app /**
* app
*
* @param * @param
* @throws Exception * @throws Exception
*/ */
@ -388,7 +406,9 @@ public class AppSafetyEnvironmentalController extends BaseController {
return map; return map;
} }
/** /**
*
*
* @param page * @param page
* @throws Exception * @throws Exception
*/ */
@ -410,8 +430,10 @@ public class AppSafetyEnvironmentalController extends BaseController {
} }
/** /**
*
* : * :
*
* @param page * @param page
* @throws Exception * @throws Exception
*/ */
@ -424,6 +446,7 @@ public class AppSafetyEnvironmentalController extends BaseController {
String KEYWORDS = pd.getString("KEYWORDS"); //关键词检索条件 String KEYWORDS = pd.getString("KEYWORDS"); //关键词检索条件
if (Tools.notEmpty(KEYWORDS)) pd.put("KEYWORDS", KEYWORDS.trim()); if (Tools.notEmpty(KEYWORDS)) pd.put("KEYWORDS", KEYWORDS.trim());
pd.put("waffle", pd.getString("ARCHIVE_USER_ID")); pd.put("waffle", pd.getString("ARCHIVE_USER_ID"));
pd.put("loginUserId", Jurisdiction.getUSER_ID());
page.setPd(pd); page.setPd(pd);
List<PageData> varList = safetyenvironmentalService.checkList(page); //列出SafetyEnvironmental列表 List<PageData> varList = safetyenvironmentalService.checkList(page); //列出SafetyEnvironmental列表
/* 针对验收部分特殊处理 */ /* 针对验收部分特殊处理 */

View File

@ -737,31 +737,35 @@ public class SafetyEnvironmentalController extends BaseController {
pd.put("loginUserId", Jurisdiction.getUSER_ID()); pd.put("loginUserId", Jurisdiction.getUSER_ID());
List<PageData> varList = safetyenvironmentalService.checkList(page); //列出SafetyEnvironmental列表 List<PageData> varList = safetyenvironmentalService.checkList(page); //列出SafetyEnvironmental列表
/* 针对验收部分特殊处理 */ /* 针对验收部分特殊处理 */
for (PageData vector : varList) { // for (PageData vector : varList) {
if (StringUtils.isNotBlank(vector.getString("INSPECTION_STATUS")) && // if (StringUtils.isNotBlank(vector.getString("INSPECTION_STATUS")) &&
("6".equals(vector.getString("INSPECTION_STATUS")) // ("6".equals(vector.getString("INSPECTION_STATUS"))
|| "5".equals(vector.getString("INSPECTION_STATUS")) // || "5".equals(vector.getString("INSPECTION_STATUS"))
// || "7".equals(vector.getString("INSPECTION_STATUS")) //// || "7".equals(vector.getString("INSPECTION_STATUS"))
) // )
) { // ) {
PageData condition = new PageData(); // PageData condition = new PageData();
condition.put("FOREIGN_ID", vector.getString("INSPECTION_ID")); // condition.put("FOREIGN_ID", vector.getString("INSPECTION_ID"));
List<PageData> waffle = hiddenService.findByKey(condition); // List<PageData> waffle = hiddenService.findByKey(condition);
if (waffle == null || waffle.isEmpty()) { // if (waffle == null || waffle.isEmpty()) {
continue; // continue;
} // }
Long number = waffle.stream() // Long number = waffle.stream()
.filter(n -> // .filter(n -> Jurisdiction.getUSER_ID().equals(n.getString("CREATOR")) &&
Jurisdiction.getUSER_ID().equals(n.getString("CREATOR")) && // (StringUtils.isNotBlank(n.getString("STATE")) &&
(StringUtils.isNotBlank(n.getString("STATE")) && ("4".equals(n.getString("STATE")) || "8".equals(n.getString("STATE")))) && // ("4".equals(n.getString("STATE")) ||
(StringUtils.isBlank(n.getString("FINAL_CHECK")) || "2".equals(n.getString("FINAL_CHECK"))) // "8".equals(n.getString("STATE")))) &&
) // (StringUtils.isBlank(n.getString("FINAL_CHECK")) ||
.count(); // "2".equals(n.getString("FINAL_CHECK")))
if (number > 0) { // )
vector.put("checkout", 1); // .count();
} // if (number > 0) {
} // vector.put("checkout", 1);
} // } else {
// vector.put("checkout", 0);
// }
// }
// }
map.put("varList", varList); map.put("varList", varList);
map.put("page", page); map.put("page", page);
map.put("result", errInfo); map.put("result", errInfo);

View File

@ -37,7 +37,9 @@ public class SafetyEnvironmentalInspectorController extends BaseController {
private DepartmentService departmentService; private DepartmentService departmentService;
/** /**
*
*
* @param page * @param page
* @throws Exception * @throws Exception
*/ */
@ -59,7 +61,7 @@ public class SafetyEnvironmentalInspectorController extends BaseController {
pd.put("roleLevel", loginUser.getRoleLevel()); pd.put("roleLevel", loginUser.getRoleLevel());
pd.put("loginUserId", loginUser.getUSER_ID()); pd.put("loginUserId", loginUser.getUSER_ID());
} }
pd.put("loginUserId", Jurisdiction.getUSER_ID());
page.setPd(pd); page.setPd(pd);
List<PageData> varList = safetyenvironmentalinspectorService.list(page); //列出SafetyEnvironmentalInspector列表 List<PageData> varList = safetyenvironmentalinspectorService.list(page); //列出SafetyEnvironmentalInspector列表
for (PageData vector : varList) { for (PageData vector : varList) {
@ -80,7 +82,9 @@ public class SafetyEnvironmentalInspectorController extends BaseController {
return map; return map;
} }
/** /**
*
*
* @param * @param
* @throws Exception * @throws Exception
*/ */
@ -122,16 +126,9 @@ public class SafetyEnvironmentalInspectorController extends BaseController {
} }
/**
*
*
/**
* @param * @param
* @throws Exception * @throws Exception
*/ */
@ -156,7 +153,9 @@ public class SafetyEnvironmentalInspectorController extends BaseController {
return map; return map;
} }
/** /**
*
*
* @param * @param
* @throws Exception * @throws Exception
*/ */
@ -175,7 +174,9 @@ public class SafetyEnvironmentalInspectorController extends BaseController {
return map; return map;
} }
/** /**
*
*
* @param * @param
* @throws Exception * @throws Exception
*/ */
@ -195,7 +196,9 @@ public class SafetyEnvironmentalInspectorController extends BaseController {
return map; return map;
} }
/** /**
*
*
* @param * @param
* @throws Exception * @throws Exception
*/ */
@ -213,7 +216,9 @@ public class SafetyEnvironmentalInspectorController extends BaseController {
return map; return map;
} }
/** /**
*
*
* @param * @param
* @throws Exception * @throws Exception
*/ */
@ -240,7 +245,9 @@ public class SafetyEnvironmentalInspectorController extends BaseController {
return map; return map;
} }
/**excel /**
* excel
*
* @param * @param
* @throws Exception * @throws Exception
*/ */

View File

@ -4,6 +4,7 @@ import com.zcloud.entity.messages.PushRecords;
import com.zcloud.service.messages.PushMessages; import com.zcloud.service.messages.PushMessages;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;
/** /**
* *
@ -16,6 +17,7 @@ public class AllMessagesImpl implements PushMessages {
private final SmsMessagesImpl smsMessages; private final SmsMessagesImpl smsMessages;
@Override @Override
@Transactional(rollbackFor = Exception.class)
public void push(PushRecords pushRecords, String userId) throws Exception { public void push(PushRecords pushRecords, String userId) throws Exception {
insideMessages.push(pushRecords, userId); insideMessages.push(pushRecords, userId);
smsMessages.push(pushRecords, userId); smsMessages.push(pushRecords, userId);

View File

@ -6,6 +6,7 @@ import com.zcloud.service.bus.NoticeCorpService;
import com.zcloud.service.messages.PushMessages; import com.zcloud.service.messages.PushMessages;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;
/** /**
* *
@ -17,6 +18,7 @@ public class InsideMessagesImpl implements PushMessages {
private final NoticeCorpService noticeCorpService; private final NoticeCorpService noticeCorpService;
@Override @Override
@Transactional(rollbackFor = Exception.class)
public void push(PushRecords pushRecords, String userId) throws Exception { public void push(PushRecords pushRecords, String userId) throws Exception {
PageData mes = new PageData(); PageData mes = new PageData();
mes.put("BIANMA", "PUSH_RECORDS"); mes.put("BIANMA", "PUSH_RECORDS");

View File

@ -10,7 +10,6 @@ import com.zcloud.util.UuidUtil;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.Map; import java.util.Map;
@ -22,9 +21,7 @@ public class MessagesServiceImpl implements MessagesService {
private final MessagesMapper mapper; private final MessagesMapper mapper;
private final Map<String, PushMessages> messages; private final Map<String, PushMessages> messages;
@Override @Override
@Transactional(rollbackFor = Exception.class)
public void push(PushRecords pushRecords) throws Exception { public void push(PushRecords pushRecords) throws Exception {
// 先记录数据 // 先记录数据
pushRecords.setId(UuidUtil.get32UUID()); pushRecords.setId(UuidUtil.get32UUID());

View File

@ -117,9 +117,33 @@ public class AliSmsToolUtil {
//发短信 //发短信
Map<String,Object> map = new HashMap<String,Object>(); Map<String,Object> map = new HashMap<String,Object>();
map.put("infoDetail", "阿斯顿发"); map.put("infoDetail", "阿斯顿发");
map.put("phone", "18630363710"); map.put("phone", "18630387571");
map.put("infoType", "阿三地方"); map.put("infoType", "阿三地方");
map.put("templateCode", "SMS_227260789");
List<PageData> paramsList = new ArrayList<PageData>(); List<PageData> paramsList = new ArrayList<PageData>();
PageData params1 = new PageData();
// 第1个参数
params1.put("name", "number");// 存入短信模板中的参数名称
params1.put("value", 2);// 存入上面参数名称所传递的值
paramsList.add(params1);
PageData params2 = new PageData();
// 第2个参数
params2.put("name", "params1");// 存入短信模板中的参数名称
params2.put("value", "盲板作业");// 存入上面参数名称所传递的值
paramsList.add(params2);
PageData params3 = new PageData();
// 第3个参数
params3.put("name", "params2");// 存入短信模板中的参数名称
params3.put("value", "生产部门意见");// 存入上面参数名称所传递的值
paramsList.add(params3);
PageData params4 = new PageData();
// 第4个参数
params4.put("name", "params3");// 存入短信模板中的参数名称
params4.put("value", "审核");// 存入上面参数名称所传递的值
paramsList.add(params4);
SendSmsResponse response = sendSms(map,paramsList); SendSmsResponse response = sendSms(map,paramsList);
System.out.println("短信接口返回的数据----------------"); System.out.println("短信接口返回的数据----------------");
System.out.println("Code=" + response.getCode()); System.out.println("Code=" + response.getCode());

View File

@ -194,7 +194,11 @@
) )
</if> </if>
GROUP BY f.INSPECTION_ID GROUP BY f.INSPECTION_ID
ORDER BY FIELD (se.INSPECTION_STATUS , '0','1','2','3','4','5','6','7','8','-1','-2') asc, se.INSPECTION_TIME_START DESC , se.INSPECTION_TIME_END DESC ORDER BY
FIELD(if(f.INSPECTION_USER_SIGN_TIME is not null,'2','1'), '1','2'),
FIELD(if(se.INSPECTED_SITEUSER_ID = #{pd.loginUserId},#{pd.loginUserId},'1'), #{pd.loginUserId}, '1'),
FIELD (se.INSPECTION_STATUS , '0','1','2','3','4','5','6','7','8','-1','-2') ,
se.INSPECTION_TIME_START DESC , se.INSPECTION_TIME_END DESC
</select> </select>
<!-- 列表(全部) --> <!-- 列表(全部) -->

View File

@ -649,61 +649,85 @@
<!-- 列表 --> <!-- 列表 -->
<select id="checklistPage" parameterType="page" resultType="pd"> <select id="checklistPage" parameterType="page" resultType="pd">
select select iou.NAME INSPECTION_ORIGINATOR_NAME,
iou.NAME INSPECTION_ORIGINATOR_NAME,
ild.NAME INSPECTION_LEADDEPARTMENT_NAME, ild.NAME INSPECTION_LEADDEPARTMENT_NAME,
iod.NAME INSPECTION_DEPARTMENT_NAME, iod.NAME INSPECTION_DEPARTMENT_NAME,
isd.NAME INSPECTED_DEPARTMENT_NAME, isd.NAME INSPECTED_DEPARTMENT_NAME,
isu.NAME INSPECTED_SITEUSER_NAME, isu.NAME INSPECTED_SITEUSER_NAME,
if(h.`count` > 0, 1, null) as checkout,
IFNULL(GROUP_CONCAT(REPLACE(siu.USER_ID, '/', ',')), '') AS INSPECTION_USER_ID, IFNULL(GROUP_CONCAT(REPLACE(siu.USER_ID, '/', ',')), '') AS INSPECTION_USER_ID,
IFNULL(GROUP_CONCAT(REPLACE(siu.NAME, '/', ',')), '') AS INSPECTION_USER_NAME, IFNULL(GROUP_CONCAT(REPLACE(siu.NAME, '/', ',')), '') AS INSPECTION_USER_NAME,
CASE WHEN IFNULL(f.INSPECTION_TYPE_OTHER, '') = '' THEN d.NAME ELSE f.INSPECTION_TYPE_OTHER END INSPECTION_TYPE_NAME, CASE
<include refid="Field"></include> WHEN IFNULL(f.INSPECTION_TYPE_OTHER, '') = '' THEN d.NAME
ELSE f.INSPECTION_TYPE_OTHER END INSPECTION_TYPE_NAME,
<include refid="Field">
</include>
from from
<include refid="tableName"></include> f <include refid="tableName">
</include>
f
LEFT JOIN vi_user_all iou ON iou.USER_ID = f.INSPECTION_ORIGINATOR_ID LEFT JOIN vi_user_all iou ON iou.USER_ID = f.INSPECTION_ORIGINATOR_ID
LEFT JOIN OA_DEPARTMENT ild ON ild.DEPARTMENT_ID = f.INSPECTION_LEADDEPARTMENT_ID LEFT JOIN OA_DEPARTMENT ild ON ild.DEPARTMENT_ID = f.INSPECTION_LEADDEPARTMENT_ID
LEFT JOIN vi_department_all iod ON iod.DEPARTMENT_ID = iou.DEPARTMENT_ID LEFT JOIN vi_department_all iod ON iod.DEPARTMENT_ID = iou.DEPARTMENT_ID
LEFT JOIN OA_DEPARTMENT isd ON isd.DEPARTMENT_ID = f.INSPECTED_DEPARTMENT_ID LEFT JOIN OA_DEPARTMENT isd ON isd.DEPARTMENT_ID = f.INSPECTED_DEPARTMENT_ID
LEFT JOIN SYS_USER isu ON isu.USER_ID = f.INSPECTED_SITEUSER_ID LEFT JOIN SYS_USER isu ON isu.USER_ID = f.INSPECTED_SITEUSER_ID
LEFT JOIN bus_inspection_safetyenvironmental_inspector si ON si.INSPECTION_ID = f.INSPECTION_ID and si.ISDELETE = '0' LEFT JOIN bus_inspection_safetyenvironmental_inspector si
ON si.INSPECTION_ID = f.INSPECTION_ID and si.ISDELETE = '0'
LEFT JOIN vi_user_all siu ON siu.USER_ID = si.INSPECTION_USER_ID LEFT JOIN vi_user_all siu ON siu.USER_ID = si.INSPECTION_USER_ID
LEFT JOIN sys_dictionaries d ON d.BIANMA = f.INSPECTION_TYPE LEFT JOIN sys_dictionaries d ON d.BIANMA = f.INSPECTION_TYPE
LEFT JOIN (select h.FOREIGN_ID, count(h.HIDDEN_ID) as `count`
from BUS_HIDDEN h
where h.ISDELETE = 0
and h.CREATOR = #{pd.loginUserId}
and h.STATE in ('4', '8')
and (h.FINAL_CHECK is null or h.FINAL_CHECK = '2')
group by h.FOREIGN_ID) h on h.FOREIGN_ID = f.INSPECTION_ID AND f.INSPECTION_STATUS in ('5', '6')
where f.ISDELETE = '0' where f.ISDELETE = '0'
<if test="pd.INSPECTION_ORIGINATOR_ID != null and pd.INSPECTION_ORIGINATOR_ID != ''"><!-- 检查发起人 --> <if test="pd.INSPECTION_ORIGINATOR_ID != null and pd.INSPECTION_ORIGINATOR_ID != ''">
<!-- 检查发起人 -->
and f.INSPECTION_ORIGINATOR_ID = #{pd.INSPECTION_ORIGINATOR_ID} and f.INSPECTION_ORIGINATOR_ID = #{pd.INSPECTION_ORIGINATOR_ID}
</if> </if>
<if test="pd.ARCHIVE_USER_ID != null and pd.ARCHIVE_USER_ID != ''"> <if test="pd.ARCHIVE_USER_ID != null and pd.ARCHIVE_USER_ID != ''">
and ( and (
f.INSPECTION_ORIGINATOR_ID = #{pd.ARCHIVE_USER_ID} f.INSPECTION_ORIGINATOR_ID = #{pd.ARCHIVE_USER_ID}
OR f.INSPECTED_SITEUSER_ID = #{pd.ARCHIVE_USER_ID} OR f.INSPECTED_SITEUSER_ID = #{pd.ARCHIVE_USER_ID}
OR EXISTS(select 1 from bus_inspection_safetyenvironmental_inspector sii where sii.INSPECTION_USER_ID = #{pd.ARCHIVE_USER_ID} OR EXISTS(select 1
from bus_inspection_safetyenvironmental_inspector sii
where sii.INSPECTION_USER_ID = #{pd.ARCHIVE_USER_ID}
and sii.INSPECTION_ID = f.INSPECTION_ID) and sii.INSPECTION_ID = f.INSPECTION_ID)
) )
</if> </if>
<if test="pd.INSPECTED_DEPARTMENT_NAME != null and pd.INSPECTED_DEPARTMENT_NAME != ''"><!-- 被检查单位 --> <if test="pd.INSPECTED_DEPARTMENT_NAME != null and pd.INSPECTED_DEPARTMENT_NAME != ''">
<!-- 被检查单位 -->
and isd.NAME LIKE CONCAT(CONCAT('%', #{pd.INSPECTED_DEPARTMENT_NAME}), '%') and isd.NAME LIKE CONCAT(CONCAT('%', #{pd.INSPECTED_DEPARTMENT_NAME}), '%')
</if> </if>
<if test="pd.INSPECTION_DEPARTMENT_NAME != null and pd.INSPECTION_DEPARTMENT_NAME != ''"><!-- 检查部门 --> <if test="pd.INSPECTION_DEPARTMENT_NAME != null and pd.INSPECTION_DEPARTMENT_NAME != ''">
<!-- 检查部门 -->
and iod.NAME LIKE CONCAT(CONCAT('%', #{pd.INSPECTION_DEPARTMENT_NAME}), '%') and iod.NAME LIKE CONCAT(CONCAT('%', #{pd.INSPECTION_DEPARTMENT_NAME}), '%')
</if> </if>
<if test="pd.INSPECTION_ORIGINATOR_NAME != null and pd.INSPECTION_ORIGINATOR_NAME != ''"><!-- 检查发起人 --> <if test="pd.INSPECTION_ORIGINATOR_NAME != null and pd.INSPECTION_ORIGINATOR_NAME != ''">
<!-- 检查发起人 -->
and iou.NAME LIKE CONCAT(CONCAT('%', #{pd.INSPECTION_ORIGINATOR_NAME}), '%') and iou.NAME LIKE CONCAT(CONCAT('%', #{pd.INSPECTION_ORIGINATOR_NAME}), '%')
</if> </if>
<if test="pd.INSPECTION_TYPE != null and pd.INSPECTION_TYPE != ''"><!-- 检查类型 --> <if test="pd.INSPECTION_TYPE != null and pd.INSPECTION_TYPE != ''">
<!-- 检查类型 -->
and f.INSPECTION_TYPE = #{pd.INSPECTION_TYPE} and f.INSPECTION_TYPE = #{pd.INSPECTION_TYPE}
</if> </if>
<if test="pd.INSPECTION_SUBJECT != null and pd.INSPECTION_SUBJECT != ''"><!-- 检查题目 --> <if test="pd.INSPECTION_SUBJECT != null and pd.INSPECTION_SUBJECT != ''">
<!-- 检查题目 -->
and f.INSPECTION_SUBJECT = #{pd.INSPECTION_SUBJECT,jdbcType=VARCHAR} and f.INSPECTION_SUBJECT = #{pd.INSPECTION_SUBJECT,jdbcType=VARCHAR}
</if> </if>
<if test="pd.INSPECTION_TIME_START != null and pd.INSPECTION_TIME_START != ''"><!-- 检查时间 --> <if test="pd.INSPECTION_TIME_START != null and pd.INSPECTION_TIME_START != ''">
<!-- 检查时间 -->
and f.INSPECTION_TIME_START &gt;= CONCAT(#{pd.INSPECTION_TIME_START}, ' 00:00') and f.INSPECTION_TIME_START &gt;= CONCAT(#{pd.INSPECTION_TIME_START}, ' 00:00')
</if> </if>
<if test="pd.INSPECTION_TIME_END != null and pd.INSPECTION_TIME_END != ''"><!-- 检查时间 --> <if test="pd.INSPECTION_TIME_END != null and pd.INSPECTION_TIME_END != ''">
<!-- 检查时间 -->
and f.INSPECTION_TIME_END &lt;= CONCAT(#{pd.INSPECTION_TIME_END}, ' 23:59') and f.INSPECTION_TIME_END &lt;= CONCAT(#{pd.INSPECTION_TIME_END}, ' 23:59')
</if> </if>
<if test="pd.INSPECTION_STATUS != null and pd.INSPECTION_STATUS != ''"><!-- 检查状态 --> <if test="pd.INSPECTION_STATUS != null and pd.INSPECTION_STATUS != ''">
<!-- 检查状态 -->
<choose> <choose>
<when test="pd.INSPECTION_STATUS == '3-7'"> <when test="pd.INSPECTION_STATUS == '3-7'">
and f.INSPECTION_STATUS in ('3', '4', '5', '6', '7', '8') and f.INSPECTION_STATUS in ('3', '4', '5', '6', '7', '8')
@ -714,15 +738,20 @@
</choose> </choose>
</if> </if>
<if test="pd.KEYWORDS != null and pd.KEYWORDS != ''"><!-- 被检查单位 --> <if test="pd.KEYWORDS != null and pd.KEYWORDS != ''">
<!-- 被检查单位 -->
and ( and (
isd.NAME LIKE CONCAT(CONCAT('%', #{pd.KEYWORDS}), '%') isd.NAME LIKE CONCAT(CONCAT('%', #{pd.KEYWORDS}), '%')
OR iod.NAME LIKE CONCAT(CONCAT('%', #{pd.KEYWORDS}), '%') OR iod.NAME LIKE CONCAT(CONCAT('%', #{pd.KEYWORDS}), '%')
) )
</if> </if>
GROUP BY f.INSPECTION_ID GROUP BY f.INSPECTION_ID
ORDER BY FIELD(if(f.INSPECTED_SITEUSER_ID = #{pd.loginUserId},f.INSPECTED_SITEUSER_ID,'1'), f.INSPECTED_SITEUSER_ID, '1'), ORDER BY CASE
field(f.INSPECTION_STATUS , '3','4','6','7','5','0','1','2','8','-1','-2'), WHEN f.INSPECTION_STATUS IN ('3', '4') AND f.INSPECTED_SITEUSER_ID = #{pd.loginUserId} THEN 1
WHEN f.INSPECTION_STATUS IN ('5', '6', '7') AND checkout = 1 THEN 2
ELSE 3
END,
field(f.INSPECTION_STATUS, '3', '6', '4', '7', '5', '0', '1', '2', '8', '-1', '-2'),
f.INSPECTION_TIME_END DESC f.INSPECTION_TIME_END DESC
</select> </select>