and d.batch = #{batch} and (d.batch IS NULL OR d.batch = '') and d.brand = #{brand} and (d.brand IS NULL OR d.brand = '') and d.standby1 = #{standby1} and (d.standby1 IS NULL OR d.standby1 = '') and d.standby2 = #{standby2} and (d.standby2 IS NULL OR d.standby2 = '') and d.standby3 = #{standby3} and (d.standby3 IS NULL OR d.standby3 = '') and d.box_type1 = #{boxType1} and (d.box_type1 IS NULL OR d.box_type1 = '') and d.box_type2 = #{boxType2} and (d.box_type2 IS NULL OR d.box_type2 = '') and d.box_type3 = #{boxType3} and (d.box_type3 IS NULL OR d.box_type3 = '') and a.batch = #{batch} and (a.batch IS NULL OR a.batch = '') and a.brand = #{brand} and (a.brand IS NULL OR a.brand = '') and a.standby1 = #{standby1} and (a.standby1 IS NULL OR a.standby1 = '') and a.standby2 = #{standby2} and (a.standby2 IS NULL OR a.standby2 = '') and a.standby3 = #{standby3} and (a.standby3 IS NULL OR a.standby3 = '') and a.box_type1 = #{boxType1} and (a.box_type1 IS NULL OR a.box_type1 = '') and a.box_type2 = #{boxType2} and (a.box_type2 IS NULL OR a.box_type2 = '') and a.box_type3 = #{boxType3} and (a.box_type3 IS NULL OR a.box_type3 = '') and batch = #{batch} and (batch IS NULL OR batch = '') and brand = #{brand} and (brand IS NULL OR brand = '') and standby1 = #{standby1} and (standby1 IS NULL OR standby1 = '') and standby2 = #{standby2} and (standby2 IS NULL OR standby2 = '') and standby3 = #{standby3} and (standby3 IS NULL OR standby3 = '') and box_type1 = #{boxType1} and (box_type1 IS NULL OR box_type1 = '') and box_type2 = #{boxType2} and (box_type2 IS NULL OR box_type2 = '') and box_type3 = #{boxType3} and (box_type3 IS NULL OR box_type3 = '') and t.loc_no like '%' + #{locNo} + '%' and t.matnr like '%' + #{matnr} + '%' and t.owner = #{owner} and t.payment = #{payment} delete from asr_loc_detl where 1=1 and loc_no = #{locNo} and matnr = #{matnr} update asr_loc_detl set anfme = #{anfme} , modi_time = getdate() where 1=1 and loc_no = #{locNo} and matnr = #{matnr} and a.loc_no like '%' + #{loc_no} + '%' and a.matnr like '%' + #{matnr} + '%' and a.maktx like '%' + #{maktx} + '%' and a.anfme like '%' + #{anfme} + '%' and a.modi_time between #{startTime} and #{endTime} and b.crn_no=#{crnNo} and a.batch like '%' + #{batch} + '%' and a.specs like '%' + #{specs} + '%' UPDATE a SET a.matnr=b.matnr, a.specs=b.specs, a.maktx=b.maktx, a.unit=b.unit FROM asr_loc_detl a INNER JOIN man_mat b ON a.matnr=#{matnrOld} AND b.matnr=#{matnr}; update asr_loc_detl set frozen = 1 where loc_no = #{locNo} and frozen = 0 update asr_loc_detl set frozen = #{frozen} where loc_no = #{locNo} and matnr = #{matnr} and batch = #{batch}