2025-02-15 16:52:57 +08:00
<?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.yanzhu.manage.mapper.SmzSspProblemmodifyMapper" >
<resultMap type= "SmzSspProblemmodify" id= "SmzSspProblemmodifyResult" >
<result property= "id" column= "id" />
<result property= "comId" column= "comId" />
<result property= "projectId" column= "projectId" />
<result property= "infoType" column= "infoType" />
<result property= "marksPicture" column= "marks_picture" />
<result property= "marksVideo" column= "marks_video" />
<result property= "correctionPicture" column= "correction_picture" />
<result property= "problemArea" column= "problemArea" />
<result property= "workParts" column= "workParts" />
<result property= "changeInfo" column= "changeInfo" />
<result property= "lordSent" column= "lordSent" />
<result property= "lordSentUser" column= "lordSentUser" />
<result property= "copySend" column= "copySend" />
<result property= "copySendUser" column= "copySendUser" />
<result property= "checkState" column= "checkState" />
<result property= "nickedArea" column= "nickedArea" />
<result property= "nickedTime" column= "nickedTime" />
<result property= "projectType" column= "projectType" />
<result property= "processName" column= "processName" />
<result property= "projectName" column= "projectName" />
<result property= "nickedInfo" column= "nickedInfo" />
<result property= "checkUser" column= "checkUser" />
<result property= "checkUserPhone" column= "checkUserPhone" />
<result property= "smarkUrl" column= "smark_url" />
<result property= "isDel" column= "isDel" />
<result property= "createUser" column= "createUser" />
<result property= "createTime" column= "createTime" />
<result property= "updateUser" column= "updateUser" />
<result property= "updateTime" column= "updateTime" />
<result property= "dangerType" column= "danger_type" />
<result property= "recheckSend" column= "recheckSend" />
<result property= "recheckSendUser" column= "recheckSendUser" />
<result property= "roleType" column= "roleType" />
<result property= "problemType" column= "problemType" />
</resultMap>
<sql id= "selectSmzSspProblemmodifyVo" >
select id, comId, projectId, infoType, marks_picture, marks_video, correction_picture, problemArea, workParts, changeInfo, lordSent, lordSentUser, copySend, copySendUser, checkState, nickedArea, nickedTime, projectType, processName, projectName, nickedInfo, checkUser, checkUserPhone, smark_url, isDel, createUser, createTime, updateUser, updateTime, danger_type, recheckSend, recheckSendUser, roleType, problemType from smz_ssp_problemmodify
</sql>
<select id= "selectSmzSspProblemmodifyList" parameterType= "SmzSspProblemmodify" resultMap= "SmzSspProblemmodifyResult" >
<include refid= "selectSmzSspProblemmodifyVo" />
<where >
<if test= "comId != null " > and comId = #{comId}</if>
<if test= "projectId != null " > and projectId = #{projectId}</if>
<if test= "infoType != null " > and infoType = #{infoType}</if>
<if test= "marksPicture != null and marksPicture != ''" > and marks_picture = #{marksPicture}</if>
<if test= "marksVideo != null and marksVideo != ''" > and marks_video = #{marksVideo}</if>
<if test= "correctionPicture != null and correctionPicture != ''" > and correction_picture = #{correctionPicture}</if>
<if test= "problemArea != null and problemArea != ''" > and problemArea = #{problemArea}</if>
<if test= "workParts != null and workParts != ''" > and workParts = #{workParts}</if>
<if test= "changeInfo != null and changeInfo != ''" > and changeInfo = #{changeInfo}</if>
<if test= "lordSent != null and lordSent != ''" > and lordSent = #{lordSent}</if>
<if test= "lordSentUser != null and lordSentUser != ''" > and lordSentUser = #{lordSentUser}</if>
<if test= "copySend != null and copySend != ''" > and copySend = #{copySend}</if>
<if test= "copySendUser != null and copySendUser != ''" > and copySendUser = #{copySendUser}</if>
<if test= "checkState != null " > and checkState = #{checkState}</if>
<if test= "nickedArea != null and nickedArea != ''" > and nickedArea = #{nickedArea}</if>
<if test= "nickedTime != null " > and nickedTime = #{nickedTime}</if>
<if test= "projectType != null and projectType != ''" > and projectType = #{projectType}</if>
<if test= "processName != null and processName != ''" > and processName like concat('%', #{processName}, '%')</if>
<if test= "projectName != null and projectName != ''" > and projectName like concat('%', #{projectName}, '%')</if>
<if test= "nickedInfo != null and nickedInfo != ''" > and nickedInfo = #{nickedInfo}</if>
<if test= "checkUser != null and checkUser != ''" > and checkUser = #{checkUser}</if>
<if test= "checkUserPhone != null and checkUserPhone != ''" > and checkUserPhone = #{checkUserPhone}</if>
<if test= "smarkUrl != null and smarkUrl != ''" > and smark_url = #{smarkUrl}</if>
<if test= "isDel != null " > and isDel = #{isDel}</if>
<if test= "createUser != null and createUser != ''" > and createUser = #{createUser}</if>
<if test= "createTime != null " > and createTime = #{createTime}</if>
<if test= "updateUser != null and updateUser != ''" > and updateUser = #{updateUser}</if>
<if test= "updateTime != null " > and updateTime = #{updateTime}</if>
<if test= "dangerType != null and dangerType != ''" > and danger_type = #{dangerType}</if>
<if test= "recheckSend != null and recheckSend != ''" > and recheckSend = #{recheckSend}</if>
<if test= "recheckSendUser != null and recheckSendUser != ''" > and recheckSendUser = #{recheckSendUser}</if>
<if test= "roleType != null " > and roleType = #{roleType}</if>
<if test= "problemType != null and problemType != ''" > and problemType = #{problemType}</if>
</where>
</select>
<select id= "selectSmzSspProblemmodifyById" parameterType= "Long" resultMap= "SmzSspProblemmodifyResult" >
<include refid= "selectSmzSspProblemmodifyVo" />
where id = #{id}
</select>
<insert id= "insertSmzSspProblemmodify" parameterType= "SmzSspProblemmodify" useGeneratedKeys= "true" keyProperty= "id" >
insert into smz_ssp_problemmodify
<trim prefix= "(" suffix= ")" suffixOverrides= "," >
<if test= "comId != null" > comId,</if>
<if test= "projectId != null" > projectId,</if>
<if test= "infoType != null" > infoType,</if>
<if test= "marksPicture != null" > marks_picture,</if>
<if test= "marksVideo != null" > marks_video,</if>
<if test= "correctionPicture != null" > correction_picture,</if>
<if test= "problemArea != null" > problemArea,</if>
<if test= "workParts != null" > workParts,</if>
<if test= "changeInfo != null" > changeInfo,</if>
<if test= "lordSent != null" > lordSent,</if>
<if test= "lordSentUser != null" > lordSentUser,</if>
<if test= "copySend != null" > copySend,</if>
<if test= "copySendUser != null" > copySendUser,</if>
<if test= "checkState != null" > checkState,</if>
<if test= "nickedArea != null" > nickedArea,</if>
<if test= "nickedTime != null" > nickedTime,</if>
<if test= "projectType != null" > projectType,</if>
<if test= "processName != null" > processName,</if>
<if test= "projectName != null" > projectName,</if>
<if test= "nickedInfo != null" > nickedInfo,</if>
<if test= "checkUser != null" > checkUser,</if>
<if test= "checkUserPhone != null" > checkUserPhone,</if>
<if test= "smarkUrl != null" > smark_url,</if>
<if test= "isDel != null" > isDel,</if>
<if test= "createUser != null" > createUser,</if>
<if test= "createTime != null" > createTime,</if>
<if test= "updateUser != null" > updateUser,</if>
<if test= "updateTime != null" > updateTime,</if>
<if test= "dangerType != null" > danger_type,</if>
<if test= "recheckSend != null" > recheckSend,</if>
<if test= "recheckSendUser != null" > recheckSendUser,</if>
<if test= "roleType != null" > roleType,</if>
<if test= "problemType != null" > problemType,</if>
</trim>
<trim prefix= "values (" suffix= ")" suffixOverrides= "," >
<if test= "comId != null" > #{comId},</if>
<if test= "projectId != null" > #{projectId},</if>
<if test= "infoType != null" > #{infoType},</if>
<if test= "marksPicture != null" > #{marksPicture},</if>
<if test= "marksVideo != null" > #{marksVideo},</if>
<if test= "correctionPicture != null" > #{correctionPicture},</if>
<if test= "problemArea != null" > #{problemArea},</if>
<if test= "workParts != null" > #{workParts},</if>
<if test= "changeInfo != null" > #{changeInfo},</if>
<if test= "lordSent != null" > #{lordSent},</if>
<if test= "lordSentUser != null" > #{lordSentUser},</if>
<if test= "copySend != null" > #{copySend},</if>
<if test= "copySendUser != null" > #{copySendUser},</if>
<if test= "checkState != null" > #{checkState},</if>
<if test= "nickedArea != null" > #{nickedArea},</if>
<if test= "nickedTime != null" > #{nickedTime},</if>
<if test= "projectType != null" > #{projectType},</if>
<if test= "processName != null" > #{processName},</if>
<if test= "projectName != null" > #{projectName},</if>
<if test= "nickedInfo != null" > #{nickedInfo},</if>
<if test= "checkUser != null" > #{checkUser},</if>
<if test= "checkUserPhone != null" > #{checkUserPhone},</if>
<if test= "smarkUrl != null" > #{smarkUrl},</if>
<if test= "isDel != null" > #{isDel},</if>
<if test= "createUser != null" > #{createUser},</if>
<if test= "createTime != null" > #{createTime},</if>
<if test= "updateUser != null" > #{updateUser},</if>
<if test= "updateTime != null" > #{updateTime},</if>
<if test= "dangerType != null" > #{dangerType},</if>
<if test= "recheckSend != null" > #{recheckSend},</if>
<if test= "recheckSendUser != null" > #{recheckSendUser},</if>
<if test= "roleType != null" > #{roleType},</if>
<if test= "problemType != null" > #{problemType},</if>
</trim>
</insert>
<update id= "updateSmzSspProblemmodify" parameterType= "SmzSspProblemmodify" >
update smz_ssp_problemmodify
<trim prefix= "SET" suffixOverrides= "," >
<if test= "comId != null" > comId = #{comId},</if>
<if test= "projectId != null" > projectId = #{projectId},</if>
<if test= "infoType != null" > infoType = #{infoType},</if>
<if test= "marksPicture != null" > marks_picture = #{marksPicture},</if>
<if test= "marksVideo != null" > marks_video = #{marksVideo},</if>
<if test= "correctionPicture != null" > correction_picture = #{correctionPicture},</if>
<if test= "problemArea != null" > problemArea = #{problemArea},</if>
<if test= "workParts != null" > workParts = #{workParts},</if>
<if test= "changeInfo != null" > changeInfo = #{changeInfo},</if>
<if test= "lordSent != null" > lordSent = #{lordSent},</if>
<if test= "lordSentUser != null" > lordSentUser = #{lordSentUser},</if>
<if test= "copySend != null" > copySend = #{copySend},</if>
<if test= "copySendUser != null" > copySendUser = #{copySendUser},</if>
<if test= "checkState != null" > checkState = #{checkState},</if>
<if test= "nickedArea != null" > nickedArea = #{nickedArea},</if>
<if test= "nickedTime != null" > nickedTime = #{nickedTime},</if>
<if test= "projectType != null" > projectType = #{projectType},</if>
<if test= "processName != null" > processName = #{processName},</if>
<if test= "projectName != null" > projectName = #{projectName},</if>
<if test= "nickedInfo != null" > nickedInfo = #{nickedInfo},</if>
<if test= "checkUser != null" > checkUser = #{checkUser},</if>
<if test= "checkUserPhone != null" > checkUserPhone = #{checkUserPhone},</if>
<if test= "smarkUrl != null" > smark_url = #{smarkUrl},</if>
<if test= "isDel != null" > isDel = #{isDel},</if>
<if test= "createUser != null" > createUser = #{createUser},</if>
<if test= "createTime != null" > createTime = #{createTime},</if>
<if test= "updateUser != null" > updateUser = #{updateUser},</if>
<if test= "updateTime != null" > updateTime = #{updateTime},</if>
<if test= "dangerType != null" > danger_type = #{dangerType},</if>
<if test= "recheckSend != null" > recheckSend = #{recheckSend},</if>
<if test= "recheckSendUser != null" > recheckSendUser = #{recheckSendUser},</if>
<if test= "roleType != null" > roleType = #{roleType},</if>
<if test= "problemType != null" > problemType = #{problemType},</if>
</trim>
where id = #{id}
</update>
<delete id= "deleteSmzSspProblemmodifyById" parameterType= "Long" >
delete from smz_ssp_problemmodify where id = #{id}
</delete>
<delete id= "deleteSmzSspProblemmodifyByIds" parameterType= "String" >
delete from smz_ssp_problemmodify where id in
<foreach item= "id" collection= "array" open= "(" separator= "," close= ")" >
#{id}
</foreach>
</delete>
2025-03-01 00:06:15 +08:00
<sql id= "countUserWhere" >
2025-03-02 23:21:59 +08:00
<if test= "problemType != null and problemType != ''" > and a,problemType = #{problemType}</if>
<if test= "dangerType != null and dangerType != ''" > and a.danger_type = #{dangerType}</if>
<if test= "createTime != null " > and date(a.createTime) > = date(#{createTime})</if>
<if test= "updateTime != null " > and date(a.updateTime) < = date(#{updateTime})</if>
<if test= "createUser != null" > and a.createUser = #{createUser}</if>
<if test= "lordSent != null and lordSent != ''" > and a.lordSent = #{lordSent}</if>
2025-03-01 00:06:15 +08:00
<if test= "currentUserId != null and currentUserId!=''" >
AND
(
2025-03-02 23:21:59 +08:00
a.createUser=#{currentUserId} or a.lordSent=#{currentUserId} or find_in_set(#{currentUserId},a.copySend) or a.recheckSend=#{currentUserId}
2025-03-01 00:06:15 +08:00
)
</if>
</sql>
<select id= "getListCount" parameterType= "SmzSspProblemmodify" resultMap= "SmzSspProblemmodifyResult" >
2025-03-02 23:21:59 +08:00
select 'a' projectName, count(1) id ,'全部' remark from smz_ssp_problemmodify a where a.projectId=#{projectId} and a.comId=#{comId} and a.infoType=#{infoType} and a.isDel=0
2025-03-01 00:06:15 +08:00
<include refid= "countUserWhere" > </include>
union
2025-03-02 23:21:59 +08:00
select 'b' projectName, count(1) id,'待整改' remark from smz_ssp_problemmodify a where a.projectId=#{projectId} and a.comId=#{comId} and a.infoType=#{infoType} and a.isDel=0 and a.checkState in (0,3)
2025-03-01 00:06:15 +08:00
<include refid= "countUserWhere" > </include>
union
2025-03-02 23:21:59 +08:00
select 'c' projectName, count(1) id,'待复检' remark from smz_ssp_problemmodify a where a.projectId=#{projectId} and a.comId=#{comId} and a.infoType=#{infoType} and a.isDel=0 and a.checkState in (1)
2025-03-01 00:06:15 +08:00
<include refid= "countUserWhere" > </include>
union
2025-03-02 23:21:59 +08:00
select 'd' projectName, count(1) id,'整改完成' remark from smz_ssp_problemmodify a where a.projectId=#{projectId} and a.comId=#{comId} and a.infoType=#{infoType} and a.isDel=0 and a.checkState in (4)
2025-03-01 00:06:15 +08:00
<include refid= "countUserWhere" > </include>
union
2025-03-02 23:21:59 +08:00
select 'e' projectName, count(1) id,'整改超时' remark from smz_ssp_problemmodify a where a.projectId=#{projectId} and a.comId=#{comId} and a.infoType=#{infoType} and a.isDel=0 and a.checkState not in (4) and date(a.nickedTime) < = curdate()
2025-03-01 00:06:15 +08:00
<include refid= "countUserWhere" > </include>
</select>
2025-03-01 16:11:25 +08:00
<select id= "selectList" parameterType= "SmzSspProblemmodify" resultMap= "SmzSspProblemmodifyResult" >
2025-03-02 23:21:59 +08:00
SELECT
a.id,
a.comId,
a.projectId,
a.infoType,
a.marks_picture,
a.marks_video,
a.correction_picture,
a.problemArea,
a.workParts,
a.changeInfo,
CONCAT(a.lordSentUser ,'【',b.sub_dept_name,'】',b.user_phone) as lordSent,
a.lordSentUser,
a.copySend,
a.copySendUser,
a.checkState,
a.nickedArea,
a.nickedTime,
a.projectType,
a.processName,
a.projectName,
a.nickedInfo,
a.checkUser,
a.checkUserPhone,
a.smark_url,
a.isDel,
2025-03-04 00:08:06 +08:00
CONCAT(c.nick_name,'【',c.phonenumber,'】') as createUser,
2025-03-02 23:21:59 +08:00
a.createTime,
a.updateUser,
a.updateTime,
a.danger_type,
CONCAT(a.recheckSendUser ,'【',d.sub_dept_name,'】',d.user_phone) as recheckSend,
a.recheckSendUser,
a.roleType,
a.problemType
FROM
smz_ssp_problemmodify a
LEFT JOIN pro_project_info_subdepts_users b ON a.lordSent = b.user_id AND a.projectId = b.project_id AND a.comId = b.com_id
LEFT JOIN pro_project_info_subdepts_users d ON a.recheckSend = d.user_id AND a.projectId = d.project_id AND a.comId = d.com_id
LEFT JOIN sys_user c ON a.createUser = c.user_id
where a.isDel=0 and a.projectId=#{projectId} and a.comId=#{comId} and a.infoType=#{infoType}
2025-03-01 16:11:25 +08:00
<if test= "projectName==1" >
</if>
<if test= "projectName==2" >
2025-03-02 23:21:59 +08:00
and a.checkState in (0,3)
2025-03-01 16:11:25 +08:00
</if>
<if test= "projectName==3" >
2025-03-02 23:21:59 +08:00
and a.checkState in (1)
2025-03-01 16:11:25 +08:00
</if>
<if test= "projectName==4" >
2025-03-02 23:21:59 +08:00
and a.checkState in (4)
2025-03-01 16:11:25 +08:00
</if>
<if test= "projectName==5" >
2025-03-02 23:21:59 +08:00
and a.checkState not in (4) and date(nickedTime) < = curdate()
2025-03-01 16:11:25 +08:00
</if>
<include refid= "countUserWhere" > </include>
</select>
2025-02-15 16:52:57 +08:00
</mapper>