From 16dc9b71a91fa8ca5bb85285a5d54cb3e28eb60f Mon Sep 17 00:00:00 2001
From: 16639036659 <577530412@qq.com>
Date: 星期二, 18 六月 2024 17:21:51 +0800
Subject: [PATCH] 时间处理
---
src/main/resources/mybatis/tr/HiddenDangerCheckMapper.xml | 125 +++++++++++++++++++++++++++++++++++++++++
1 files changed, 124 insertions(+), 1 deletions(-)
diff --git a/src/main/resources/mybatis/tr/HiddenDangerCheckMapper.xml b/src/main/resources/mybatis/tr/HiddenDangerCheckMapper.xml
index 59ef875..dad4ef2 100644
--- a/src/main/resources/mybatis/tr/HiddenDangerCheckMapper.xml
+++ b/src/main/resources/mybatis/tr/HiddenDangerCheckMapper.xml
@@ -85,6 +85,7 @@
<select id="selectHiddenDangerCheckList" parameterType="HiddenDangerCheck" resultMap="HiddenDangerCheckResult">
<include refid="selectHiddenDangerCheckVo"/>
+
<where>
<if test="checkId != null and checkId != ''"> and a.check_id = #{checkId}</if>
<if test="planCreateUserId != null and planCreateUserId != ''"> and a.plan_create_user_id = #{planCreateUserId}</if>
@@ -148,7 +149,6 @@
<if test="exceptionInfo != null and exceptionInfo != ''"> and a.exception_info = #{exceptionInfo}</if>
-
<if test="checkType != null and checkType != ''"> and a.check_type = #{checkType}</if>
<if test="params.beginTime != null and params.beginTime != ''"><!-- 开始时间检索 -->
@@ -163,6 +163,104 @@
and (a.examine_user_id = #{ledgerUserId}
or a.rectify_user_id = #{ledgerUserId}
or a.accept_user_id = #{ledgerUserId})</if>
+
+
+ <if test="null != ledgerUserIdList and ledgerUserIdList.size() > 0">
+ and (a.rectify_user_id in
+ <foreach collection="ledgerUserIdList" item="ledgerUserId" open="(" separator="," close=")">
+ #{ledgerUserId}
+ </foreach>)
+ </if>
+
+ </where>
+ order by a.create_time desc
+ </select>
+
+ <select id="selectHiddenDangerCheckListNew" parameterType="HiddenDangerCheck" resultMap="HiddenDangerCheckResult">
+ <include refid="selectHiddenDangerCheckVo"/>
+
+ <where>
+ <if test="checkId != null and checkId != ''"> and a.check_id = #{checkId}</if>
+ <if test="planCreateUserId != null and planCreateUserId != ''"> and a.plan_create_user_id = #{planCreateUserId}</if>
+ <if test="planName != null and planName != ''"> and a.plan_name like concat('%', #{planName}, '%')</if>
+ <if test="troubleshootTypeId != null "> and a.troubleshoot_type_id = #{troubleshootTypeId}</if>
+ <if test="troubleshootTypeName != null and troubleshootTypeName != ''"> and a.troubleshoot_type_name like concat('%', #{troubleshootTypeName}, '%')</if>
+ <if test="organizationDeptId != null "> and a.organization_dept_id = #{organizationDeptId}</if>
+ <if test="organizationDeptName != null and organizationDeptName != ''"> and a.organization_dept_name like concat('%', #{organizationDeptName}, '%')</if>
+ <if test="riskType != null and riskType != ''"> and a.risk_type = #{riskType}</if>
+ <if test="riskId != null "> and a.risk_id = #{riskId}</if>
+ <if test="riskName != null and riskName != ''"> and a.risk_name like concat('%', #{riskName}, '%')</if>
+ <if test="checkUserId != null "> and a.check_user_id = #{checkUserId}</if>
+
+
+ <if test="null != checkUserIdList and checkUserIdList.size() > 0">
+ and (a.check_user_id in
+ <foreach collection="checkUserIdList" item="checkUserId" open="(" separator="," close=")">
+ #{checkUserId}
+ </foreach>)
+ </if>
+
+ <if test="beCheckedDeptId != null "> and a.be_checked_dept_id = #{beCheckedDeptId}</if>
+ <if test="beCheckedDeptName != null and beCheckedDeptName != ''"> and a.be_checked_dept_name like concat('%', #{beCheckedDeptName}, '%')</if>
+
+
+ <if test="checkBeginTime != null and checkBeginTime != ''"> AND a.create_time >= date_format(#{checkBeginTime},'%y%m%d') </if>
+ <if test="checkEndTime != null and checkEndTime != ''"> AND date_format(#{checkEndTime},'%y%m%d') >= a.create_time </if>
+ <if test="checkUserName != null and checkUserName != ''"> and a.update_by like concat('%', #{checkUserName}, '%')</if>
+
+
+ <if test="planFormulateStatus != null and planFormulateStatus != ''"> and a.plan_formulate_status = #{planFormulateStatus}</if>
+ <if test="planExecuteStatus != null and planExecuteStatus != ''"> and a.plan_execute_status = #{planExecuteStatus}</if>
+ <if test="checkStatus != null and checkStatus != ''"> and a.check_status = #{checkStatus}</if>
+ <if test="dangerDeptId != null and dangerDeptId != ''"> and a.danger_dept_id = #{dangerDeptId}</if>
+ <if test="dangerDeptName != null and dangerDeptName != ''"> and a.danger_dept_name = #{dangerDeptName}</if>
+ <if test="dangerPlaceId != null and dangerPlaceId != ''"> and a.danger_place_id = #{dangerPlaceId}</if>
+ <if test="dangerPlaceName != null and dangerPlaceName != ''"> and a.danger_place_name = #{dangerPlaceName}</if>
+ <if test="checkTime != null "> and a.check_time = #{checkTime}</if>
+ <if test="examineUserId != null "> and a.examine_user_id = #{examineUserId}</if>
+ <if test="examineUserName != null and examineUserName != ''"> and a.examine_user_name like concat('%', #{examineUserName}, '%')</if>
+ <if test="stage != null and stage != ''"> and a.stage = #{stage}</if>
+ <if test="planFormulateStatusExclude != null and planFormulateStatusExclude != ''"> and a.plan_formulate_status != #{planFormulateStatusExclude}</if>
+
+
+
+ <if test="scheduleCreateUserId != null "> and a.schedule_create_user_id = #{scheduleCreateUserId}</if>
+ <if test="scheduleCreateUserName != null and scheduleCreateUserName != ''"> and a.schedule_create_user_name like concat('%', #{scheduleCreateUserName}, '%')</if>
+ <if test="scheduleCheckUserId != null "> and a.schedule_check_user_id = #{scheduleCheckUserId}</if>
+
+ <if test="null != scheduleCheckUserIdList and scheduleCheckUserIdList.size() > 0">
+ and (a.schedule_check_user_id in
+ <foreach collection="scheduleCheckUserIdList" item="scheduleCheckUserId" open="(" separator="," close=")">
+ #{scheduleCheckUserId}
+ </foreach>)
+ </if>
+
+ <if test="scheduleCheckUserName != null and scheduleCheckUserName != ''"> and a.schedule_check_user_name like concat('%', #{scheduleCheckUserName}, '%')</if>
+ <if test="scheduleCheckStatus != null and scheduleCheckStatus != ''"> and a.schedule_check_status = #{scheduleCheckStatus}</if>
+ <if test="jobId != null "> and a.job_id = #{jobId}</if>
+ <if test="jobName != null and jobName != ''"> and a.job_name like concat('%', #{jobName}, '%')</if>
+ <if test="jobGroup != null and jobGroup != ''"> and a.job_group = #{jobGroup}</if>
+ <if test="invokeTarget != null and invokeTarget != ''"> and a.invoke_target = #{invokeTarget}</if>
+ <if test="jobMessage != null and jobMessage != ''"> and a.job_message = #{jobMessage}</if>
+ <if test="status != null and status != ''"> and a.status = #{status}</if>
+ <if test="exceptionInfo != null and exceptionInfo != ''"> and a.exception_info = #{exceptionInfo}</if>
+
+
+
+ <if test="checkType != null and checkType != ''"> and a.check_type = #{checkType}</if>
+
+ <if test="params.beginTime != null and params.beginTime != ''"><!-- 开始时间检索 -->
+ AND date_format(a.create_time,'%y%m%d') >= date_format(#{params.beginTime},'%y%m%d')
+ </if>
+ <if test="params.endTime != null and params.endTime != ''"><!-- 结束时间检索 -->
+ AND date_format(#{params.endTime},'%y%m%d') >= date_format(a.create_time,'%y%m%d')
+ </if>
+
+
+ <if test="ledgerUserId != null ">
+ and (a.examine_user_id = #{ledgerUserId}
+ or a.rectify_user_id = #{ledgerUserId}
+ or a.accept_user_id = #{ledgerUserId})</if>
<if test="null != ledgerUserIdList and ledgerUserIdList.size() > 0">
@@ -359,4 +457,29 @@
</foreach>
</delete>
+<!-- HiddenDangerCheck getHiddenDangerCheckById(Long checkId);-->
+ <select id="getHiddenDangerCheckById" parameterType="HiddenDangerCheck" resultMap="HiddenDangerCheckResult">
+ select * from tr_hidden_danger_check
+ where check_id = #{checkId}
+ </select>
+
+ <update id="getHiddenDangerCheckByIdOld" parameterType="Long">
+ update tr_hidden_danger_check set
+ create_by = #{createBy},
+ update_by = #{updateBy},
+ create_time = #{createTime},
+ update_time = #{updateTime}
+
+ where id = #{checkId}
+ </update>
+
+
+<!-- <if test="createBy != null and createBy != ''">create_by = #{createBy},</if>-->
+<!-- <if test="createTime != null ">create_time = #{createTime},</if>-->
+<!-- <if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>-->
+<!-- <if test="updateTime != null ">update_time = #{updateTime},</if>-->
+<!-- <if test="remark != null and remark != ''">remark = #{remark},</if>-->
+<!-- <if test="planCreateUserId != null and planCreateUserId != ''">plan_create_user_id = #{planCreateUserId},</if>-->
+
+
</mapper>
\ No newline at end of file
--
Gitblit v1.9.2