<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 == "99"'> and (ssp.lordSentUser = #{nowUser} or ssp.copySendUser = #{nowUser} or ssp.recheckSendUser = #{nowUser} or ssp.createUser = #{nowUser} )</if>
<iftest='activeName == "zgcs"'> and (date(NOW())<![CDATA[ > ]]> date(ssp.nickedTime) and (ssp.updateTime is null or date(ssp.updateTime) <![CDATA[ > ]]> date(ssp.nickedTime))) </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="createUser != null and createUser != ''"> and ssp.createUser like concat('%', #{createUser}, '%')</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="projectDeptId != null "> and sp.deptId = #{projectDeptId}</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} or ssp.createUser = #{nowUser} )</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="createUser != null and createUser != ''"> and ssp.createUser like concat('%', #{createUser}, '%')</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="projectDeptId != null "> and sp.deptId = #{projectDeptId}</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} or ssp.createUser = #{nowUser} )</if>
select a.projectId,a.prjName projectName,a.proble id,if(b.timoutNoComp is null,0,b.timoutNoComp) infoType,if(c.timoutComp is null,0,c.timoutComp) checkState from
(
select projectId,prjName,count(1) proble from vw_smz_ssp_problemmodify_audit