and loc_no like '%' + #{loc_no} + '%' and matnr like '%' + #{matnr} + '%' and anfme = #{anfme} = #{begin_date} ]]> and batch like concat('%',#{batch},'%') and zpallet like concat('%',#{zpallet},'%') and specs like concat('%',#{specs},'%') = #{ymdS} ]]> and loc_no like '%' + #{loc_no} + '%' and matnr like '%' + #{matnr} + '%' and (maktx like '%' + #{maktx} + '%' or matnr like '%' + #{maktx} + '%' or lgnum like '%' + #{maktx} + '%' or tbnum like '%' + #{maktx} + '%' or tbpos like '%' + #{maktx} + '%' or zmatid like '%' + #{maktx} + '%' or maktx like '%' + #{maktx} + '%' or werks like '%' + #{maktx} + '%' or anfme like '%' + #{maktx} + '%' or altme like '%' + #{maktx} + '%' or zpallet like '%' + #{maktx} + '%' or bname like '%' + #{maktx} + '%' ) = #{begin_date} ]]> INSERT INTO asr_loc_daily_log (loc_count, area_id) SELECT COUNT(*), crn_no FROM asr_loc_mast WHERE loc_sts = 'O' GROUP BY crn_no;