268 lines
17 KiB
XML
268 lines
17 KiB
XML
<?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>
|
|
<sql id="countUserWhere">
|
|
<if test="problemType != null and problemType != ''"> and problemType = #{problemType}</if>
|
|
<if test="dangerType != null and dangerType != ''"> and danger_type = #{dangerType}</if>
|
|
<if test="createTime != null "> and date(createTime) >= date(#{createTime})</if>
|
|
<if test="updateTime != null "> and date(updateTime) <= date(#{updateTime})</if>
|
|
<if test="createUser != null"> and createUser = #{createUser}</if>
|
|
<if test="lordSent != null and lordSent != ''"> and lordSent = #{lordSent}</if>
|
|
<if test="currentUserId != null and currentUserId!=''">
|
|
AND
|
|
(
|
|
createUser=#{currentUserId} or lordSent=#{currentUserId} or find_in_set(#{currentUserId},copySend) or recheckSend=#{currentUserId}
|
|
)
|
|
</if>
|
|
</sql>
|
|
|
|
<select id="getListCount" parameterType="SmzSspProblemmodify" resultMap="SmzSspProblemmodifyResult">
|
|
select 'a' projectName, count(1) id ,'全部' remark from smz_ssp_problemmodify where projectId=#{projectId} and comId=#{comId} and infoType=#{infoType} and isDel=0
|
|
<include refid="countUserWhere"></include>
|
|
union
|
|
select 'b' projectName, count(1) id,'待整改' remark from smz_ssp_problemmodify where projectId=#{projectId} and comId=#{comId} and infoType=#{infoType} and isDel=0 and checkState in (0,3)
|
|
<include refid="countUserWhere"></include>
|
|
union
|
|
select 'c' projectName, count(1) id,'待复检' remark from smz_ssp_problemmodify where projectId=#{projectId} and comId=#{comId} and infoType=#{infoType} and isDel=0 and checkState in (1)
|
|
<include refid="countUserWhere"></include>
|
|
union
|
|
select 'd' projectName, count(1) id,'整改完成' remark from smz_ssp_problemmodify where projectId=#{projectId} and comId=#{comId} and infoType=#{infoType} and isDel=0 and checkState in (4)
|
|
<include refid="countUserWhere"></include>
|
|
union
|
|
select 'e' projectName, count(1) id,'整改超时' remark from smz_ssp_problemmodify where projectId=#{projectId} and comId=#{comId} and infoType=#{infoType} and isDel=0 and checkState not in (4) and date(nickedTime) <= curdate()
|
|
<include refid="countUserWhere"></include>
|
|
</select>
|
|
|
|
<select id="selectList" parameterType="SmzSspProblemmodify" resultMap="SmzSspProblemmodifyResult">
|
|
<include refid="selectSmzSspProblemmodifyVo"/>
|
|
where isDel=0 and projectId=#{projectId} and comId=#{comId} and infoType=#{infoType}
|
|
<if test="projectName==1">
|
|
|
|
</if>
|
|
<if test="projectName==2">
|
|
and checkState in (0,3)
|
|
</if>
|
|
<if test="projectName==3">
|
|
and checkState in (1)
|
|
</if>
|
|
<if test="projectName==4">
|
|
and checkState in (4)
|
|
</if>
|
|
<if test="projectName==5">
|
|
and checkState not in (4) and date(nickedTime) <= curdate()
|
|
</if>
|
|
<include refid="countUserWhere"></include>
|
|
</select>
|
|
</mapper> |