| | |
| | | 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 asr_loc_detl a |
| | | left join asr_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 = 2, |
| | | no = 3, |
| | | orderBy = 'false', |
| | | b.bay1, |
| | | b.bay1 as bay, |
| | | sum(anfme) as count |
| | | from asr_loc_detl a |
| | | left join asr_loc_mast b on a.loc_no = b.loc_no |
| | |
| | | and b.row1 <= 30 |
| | | group by b.bay1 |
| | | ) a |
| | | order by count desc |
| | | order by no, count desc |
| | | </select> |
| | | |
| | | <select id="queryStock" resultMap="BaseResultMap"> |
| | |
| | | left join asr_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 == 2"> |
| | | <if test="no!=null and no == 3"> |
| | | and b.row1 >= 18 |
| | | and b.row1 <= 30 |
| | | </if> |