<iftest='checkEnterpriseData.auditNumber != null and checkEnterpriseData.auditNumber == "1"'>
and CHECK_ENTERPRISE_DATA.AUDIT_NUMBER not IN ('1')
</if>
<iftest="checkEnterpriseData.vehicleType != null and checkEnterpriseData.vehicleType != ''">
and (VEHICLE_TYPE like '%'||#{checkEnterpriseData.vehicleType}||'%' )
</if>
<iftest="checkEnterpriseData.cccId != null and checkEnterpriseData.cccId != ''">
and (CCC_ID like '%'||#{checkEnterpriseData.cccId}||'%' or CCC_ID like upper('%'||#{checkEnterpriseData.cccId}||'%') or CCC_ID like lower('%'||#{checkEnterpriseData.cccId}||'%'))
<iftest="checkEnterpriseData.entryName != null and checkEnterpriseData.entryName != ''">
AND ENTRY_NAME like '%'||#{checkEnterpriseData.entryName}||'%'
</if>
<iftest="checkEnterpriseData.vehicleType != null and checkEnterpriseData.vehicleType != ''">
AND VEHICLE_TYPE like '%'||#{checkEnterpriseData.vehicleType}||'%'
</if>
<iftest="checkEnterpriseData.checkStatus != null and checkEnterpriseData.checkStatus != ''">
AND CHECK_RESULT = #{checkEnterpriseData.checkStatus}
</if>
<iftest="checkEnterpriseData.auditNumber != null and checkEnterpriseData.auditNumber != ''">
AND AUDIT_NUMBER = #{checkEnterpriseData.auditNumber}
</if>
<iftest="checkEnterpriseData.versionNumber != null and checkEnterpriseData.versionNumber != ''">
AND VERSION_NUMBER = #{checkEnterpriseData.versionNumber}
</if>
<iftest="checkEnterpriseData.orderBy != null and checkEnterpriseData.orderBy != '' and checkEnterpriseData.order != null and checkEnterpriseData.order != ''">
order by ${checkEnterpriseData.orderBy} ${checkEnterpriseData.order},ID
<iftest="checkModelSeriesList.editionCode != null and checkModelSeriesList.editionCode != ''">
and "EDITION_CODE" = #{checkModelSeriesList.editionCode}
and "EDITION_CODE" = #{checkModelSeriesList.editionCode}
</if>
</if>
<iftest="checkModelSeriesList.orderBy != null and checkModelSeriesList.orderBy != '' and checkModelSeriesList.order != null and checkModelSeriesList.order != ''">
<iftest="checkModelSeriesList.orderBy != null and checkModelSeriesList.orderBy != '' and checkModelSeriesList.order != null and checkModelSeriesList.order != ''">
...
@@ -137,26 +108,13 @@
...
@@ -137,26 +108,13 @@
(
(
select
select
cmsl.*,
cmsl.*,
tso.ORG_NAME,
tsucar.USERNAME as realMouldOperator
tsu.USNAME as aoperator,
tsucar.USNAME as realMouldOperator,
tsukey.USNAME as keyOperator,
tsuSCAN.USNAME as scanCodeOperator,
tsuOBD.USNAME as obdOperator,
tsuSTAND.USNAME as standOperator
FROM
FROM
CHECK_MODEL_SERIES_LIST cmsl
NERDS.CHECK_MODEL_SERIES_LIST cmsl
LEFT JOIN TS_ORG tso ON tso.ID = cmsl.BASE
left join RETRIEVAL.RET_USERS tsucar on tsucar.ID = cmsl.CAR_OPERATOR
left join TS_USER tsu on tsu.USID = cmsl.OPERATOR
left join TS_USER tsucar on tsucar.USID = cmsl.CAR_OPERATOR
left join TS_USER tsuSCAN on tsuSCAN.USID = cmsl.SCAN_CODE_OPERATOR
left join TS_USER tsuOBD on tsuOBD.USID = cmsl.OBD_OPERATOR
left join TS_USER tsukey on tsukey.USID = cmsl.KEY_OPERATOR
left join TS_USER tsuSTAND on tsuSTAND.USID = cmsl.STAND_OPERATOR
where
where
cmsl.EDITION_CODE > '1'
cmsl.EDITION_CODE > '1'
AND (( (OBD_STATUS != '0' OR OBD_STATUS IS NULL) OR (STAND_STATUS != '0' OR STAND_STATUS IS NULL) OR (SCAN_CODE_STATUS != '0' OR SCAN_CODE_STATUS IS NULL)
AND ((REAL_MOULD_STATUS != '0' OR REAL_MOULD_STATUS IS NULL) AND cmsl.IS_CHECK_OK IS NULL)
OR (KEY_STATUS != '0' OR KEY_STATUS IS NULL) OR (REAL_MOULD_STATUS != '0' OR REAL_MOULD_STATUS IS NULL) ) AND cmsl.IS_CHECK_OK IS NULL)
and VEHICLE_SERIES like '%'||#{checkModelSeriesList.vehicleSeries}||'%'
and VEHICLE_SERIES like '%'||#{checkModelSeriesList.vehicleSeries}||'%'
</if>
</if>
<iftest='checkModelSeriesList.type != null and checkModelSeriesList.type != "2"'>
<iftest='checkModelSeriesList.type != null and checkModelSeriesList.type != "2"'>
AND (OBD_STATUS = #{checkModelSeriesList.type} OR SCAN_CODE_STATUS = #{checkModelSeriesList.type} OR REAL_MOULD_STATUS = #{checkModelSeriesList.type}
AND REAL_MOULD_STATUS = #{checkModelSeriesList.type}
OR STAND_STATUS = #{checkModelSeriesList.type} OR KEY_STATUS = #{checkModelSeriesList.type})
</if>
</if>
<iftest='checkModelSeriesList.type == "2"'>
<iftest='checkModelSeriesList.type == "2"'>
AND (OBD_STATUS IS NULL
AND REAL_MOULD_STATUS IS NULL
OR SCAN_CODE_STATUS IS NULL
OR REAL_MOULD_STATUS IS NULL
OR STAND_STATUS IS NULL
OR KEY_STATUS IS NULL)
</if>
</if>
<iftest="checkModelSeriesList.orderBy != null and checkModelSeriesList.orderBy != '' and checkModelSeriesList.order != null and checkModelSeriesList.order != ''">
<iftest="checkModelSeriesList.orderBy != null and checkModelSeriesList.orderBy != '' and checkModelSeriesList.order != null and checkModelSeriesList.order != ''">
order by ${checkModelSeriesList.orderBy} ${checkModelSeriesList.order}, "TYPE" desc, CREATE_TIME DESC, VEHICLE_TYPE_AND_GROUP DESC
order by ${checkModelSeriesList.orderBy} ${checkModelSeriesList.order}, "TYPE" desc, CREATE_TIME DESC, VEHICLE_TYPE_AND_GROUP DESC