| | |
| | | <include refid="batchSeq"></include> |
| | | </select> |
| | | |
| | | <select id="selectItem2" resultMap="BaseResultMap"> |
| | | select top 1 * |
| | | from asr_loc_detl |
| | | where 1=1 |
| | | and loc_no = #{locNo} |
| | | and matnr = #{matnr} |
| | | <choose> |
| | | <when test="threeCode != null"> |
| | | and three_code = #{threeCode} |
| | | </when> |
| | | <otherwise> |
| | | and (three_code IS NULL) |
| | | </otherwise> |
| | | </choose> |
| | | <choose> |
| | | <when test="bomCode != null"> |
| | | and bom_code = #{bomCode} |
| | | </when> |
| | | <otherwise> |
| | | and (bom_code IS NULL) |
| | | </otherwise> |
| | | </choose> |
| | | <include refid="batchSeq"></include> |
| | | </select> |
| | | |
| | | <delete id="deleteItem2"> |
| | | delete from asr_loc_detl |
| | | where 1=1 |
| | | and loc_no = #{locNo} |
| | | and matnr = #{matnr} |
| | | <choose> |
| | | <when test="threeCode != null"> |
| | | and three_code = #{threeCode} |
| | | </when> |
| | | <otherwise> |
| | | and (three_code IS NULL) |
| | | </otherwise> |
| | | </choose> |
| | | <choose> |
| | | <when test="bomCode != null"> |
| | | and bom_code = #{bomCode} |
| | | </when> |
| | | <otherwise> |
| | | and (bom_code IS NULL) |
| | | </otherwise> |
| | | </choose> |
| | | <include refid="batchSeq"></include> |
| | | </delete> |
| | | |
| | | <delete id="deleteItem"> |
| | | delete from asr_loc_detl |
| | | where 1=1 |
| | |
| | | where 1=1 |
| | | and loc_no = #{locNo} |
| | | and matnr = #{matnr} |
| | | <include refid="batchSeq"></include> |
| | | </update> |
| | | |
| | | <update id="updateAnfme2"> |
| | | update asr_loc_detl |
| | | set anfme = #{anfme} |
| | | , modi_time = getdate() |
| | | where 1=1 |
| | | and loc_no = #{locNo} |
| | | and matnr = #{matnr} |
| | | <choose> |
| | | <when test="threeCode != null"> |
| | | and three_code = #{threeCode} |
| | | </when> |
| | | <otherwise> |
| | | and (three_code IS NULL) |
| | | </otherwise> |
| | | </choose> |
| | | <choose> |
| | | <when test="bomCode != null"> |
| | | and bom_code = #{bomCode} |
| | | </when> |
| | | <otherwise> |
| | | and (bom_code IS NULL) |
| | | </otherwise> |
| | | </choose> |
| | | <include refid="batchSeq"></include> |
| | | </update> |
| | | |
| | |
| | | </if> |
| | | <if test="bomCode!=null and bomCode!='' "> |
| | | and a.bom_code like '%' + #{bomCode} + '%' |
| | | </if> |
| | | <if test="threeCode!=null and threeCode!='' "> |
| | | and a.three_code like '%' + #{threeCode} + '%' |
| | | </if> |
| | | <if test="orderNo!=null and orderNo!='' "> |
| | | and a.order_no like '%' + #{orderNo} + '%' |
| | | </if> |
| | | </sql> |
| | | |
| | |
| | | select |
| | | ROW_NUMBER() over (order by sum(a.anfme) desc) as row |
| | | , a.matnr |
| | | , min(a.maktx) as maktx |
| | | , min(a.specs) as specs |
| | | , sum(a.anfme) as anfme |
| | | from asr_loc_detl a |
| | | where 1=1 |
| | |
| | | <!-- and (a.batch IS NULL OR a.batch = '')--> |
| | | <!-- </otherwise>--> |
| | | <!-- </choose>--> |
| | | <if test="batch != null"> |
| | | <if test="batch != null and batch != ''"> |
| | | and a.batch = #{batch} |
| | | </if> |
| | | <if test="orderNo != null and orderNo != ''"> |
| | |
| | | </if> |
| | | |
| | | order by |
| | | DATEPART(yyyy,a.modi_time),DATEPART(mm,a.modi_time),DATEPART(dd,a.modi_time), a.anfme |
| | | DATEPART(yyyy,a.appe_time),DATEPART(mm,a.appe_time),DATEPART(dd,a.appe_time), a.anfme |
| | | desc, |
| | | NEWID(), |
| | | case |
| | |
| | | #{item} |
| | | </foreach> |
| | | </if> |
| | | and a.bom_code = #{bomCode} |
| | | <if test="bomCode != null and bomCode != ''"> |
| | | and a.bom_code = #{bomCode} |
| | | </if> |
| | | order by |
| | | DATEPART(yyyy,a.modi_time),DATEPART(mm,a.modi_time),DATEPART(dd,a.modi_time), a.anfme |
| | | DATEPART(yyyy,a.appe_time),DATEPART(mm,a.appe_time),DATEPART(dd,a.appe_time), a.anfme |
| | | desc, |
| | | NEWID(), |
| | | case |