SUBSTR(LISTAGG(NCT.DESCRIPTION || ',') WITHIN GROUP(ORDER BY ZAB.ABNORMAL_NO),0,LENGTH(LISTAGG(NCT.DESCRIPTION || ',') WITHIN GROUP(ORDER BY ZAB.ABNORMAL_NO))-1) NC_CODE_DESCRIPTION
LEFT JOIN ITEM_T it ON i.HANDLE = it.ITEM_BO AND it.LOCALE = #{language}
FROM Z_ABNORMAL_BILL ZAB
LEFT JOIN ITEM I ON ZAB.ITEM_BO = I.HANDLE
LEFT JOIN ITEM_T IT ON I.HANDLE = IT.ITEM_BO AND IT.LOCALE = #{language}
LEFT JOIN Z_ABNORMAL_NC_CODE ZANC ON ZANC.ABNORMAL_BILL_BO = ZAB.HANDLE
LEFT JOIN NC_CODE_T NCT ON NCT.NC_CODE_BO = 'NCCodeBO:'|| ZAB.SITE || ',' || ZANC.NC_CODE AND NCT.LOCALE = #{language}
<where>
<where>
<iftest="abnormalBill != null">
<iftest="abnormalBill != null">
<iftest="abnormalBill.site != null and abnormalBill.site != ''">
<iftest="abnormalBill.site != null and abnormalBill.site != ''">
@ -916,6 +921,8 @@
</if>
</if>
</if>
</if>
</where>
</where>
GROUP BY zab.ABNORMAL_NO,zab.STATUS,it.DESCRIPTION,zab.CREATED_DATE_TIME,zab.RESPONSE_DATE_TIME,