| | |
| | | FROM |
| | | ( |
| | | SELECT |
| | | loc_no, |
| | | DISTINCT loc_no, |
| | | locd.matnr, |
| | | locd.maktx, |
| | | locd.owner, |
| | | locd.batch, |
| | | create_time, |
| | | locd.specs, |
| | | locd.unit, |
| | | inventory_max, |
| | | inventory_min, |
| | | inventory_age_max, |
| | | count_anfme, |
| | | DATEDIFF( DAY, create_time, GETDATE( ) ) AS [diff_time] |
| | | FROM |
| | | man_loc_detl locd |
| | |
| | | count_anfme |
| | | FROM |
| | | man_mat |
| | | RIGHT JOIN ( SELECT matnr, SUM ( anfme ) AS count_anfme FROM man_loc_detl loc GROUP BY matnr ) aa ON aa.matnr = man_mat.matnr |
| | | RIGHT JOIN ( SELECT matnr,batch,owner, SUM ( anfme ) AS count_anfme FROM man_loc_detl loc GROUP BY matnr,batch,owner ) aa ON aa.matnr = man_mat.matnr |
| | | ) warn ON locd.matnr = warn.matnr |
| | | WHERE |
| | | DATEDIFF( DAY, create_time, GETDATE( ) ) > inventory_age_max |
| | |
| | | where 1=1 |
| | | and b.loc_sts = 'F' |
| | | and a.matnr = #{matnr} |
| | | <if test="batch != null || batch != ''"> |
| | | and a.batch = #{batch} |
| | | </if> |
| | | |
| | | </select> |
| | | <delete id="deleteDatailed"> |
| | |
| | | where 1=1 |
| | | and loc_no = #{locNo} |
| | | and matnr = #{matnr} |
| | | <if test="batch != null || batch != ''"> |
| | | and batch = #{batch} |
| | | </if> |
| | | <!-- <choose>--> |
| | | <!-- <when test="batch != null and batch!='' ">--> |
| | | <!-- and batch = #{batch}--> |