| | |
| | | <if test="specs!=null and specs!='' "> |
| | | and a.specs like '%' + #{specs} + '%' |
| | | </if> |
| | | <if test="standby1!=null and standby1!='' "> |
| | | and a.standby1 like '%' + #{standby1} + '%' |
| | | </if> |
| | | </sql> |
| | | |
| | | <select id="getStockOutPage" resultMap="BaseResultMap"> |
| | |
| | | <update id="frozenInventory"> |
| | | update asr_loc_detl set frozen = #{frozen} where loc_no = #{locNo} and matnr = #{matnr} and batch = #{batch} |
| | | </update> |
| | | <update id="updateDangerByLocNo"> |
| | | UPDATE d |
| | | SET danger = CASE |
| | | WHEN t.cnt = 1 THEN 1 |
| | | ELSE 2 |
| | | END |
| | | FROM asr_loc_detl d |
| | | JOIN ( |
| | | SELECT loc_no, COUNT(DISTINCT standby1) AS cnt |
| | | FROM asr_loc_detl |
| | | WHERE loc_no = #{locNo} |
| | | GROUP BY loc_no |
| | | ) t ON d.loc_no = t.loc_no |
| | | </update> |
| | | |
| | | <select id="selectSameDetlTodayBatch" resultType="java.lang.String"> |
| | | SELECT ld.loc_no FROM asr_loc_detl ld |
| | |
| | | group by a.matnr,a.batch |
| | | ) t where t.row between ((#{pageNumber}-1)*#{pageSize}+1) and (#{pageNumber}*#{pageSize}) |
| | | </select> |
| | | <select id="getStockList" resultType="com.zy.asrs.entity.LocDetl"> |
| | | select |
| | | * |
| | | from |
| | | ( |
| | | SELECT |
| | | ROW_NUMBER() over ( |
| | | order by m.matnr desc) as row, |
| | | m.matnr, |
| | | m.maktx , |
| | | m.store_min boxType1, |
| | | m.store_max boxType2, |
| | | ISNULL(SUM(d.anfme), |
| | | 0) AS anfme |
| | | FROM |
| | | man_mat m |
| | | LEFT JOIN asr_loc_detl d |
| | | ON |
| | | m.matnr = d.matnr |
| | | WHERE |
| | | m.store_min IS NOT NULL |
| | | OR m.store_max IS NOT NULL |
| | | <if test="matnr!=null and matnr!='' "> |
| | | and m.matnr like '%' + #{matnr} + '%' |
| | | </if> |
| | | <if test="maktx!=null and maktx!='' "> |
| | | and m.maktx like '%' + #{maktx} + '%' |
| | | </if> |
| | | GROUP BY |
| | | m.matnr, |
| | | m.maktx , |
| | | m.store_min, |
| | | m.store_max |
| | | HAVING |
| | | ISNULL(SUM(d.anfme),0) < m.store_min OR ISNULL(SUM(d.anfme),0) > m.store_max |
| | | ) t where t.row between ((#{pageNumber}-1)*#{pageSize}+1) and (#{pageNumber}*#{pageSize}) |
| | | </select> |
| | | <select id="getStockListCount" resultType="java.lang.Long"> |
| | | select |
| | | count(*) |
| | | from |
| | | ( |
| | | SELECT |
| | | ROW_NUMBER() over ( |
| | | order by m.matnr desc) as row, |
| | | m.matnr, |
| | | m.maktx , |
| | | m.store_min boxType1, |
| | | m.store_max boxType2, |
| | | ISNULL(SUM(d.anfme), |
| | | 0) AS anfme |
| | | FROM |
| | | man_mat m |
| | | LEFT JOIN asr_loc_detl d |
| | | ON |
| | | m.matnr = d.matnr |
| | | WHERE |
| | | m.store_min IS NOT NULL |
| | | OR m.store_max IS NOT NULL |
| | | <if test="matnr!=null and matnr!='' "> |
| | | and m.matnr like '%' + #{matnr} + '%' |
| | | </if> |
| | | <if test="maktx!=null and maktx!='' "> |
| | | and m.maktx like '%' + #{maktx} + '%' |
| | | </if> |
| | | GROUP BY |
| | | m.matnr, |
| | | m.maktx , |
| | | m.store_min, |
| | | m.store_max |
| | | HAVING |
| | | ISNULL(SUM(d.anfme),0) < m.store_min OR ISNULL(SUM(d.anfme),0) > m.store_max |
| | | ) t |
| | | </select> |
| | | |
| | | </mapper> |