| | |
| | | select |
| | | a.matnr |
| | | , sum(a.anfme) as anfme |
| | | from asr_loc_detl a |
| | | from wms_loc_detl a |
| | | where 1=1 |
| | | <include refid="stockOutCondition"></include> |
| | | group by a.matnr |
| | | </select> |
| | | |
| | | <select id="sum" resultType="java.lang.Integer"> |
| | | SELECT SUM(anfme) FROM asr_loc_detl |
| | | SELECT SUM(anfme) FROM wms_loc_detl |
| | | </select> |
| | | |
| | | <select id="queryStock" resultType="com.zy.asrs.common.wms.entity.LocDetl"> |
| | | select |
| | | a.* |
| | | from wms_loc_detl a |
| | | left join wms_loc_mast b on a.loc_no = b.loc_no |
| | | where 1=1 |
| | | <if test="no!=null and no == 1"> |
| | | and b.row1 >= 31 |
| | | and b.row1 <= 32 |
| | | </if> |
| | | <if test="no!=null and no == 2"> |
| | | and b.row1 >= 2 |
| | | and b.row1 <= 17 |
| | | </if> |
| | | <if test="no!=null and no == 3"> |
| | | and b.row1 >= 18 |
| | | and b.row1 <= 30 |
| | | </if> |
| | | and a.matnr = #{matnr} |
| | | and b.bay1 = #{bay} |
| | | and b.loc_sts = 'F' |
| | | order by b.row1 |
| | | <if test="orderBy != null and orderBy != '' and orderBy == 'false'"> |
| | | desc |
| | | </if> |
| | | </select> |
| | | |
| | | <select id="queryStockPre" resultType="com.zy.asrs.common.domain.dto.QueryStockPreDo"> |
| | | select |
| | | * |
| | | from |
| | | ( |
| | | select |
| | | no = 1, |
| | | orderBy = 'true', |
| | | b.bay1 as bay, |
| | | sum(anfme) as count |
| | | from wms_loc_detl a |
| | | left join wms_loc_mast b on a.loc_no = b.loc_no |
| | | where 1=1 |
| | | and b.loc_sts = 'F' |
| | | and a.matnr = #{matnr} |
| | | and b.row1 >= 31 |
| | | and b.row1 <= 32 |
| | | group by b.bay1 |
| | | union |
| | | select |
| | | no = 2, |
| | | orderBy = 'true', |
| | | b.bay1 as bay, |
| | | sum(anfme) as count |
| | | from wms_loc_detl a |
| | | left join wms_loc_mast b on a.loc_no = b.loc_no |
| | | where 1=1 |
| | | and b.loc_sts = 'F' |
| | | and a.matnr = #{matnr} |
| | | and b.row1 >= 2 |
| | | and b.row1 <= 17 |
| | | group by b.bay1 |
| | | union |
| | | select |
| | | no = 3, |
| | | orderBy = 'false', |
| | | b.bay1 as bay, |
| | | sum(anfme) as count |
| | | from wms_loc_detl a |
| | | left join wms_loc_mast b on a.loc_no = b.loc_no |
| | | where 1=1 |
| | | and b.loc_sts = 'F' |
| | | and a.matnr = #{matnr} |
| | | and b.row1 >= 18 |
| | | and b.row1 <= 30 |
| | | group by b.bay1 |
| | | ) a |
| | | order by no, count desc |
| | | </select> |
| | | |
| | | </mapper> |