<select id="selectAllMmsRepairBySth" parameterClass="hashmap" resultMap="mmssampleDataMap">
<![CDATA[
SELECT
*
FROM
mms_sample_datas
WHERE
mms_sample_datas.mms_id IN (
SELECT
mms_sample_datas.mms_id
FROM
mms_sample_datas
INNER JOIN mms_text_datas ON mms_sample_datas.uuid = mms_text_datas.mms_uuid
AND mms_text_datas.is_repair_audit =
UNION
SELECT
mms_sample_datas.mms_id
FROM
mms_sample_datas
INNER JOIN mms_pic_datas ON mms_sample_datas.uuid = mms_pic_datas.mms_uuid
AND mms_pic_datas.is_repair_audit =
)
]]>
<dynamic prepend="and">
<isNotEmpty prepend="AND" property="isRepairAudit">
is_repair_audit ='$isRepairAudit$'
</isNotEmpty>
<isNotEmpty prepend="AND" property="storageDateBegin">
<![CDATA[
(storage_date >= #storageDateBegin#)
]]>
</isNotEmpty>
<isNotEmpty prepend="AND" property="storageDateEnd">
<![CDATA[
(storage_date <= #storageDateEnd#)
]]>
</isNotEmpty>
<isNotEmpty prepend="AND" property="autoAuditDateBegin">
<![CDATA[
(auto_audit_date >= #autoAuditDateBegin#)
]]>
</isNotEmpty>
<isNotEmpty prepend="AND" property="autoAuditDateEnd">
<![CDATA[
(auto_audit_date <= #autoAuditDateEnd#)
]]>
</isNotEmpty>
<isNotEmpty prepend="AND" property="confidenceType">
<![CDATA[
(confidence_type = #confidenceType#)
]]>
</isNotEmpty>
<isNotEmpty prepend="AND" property="sampleSource">
<![CDATA[
(sample_source = #sampleSource#)
]]>
</isNotEmpty>
<isNotEmpty prepend="AND" property="sampleType">
<![CDATA[
(sample_type = #sampleType#)
]]>
</isNotEmpty>
<isNotEmpty prepend="AND" property="repeatDateBegin">
<![CDATA[
(storage_date >= #repeatDateBegin#)
]]>
</isNotEmpty>
<isNotEmpty prepend="AND" property="repeatDateEnd">
<![CDATA[
(storage_date <= #repeatDateEnd#)
]]>
</isNotEmpty>
<isNotEmpty prepend="AND" property="sectionRange">
section_range ='$sectionRange$'
</isNotEmpty>
<isNotEmpty prepend="AND" property="auditStatus">
<![CDATA[ audit_status=#auditStatus# ]]>
</isNotEmpty>
<isNotEmpty prepend="AND(" property="sampleStudyStatus">
<![CDATA[ sample_study_status=#sampleStudyStatus# ]]>
</isNotEmpty>
<isNotEmpty prepend="AND" property="sampleFileStatus">
<![CDATA[ sample_file_status=#sampleFileStatus# ]]>
</isNotEmpty>
<isNotEmpty prepend="AND" property="sampleTypeStart">
<![CDATA[
(repeat_num >= #sampleTypeStart#)
]]>
</isNotEmpty>
<isNotEmpty prepend="AND" property="sampleTypeEnd">
<![CDATA[
(repeat_num <= #sampleTypeEnd#)
]]>
</isNotEmpty>
<isNotEmpty prepend="AND" property="implTimeStart">
<![CDATA[
(impl_time >= #implTimeStart#)
]]>
</isNotEmpty>
<isNotEmpty prepend="AND" property="implTimeEnd">
<![CDATA[
(impl_time <= #implTimeEnd#)
]]>
</isNotEmpty>
<isNotEmpty prepend="AND" property="auditStatusEd">
<![CDATA[
(audit_status is not null)
]]>
</isNotEmpty>
</dynamic>
<![CDATA[
order by mms_id desc
limit #startIndexs#,#pageSizes#
]]>
</select>