| | |
| | | update asr_loc_detl |
| | | set anfme = #{anfme} |
| | | , modi_time = getdate() |
| | | , manu = #{manu} |
| | | , memo = #{memo} |
| | | where 1=1 |
| | | and loc_no = #{locNo} |
| | | and matnr = #{matnr} |
| | |
| | | <if test="maktx!=null and maktx!='' "> |
| | | and a.maktx like '%' + #{maktx} + '%' |
| | | </if> |
| | | <if test="specs!=null and specs!='' "> |
| | | and a.specs like '%' + #{specs} + '%' |
| | | </if> |
| | | <if test="anfme!=null and anfme!='' "> |
| | | and a.anfme like '%' + #{anfme} + '%' |
| | | </if> |
| | | <if test="zpallet!=null and zpallet!='' "> |
| | | and a.zpallet like '%' + #{zpallet} + '%' |
| | | </if> |
| | | <if test="manu!=null and manu!='' "> |
| | | and a.manu like '%' + #{manu} + '%' |
| | | </if> |
| | | <if test="batch!=null and batch!='' "> |
| | | and a.batch like '%' + #{batch} + '%' |
| | | </if> |
| | | <if test="startTime!=null and endTime!=null"> |
| | | and a.modi_time between #{startTime} and #{endTime} |
| | | </if> |
| | | <if test="locType2!=null and locType2!='' "> |
| | | and b.loc_type2 = #{locType2} |
| | | </if> |
| | | </sql> |
| | | |
| | |
| | | select * from |
| | | ( |
| | | select |
| | | ROW_NUMBER() over (order by a.appe_time,a.matnr,a.loc_no) as row, |
| | | ROW_NUMBER() over (order by a.loc_no,a.appe_time,a.matnr) as row, |
| | | a.* |
| | | from asr_loc_detl a |
| | | left join asr_loc_mast b on a.loc_no = b.loc_no |
| | |
| | | ) t where t.row between ((#{pageNumber}-1)*#{pageSize}+1) and (#{pageNumber}*#{pageSize}) |
| | | </select> |
| | | |
| | | <select id="getStockStatisOut" 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 |
| | | left join man_mat m |
| | | on m.matnr = a.matnr |
| | | where 1=1 |
| | | <include refid="stockOutCondition"></include> |
| | | <if test="matType !=null and matType !='' "> |
| | | and m.mat_type = #{matType} |
| | | </if> |
| | | 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 |
| | | ( |
| | |
| | | <include refid="stockOutCondition"></include> |
| | | group by a.matnr |
| | | ) b |
| | | </select> |
| | | |
| | | <select id="getStockStatisOutCount" parameterType="java.util.Map" resultType="java.lang.Integer"> |
| | | select count(1) as count from |
| | | ( |
| | | select |
| | | a.matnr |
| | | from asr_loc_detl a |
| | | left join man_mat m |
| | | on m.matnr = a.matnr |
| | | where 1=1 |
| | | <include refid="stockOutCondition"></include> |
| | | <if test="matType !=null and matType !='' "> |
| | | and m.mat_type = #{matType} |
| | | </if> |
| | | group by a.matnr |
| | | ) b |
| | | </select> |
| | | |
| | | <select id="getStockStatisExcel" resultType="com.zy.asrs.entity.LocDetl"> |
| | |
| | | where 1=1 |
| | | and b.loc_sts = 'F' and b.frozen != 1 |
| | | and a.matnr = #{matnr} |
| | | <choose> |
| | | <when test="batch != null and batch != ''"> |
| | | and a.batch = #{batch} |
| | | </when> |
| | | <otherwise> |
| | | and (a.batch IS NULL OR a.batch = '') |
| | | </otherwise> |
| | | </choose> |
| | | and b.row1 >= 1 |
| | | and b.row1 <= 3 |
| | | group by b.bay1 |
| | |
| | | where 1=1 |
| | | and b.loc_sts = 'F' and b.frozen != 1 |
| | | and a.matnr = #{matnr} |
| | | <choose> |
| | | <when test="batch != null and batch != ''"> |
| | | and a.batch = #{batch} |
| | | </when> |
| | | <otherwise> |
| | | and (a.batch IS NULL OR a.batch = '') |
| | | </otherwise> |
| | | </choose> |
| | | and b.row1 >= 4 |
| | | and b.row1 <= 7 |
| | | group by b.bay1 |
| | |
| | | where 1=1 |
| | | and b.loc_sts = 'F' and b.frozen != 1 |
| | | and a.matnr = #{matnr} |
| | | <choose> |
| | | <when test="batch != null and batch != ''"> |
| | | and a.batch = #{batch} |
| | | </when> |
| | | <otherwise> |
| | | and (a.batch IS NULL OR a.batch = '') |
| | | </otherwise> |
| | | </choose> |
| | | and b.row1 >= 8 |
| | | and b.row1 <= 11 |
| | | group by b.bay1 |
| | |
| | | where 1=1 |
| | | and b.loc_sts = 'F' and b.frozen != 1 |
| | | and a.matnr = #{matnr} |
| | | <choose> |
| | | <when test="batch != null and batch != ''"> |
| | | and a.batch = #{batch} |
| | | </when> |
| | | <otherwise> |
| | | and (a.batch IS NULL OR a.batch = '') |
| | | </otherwise> |
| | | </choose> |
| | | and b.row1 >= 12 |
| | | and b.row1 <= 14 |
| | | group by b.bay1 |
| | |
| | | where 1=1 |
| | | and b.loc_sts = 'F' and b.frozen != 1 |
| | | and a.matnr = #{matnr} |
| | | <choose> |
| | | <when test="batch != null and batch != ''"> |
| | | and a.batch = #{batch} |
| | | </when> |
| | | <otherwise> |
| | | and (a.batch IS NULL OR a.batch = '') |
| | | </otherwise> |
| | | </choose> |
| | | and b.row1 >= 15 |
| | | and b.row1 <= 18 |
| | | group by b.bay1 |
| | |
| | | where 1=1 |
| | | and b.loc_sts = 'F' and b.frozen != 1 |
| | | and a.matnr = #{matnr} |
| | | <choose> |
| | | <when test="batch != null and batch != ''"> |
| | | and a.batch = #{batch} |
| | | </when> |
| | | <otherwise> |
| | | and (a.batch IS NULL OR a.batch = '') |
| | | </otherwise> |
| | | </choose> |
| | | and b.row1 >= 19 |
| | | and b.row1 <= 21 |
| | | group by b.bay1 |
| | |
| | | </if> |
| | | ) |
| | | and a.matnr = #{matnr} |
| | | <choose> |
| | | <when test="batch != null and batch != ''"> |
| | | and a.batch = #{batch} |
| | | </when> |
| | | <otherwise> |
| | | and (a.batch IS NULL OR a.batch = '') |
| | | </otherwise> |
| | | </choose> |
| | | and b.bay1 = #{bay} |
| | | and b.loc_sts = 'F' |
| | | and b.loc_sts = 'F' and b.frozen != 1 |
| | | order by b.row1 |
| | | <if test="orderBy != null and orderBy != '' and orderBy == 'false'"> |
| | | desc |
| | |
| | | ) dual on dual.loc_no = lm.loc_no |
| | | WHERE 1 = 1 |
| | | AND ld.matnr = #{matnr} |
| | | AND (lm.row1 >= #{start} AND lm.row1 <= #{end}) |
| | | AND loc_type2 = 1 |
| | | AND (lm.loc_sts = 'F') |
| | | AND dual.count = 1 |
| | | ORDER BY lm.modi_time ASC |
| | |
| | | SELECT * FROM [dbo].[asr_loc_detl_group] WHERE 1 = 1 |
| | | <include refid="groupListCondition"></include> |
| | | </select> |
| | | |
| | | <select id="selectByLocNo" resultMap="BaseResultMap"> |
| | | SELECT * FROM asr_loc_detl WHERE loc_no = #{locNo} |
| | | </select> |
| | | |
| | | <select id="selectByLocNosAndMatnr" resultMap="BaseResultMap"> |
| | | SELECT * FROM asr_loc_detl WHERE loc_no in |
| | | <foreach item="item" collection="locNos" index="index" separator="," open="(" close=")"> |
| | | #{item} |
| | | </foreach> |
| | | and matnr = #{matnr} |
| | | </select> |
| | | |
| | | <select id="searchByLike" resultMap="BaseResultMap"> |
| | | select * |
| | | from asr_loc_detl |
| | | where |
| | | 1 = 1 |
| | | <if test="orderNo != null and orderNo != ''"> |
| | | and order_no like '%' + #{orderNo} + '%' |
| | | </if> |
| | | <if test="locNo != null and locNo != ''"> |
| | | and loc_no like '%' + #{locNo} + '%' |
| | | </if> |
| | | <if test="specs != null and specs != ''"> |
| | | and specs like '%' + #{specs} + '%' |
| | | </if> |
| | | <if test="matnr != null and matnr != ''"> |
| | | and matnr like '%' + #{matnr} + '%' |
| | | </if> |
| | | <if test="maktx != null and maktx != ''"> |
| | | and maktx like '%' + #{maktx} + '%'; |
| | | </if> |
| | | </select> |
| | | |
| | | <select id="findAreaByMatnr" resultMap="BaseResultMap"> |
| | | select * from asr_loc_detl ld |
| | | left join asr_loc_mast lm |
| | | on lm.loc_no = ld.loc_no |
| | | where matnr = #{matnr} |
| | | and loc_type2 = #{locType2} |
| | | and loc_sts = 'F' |
| | | order by row1,bay1,lev1,ld.appe_time |
| | | </select> |
| | | |
| | | </mapper> |