| | |
| | | and b.loc_sts = 'F' |
| | | <include refid="stockOutCondition"></include> |
| | | </select> |
| | | |
| | | <select id="getStockStatis" resultType="com.zy.asrs.entity.LocDetl"> |
| | | select * from |
| | | ( |
| | | select |
| | | ROW_NUMBER() over (order by sum(a.anfme) desc) as row |
| | | , a.matnr |
| | | , sum(a.anfme) as anfme |
| | | from asr_loc_detl a |
| | | where 1=1 |
| | | <include refid="stockOutCondition"></include> |
| | | group by a.matnr |
| | | ) t where t.row between ((#{pageNumber}-1)*#{pageSize}+1) and (#{pageNumber}*#{pageSize}) |
| | | </select> |
| | | |
| | | <select id="getStockStatisCount" parameterType="java.util.Map" resultType="java.lang.Integer"> |
| | | select count(1) as count from |
| | | ( |
| | | select |
| | | a.matnr |
| | | from asr_loc_detl a |
| | | where 1=1 |
| | | <include refid="stockOutCondition"></include> |
| | | group by a.matnr |
| | | ) b |
| | | </select> |
| | | |
| | | <select id="getStockStatisExcel" resultType="com.zy.asrs.entity.LocDetl"> |
| | | select |
| | | ROW_NUMBER() over (order by sum(a.anfme) desc) as row |
| | | , a.matnr |
| | | , sum(a.anfme) as anfme |
| | | from asr_loc_detl a |
| | | where 1=1 |
| | | group by a.matnr |
| | | </select> |
| | | |
| | | <select id="selectPakoutByRule" resultMap="BaseResultMap"> |
| | | select * from asr_loc_detl |
| | | where 1=1 |
| | | and matnr = #{matnr} |
| | | order by |
| | | DATEPART(yyyy,modi_time),DATEPART(mm,modi_time),DATEPART(dd,modi_time) |
| | | desc, |
| | | case |
| | | when (left(loc_no, 2) = '01') then 0 |
| | | when (left(loc_no, 2) = '02') then 1 |
| | | when (left(loc_no, 2) = '03') then 1 |
| | | when (left(loc_no, 2) = '04') then 0 |
| | | when (left(loc_no, 2) = '05') then 0 |
| | | when (left(loc_no, 2) = '06') then 1 |
| | | when (left(loc_no, 2) = '07') then 1 |
| | | when (left(loc_no, 2) = '08') then 0 |
| | | else 0 |
| | | end |
| | | desc |
| | | </select> |
| | | |
| | | </mapper> |