AND ssp.checkState = '0') or (#{nowRole} in ('1','2','3','4'))
WHEN 0 THEN
1
END AS v_del
from smz_ssp_problemmodify ssp
left join sur_project sp on ssp.projectId = sp.id
<!--监理单位/总包公司/分包单位-->
<iftest='nowRole == "5" or nowRole == "6" or nowRole == "7"'> left join sur_project_unit_info spui on spui.projectId = sp.id</if>
<where>
<iftest="projectId != null "> and ssp.projectId = #{projectId}</if>
<iftest="infoType != null "> and ssp.infoType = #{infoType}</if>
<iftest="problemArea != null and problemArea != ''"> and ssp.problemArea like concat('%', #{problemArea}, '%')</if>
<iftest="workParts != null and workParts != ''"> and ssp.workParts like concat('%', #{workParts}, '%')</if>
<iftest="changeInfo != null and changeInfo != ''"> and ssp.changeInfo like concat('%', #{changeInfo}, '%')</if>
<iftest="lordSent != null and lordSent != ''"> and ssp.lordSent = #{lordSent}</if>
<iftest="lordSentUser != null and lordSentUser != ''"> and ssp.lordSentUser = #{lordSentUser}</if>
<iftest="copySend != null and copySend != ''"> and ssp.copySend = #{copySend}</if>
<iftest="copySendUser != null and copySendUser != ''"> and ssp.copySendUser = #{copySendUser}</if>
<iftest="checkState != null "> and ssp.checkState = #{checkState}</if>
<iftest="nickedArea != null and nickedArea != ''"> and nickedArea = #{nickedArea}</if>
<iftest="nickedTime != null "> and ssp.nickedTime = #{nickedTime}</if>
<iftest="projectType != null and projectType != ''"> and ssp.projectType = #{projectType}</if>
<iftest="processName != null and processName != ''"> and ssp.processName like concat('%', #{processName}, '%')</if>
<iftest="projectName != null and projectName != ''"> and ssp.projectName like concat('%', #{projectName}, '%')</if>
<iftest="nickedInfo != null and nickedInfo != ''"> and ssp.nickedInfo = #{nickedInfo}</if>
<iftest="checkUser != null and checkUser != ''"> and ssp.checkUser = #{checkUser}</if>
<iftest="checkUserPhone != null and checkUserPhone != ''"> and ssp.checkUserPhone = #{checkUserPhone}</if>
<iftest="isDel != null "> and ssp.isDel = #{isDel}</if>
<iftest="createUser != null and createUser != ''"> and ssp.createUser like concat('%', #{createUser}, '%')</if>
<iftest="createTime != null "> and ssp.createTime = #{createTime}</if>
<iftest="updateUser != null and updateUser != ''"> and ssp.updateUser = #{updateUser}</if>
<iftest="updateTime != null "> and ssp.updateTime = #{updateTime}</if>
<iftest="dangerType != null and dangerType != ''"> and ssp.danger_type = #{dangerType}</if>
<iftest="params.beginMarksTime != null and params.beginMarksTime != '' and params.endMarksTime != null and params.endMarksTime != ''"> and ssp.createTime between #{params.beginMarksTime} and #{params.endMarksTime}</if>
<!--子部门数据-->
<iftest='nowRole == "4"'> and sp.deptId = #{nowDept}</if>
<!--监理单位/总包公司/分包单位查询当前关联数据-->
<iftest='nowRole == "5" or nowRole == "6" or nowRole == "7"'> and spui.unitId = #{nowDept}</if>
<!--普通整改人是我,复检人是我,抄送人是我的数据-->
<iftest='nowRole == "99"'> and (ssp.lordSentUser = #{nowUser} or ssp.copySendUser = #{nowUser} or ssp.recheckSendUser = #{nowUser} )</if>
<iftest='activeName == "dzg"'> and ssp.checkState in (0,3)</if>
<iftest='activeName == "dqr"'> and ssp.checkState in (1)</if>
<iftest='activeName == "ycl"'> and ssp.checkState = 4 </if>