<iftest="FIND_CHECKRECORD_ID != null and FIND_CHECKRECORD_ID != ''">
and h.CHECKRECORD_ID=#{CHECKRECORD_ID}
</if>
<iftest="KEYWORDS != null and KEYWORDS != ''"><!-- 关键词检索 -->
and
(
h.RISK_UNIT LIKE CONCAT(CONCAT('%', #{KEYWORDS}),'%')
or
h.RISK_POSITION LIKE CONCAT(CONCAT('%', #{KEYWORDS}),'%')
or
h.CHECK_CONTENT LIKE CONCAT(CONCAT('%', #{KEYWORDS}),'%')
or
h.HIDDENDESCR LIKE CONCAT(CONCAT('%', #{KEYWORDS}),'%')
)
</if>
<iftest="HIDDENDESCR != null and HIDDENDESCR != ''"><!-- 关键词检索 -->
and h.HIDDENDESCR LIKE CONCAT(CONCAT('%', #{HIDDENDESCR}),'%')
</if>
<iftest="ISQUALIFIED != null and ISQUALIFIED != ''"><!-- 关键词检索 -->
and h.ISQUALIFIED = #{ISQUALIFIED}
</if>
<iftest="DEPARTMENT_ID != null and DEPARTMENT_ID != ''"><!-- 关键词检索 -->
and h.HIDDENFINDDEPT = #{DEPARTMENT_ID}
</if>
<iftest="HIDDENLEVEL != null and HIDDENLEVEL != ''"><!-- 关键词检索 -->
and h.HIDDENLEVEL = #{HIDDENLEVEL}
</if>
<iftest="STARTTIME != null and STARTTIME != ''"><!-- 关键词检索 -->
and h.CREATTIME >= #{STARTTIME}
</if>
<iftest="ENDTIME != null and ENDTIME != ''">
and h.CREATTIME <= #{ENDTIME}
</if>
<iftest="STATE != null and STATE !='' and STATE != 0">
and h.STATE = #{STATE}
</if>
<iftest="SELF_USER_ID != null and SELF_USER_ID != ''">
and h.CREATOR = #{SELF_USER_ID}
</if>
<iftest="DISPOSESTATE != null and DISPOSESTATE != ''"><!-- 关键词检索 -->
<iftest="DISPOSESTATE==2"><!-- 整改 -->
and h.RECTIFICATIONOR = #{SELFUSERID}
and h.STATE in('1','-1')
</if>
<iftest="DISPOSESTATE==3"><!-- 验收 -->
and h.STATE = '3'
and (select count(1) from BUS_HIDDENCHECK bh where bh.USER_ID=#{SELFUSERID} and bh.HIDDEN_ID=h.HIDDEN_ID and bh.STATUS=0)>0
</if>
<iftest="DISPOSESTATE==4"><!-- 已验收 -->
and h.STATE = '4'
and (h.RECTIFICATIONOR = #{SELFUSERID} or h.CREATOR = #{SELFUSERID} or (select count(1) from BUS_HIDDENCHECK bh where bh.USER_ID=#{SELFUSERID} and bh.HIDDEN_ID=h.HIDDEN_ID)>0)
</if>
<iftest="DISPOSESTATE==-1"><!-- 所有 -->
<iftest="CORPINFO_ID != null and CORPINFO_ID != ''"><!-- 关键词检索 -->
and
h.CORPINFO_ID = #{CORPINFO_ID}
</if>
<iftest="STATE != null and STATE != ''"><!-- 关键词检索 -->
and
h.STATE = #{STATE}
</if>
</if>
</if>
<iftest="HIDDEN_IDS != null and HIDDEN_IDS != ''"><!-- 关键词检索 -->