SELECT DISTINCT TRANSFER_NO FROM Z_WORK_SHOP_TRANSFER
<where>
<iftest="ew!=null">
<iftest="ew.entity!=null">
<iftest="ew.entity.sfcDispatchBo!=null"> AND SFC_DISPATCH_BO=#{ew.entity.sfcDispatchBo}</if>
<iftest="ew.entity.site!=null"> AND SITE=#{ew.entity.site}</if>
<iftest="ew.entity.transferNo!=null"> AND TRANSFER_NO=#{ew.entity.transferNo}</if>
</if>
<iftest="ew!=null and ew.sqlSegment!=null and ew.nonEmptyOfWhere">
AND ${ew.sqlSegment}
</if>
</if>
</where>
<iftest="ew!=null and ew.sqlSegment!=null and ew.emptyOfWhere">
${ew.sqlSegment}
</if>
</select>
<selectid="selectPage"resultMap="BaseResultMap">
SELECT <choose><whentest="ew != null and ew.sqlSelect != null">${ew.sqlSelect}</when><otherwise><includerefid="Base_Column_List"></include></otherwise></choose> FROM Z_WORK_SHOP_TRANSFER
SELECT DISTINCT <choose><whentest="ew != null and ew.sqlSelect != null">${ew.sqlSelect}</when><otherwise><includerefid="Base_Column_List"></include></otherwise></choose> FROM Z_WORK_SHOP_TRANSFER
<where>
<iftest="ew!=null">
<iftest="ew.entity!=null">
@ -643,7 +661,7 @@
LEFT JOIN ITEM_T IT ON IT.ITEM_BO = IM.HANDLE AND IT.LOCALE = 'zh'
LEFT JOIN OPERATION PREOP ON PREOP.OPERATION = zsd.PREPOSITION_OPERATION AND PREOP.SITE = ZSD.SITE AND PREOP.CURRENT_REVISION = 'true'
LEFT JOIN OPERATION_T PREOT ON PREOT.OPERATION_BO = PREOP.HANDLE AND PREOT.LOCALE ='zh'
WHERE ZSD.SITE=#{site} AND zsd.DISPATCH_STATUS!='COMPLETE' AND zsd.DISPATCH_STATUS!='CANCEL'
WHERE ZSD.SITE=#{site} AND (zsd.DISPATCH_STATUS='RELEASE' OR zsd.DISPATCH_STATUS='NEW') AND PREZSD.DISPATCH_STATUS='COMPLETE'