| | |
| | | StringBuilder sbReplenish=new StringBuilder(); |
| | | sbReplenish.append(" SELECT T1.id,T1.uuid,T1.created_by,T1.applicant,T1.replenish_date,T1.reason,"); |
| | | sbReplenish.append(" SUBSTRING_INDEX( SUBSTRING_INDEX( T1.replacement_card_type, ',', T2.digit + 1 ), ',',- 1 ) AS type "); |
| | | sbReplenish.append(" FROM product_oa_replenish_punch T1 "); |
| | | sbReplenish.append(" FROM (select * from product_oa_replenish_punch where flow_flag=2) T1 "); |
| | | sbReplenish.append(" JOIN ( SELECT 0 AS digit UNION ALL SELECT 1 UNION ALL SELECT 2 UNION ALL SELECT 3 ) T2"); |
| | | sbReplenish.append(" ON T2.digit < ( length( T1.replacement_card_type )- length( REPLACE ( T1.replacement_card_type, ',', '' ))+ 1 )"); |
| | | sbReplenish.append(" where t1.created_by=? "); |