You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
401 lines
18 KiB
XML
401 lines
18 KiB
XML
<?xml version="1.0" encoding="UTF-8"?>
|
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
|
<mapper namespace="com.foreverwin.mesnac.dispatch.mapper.IssueItemMapper">
|
|
|
|
<!-- 通用查询映射结果 -->
|
|
<resultMap id="BaseResultMap" type="com.foreverwin.mesnac.dispatch.model.IssueItem">
|
|
<result column="HANDLE" property="handle"/>
|
|
<result column="SITE" property="site"/>
|
|
<result column="ITEM" property="item"/>
|
|
<result column="INVENTORY" property="inventory"/>
|
|
<result column="QTY" property="qty"/>
|
|
<result column="CREATE_USER" property="createUser"/>
|
|
<result column="CREATED_DATE_TIME" property="createdDateTime"/>
|
|
<result column="MODIFY_USER" property="modifyUser"/>
|
|
<result column="MODIFIED_DATE_TIME" property="modifiedDateTime"/>
|
|
</resultMap>
|
|
|
|
<!-- 通用查询结果列 -->
|
|
<sql id="Base_Column_List">
|
|
HANDLE, SITE, ITEM, INVENTORY, QTY, CREATE_USER, CREATED_DATE_TIME, MODIFY_USER, MODIFIED_DATE_TIME
|
|
</sql>
|
|
|
|
<!-- BaseMapper标准查询/修改/删除 -->
|
|
|
|
<select id="selectByMap" resultMap="BaseResultMap">
|
|
SELECT
|
|
<include refid="Base_Column_List"></include>
|
|
FROM Z_ISSUE_ITEM
|
|
<if test="cm!=null and !cm.isEmpty">
|
|
<where>
|
|
<foreach collection="cm.keys" item="k" separator="AND">
|
|
<if test="cm[k] != null">
|
|
${k} = #{cm[${k}]}
|
|
</if>
|
|
</foreach>
|
|
</where>
|
|
</if>
|
|
</select>
|
|
|
|
|
|
<select id="selectOne" resultMap="BaseResultMap">
|
|
SELECT <include refid="Base_Column_List"></include> FROM Z_ISSUE_ITEM
|
|
<where>
|
|
<if test="ew.entity.handle!=null">
|
|
HANDLE=#{ew.handle}
|
|
</if>
|
|
<if test="ew.entity.site!=null">AND SITE=#{ew.entity.site}</if>
|
|
<if test="ew.entity.item!=null">AND ITEM=#{ew.entity.item}</if>
|
|
<if test="ew.entity.inventory!=null">AND INVENTORY=#{ew.entity.inventory}</if>
|
|
<if test="ew.entity.qty!=null">AND QTY=#{ew.entity.qty}</if>
|
|
<if test="ew.entity.createUser!=null">AND CREATE_USER=#{ew.entity.createUser}</if>
|
|
<if test="ew.entity.createdDateTime!=null">AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</if>
|
|
<if test="ew.entity.modifyUser!=null">AND MODIFY_USER=#{ew.entity.modifyUser}</if>
|
|
<if test="ew.entity.modifiedDateTime!=null">AND MODIFIED_DATE_TIME=#{ew.entity.modifiedDateTime}</if>
|
|
</where>
|
|
</select>
|
|
|
|
<select id="selectCount" resultType="Integer">
|
|
SELECT COUNT(1) FROM Z_ISSUE_ITEM
|
|
<where>
|
|
<if test="ew!=null">
|
|
<if test="ew.entity!=null">
|
|
<if test="ew.entity.handle!=null">
|
|
HANDLE=#{ew.entity.handle}
|
|
</if>
|
|
<if test="ew.entity.site!=null">AND SITE=#{ew.entity.site}</if>
|
|
<if test="ew.entity.item!=null">AND ITEM=#{ew.entity.item}</if>
|
|
<if test="ew.entity.inventory!=null">AND INVENTORY=#{ew.entity.inventory}</if>
|
|
<if test="ew.entity.qty!=null">AND QTY=#{ew.entity.qty}</if>
|
|
<if test="ew.entity.createUser!=null">AND CREATE_USER=#{ew.entity.createUser}</if>
|
|
<if test="ew.entity.createdDateTime!=null">AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</if>
|
|
<if test="ew.entity.modifyUser!=null">AND MODIFY_USER=#{ew.entity.modifyUser}</if>
|
|
<if test="ew.entity.modifiedDateTime!=null">AND MODIFIED_DATE_TIME=#{ew.entity.modifiedDateTime}
|
|
</if>
|
|
</if>
|
|
<if test="ew!=null and ew.sqlSegment!=null and ew.nonEmptyOfWhere">
|
|
${ew.sqlSegment}
|
|
</if>
|
|
</if>
|
|
</where>
|
|
<if test="ew!=null and ew.sqlSegment!=null and ew.emptyOfWhere">
|
|
${ew.sqlSegment}
|
|
</if>
|
|
</select>
|
|
|
|
<select id="selectList" resultMap="BaseResultMap">
|
|
SELECT
|
|
<choose>
|
|
<when test="ew != null and ew.sqlSelect != null">${ew.sqlSelect}</when>
|
|
<otherwise>
|
|
<include refid="Base_Column_List"></include>
|
|
</otherwise>
|
|
</choose>
|
|
FROM Z_ISSUE_ITEM
|
|
<where>
|
|
<if test="ew!=null">
|
|
<if test="ew.entity!=null">
|
|
<if test="ew.entity.handle!=null">
|
|
HANDLE=#{ew.entity.handle}
|
|
</if>
|
|
<if test="ew.entity.site!=null">AND SITE=#{ew.entity.site}</if>
|
|
<if test="ew.entity.item!=null">AND ITEM=#{ew.entity.item}</if>
|
|
<if test="ew.entity.inventory!=null">AND INVENTORY=#{ew.entity.inventory}</if>
|
|
<if test="ew.entity.qty!=null">AND QTY=#{ew.entity.qty}</if>
|
|
<if test="ew.entity.createUser!=null">AND CREATE_USER=#{ew.entity.createUser}</if>
|
|
<if test="ew.entity.createdDateTime!=null">AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</if>
|
|
<if test="ew.entity.modifyUser!=null">AND MODIFY_USER=#{ew.entity.modifyUser}</if>
|
|
<if test="ew.entity.modifiedDateTime!=null">AND MODIFIED_DATE_TIME=#{ew.entity.modifiedDateTime}
|
|
</if>
|
|
</if>
|
|
<if test="ew!=null and ew.sqlSegment!=null and ew.nonEmptyOfWhere">
|
|
${ew.sqlSegment}
|
|
</if>
|
|
</if>
|
|
</where>
|
|
<if test="ew!=null and ew.sqlSegment!=null and ew.emptyOfWhere">
|
|
${ew.sqlSegment}
|
|
</if>
|
|
</select>
|
|
|
|
<select id="selectMaps" resultType="HashMap">
|
|
SELECT
|
|
<choose>
|
|
<when test="ew != null and ew.sqlSelect != null">${ew.sqlSelect}</when>
|
|
<otherwise>
|
|
<include refid="Base_Column_List"></include>
|
|
</otherwise>
|
|
</choose>
|
|
FROM Z_ISSUE_ITEM
|
|
<where>
|
|
<if test="ew!=null">
|
|
<if test="ew.entity!=null">
|
|
<if test="ew.entity.handle!=null">
|
|
HANDLE=#{ew.entity.handle}
|
|
</if>
|
|
<if test="ew.entity.site!=null">AND SITE=#{ew.entity.site}</if>
|
|
<if test="ew.entity.item!=null">AND ITEM=#{ew.entity.item}</if>
|
|
<if test="ew.entity.inventory!=null">AND INVENTORY=#{ew.entity.inventory}</if>
|
|
<if test="ew.entity.qty!=null">AND QTY=#{ew.entity.qty}</if>
|
|
<if test="ew.entity.createUser!=null">AND CREATE_USER=#{ew.entity.createUser}</if>
|
|
<if test="ew.entity.createdDateTime!=null">AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</if>
|
|
<if test="ew.entity.modifyUser!=null">AND MODIFY_USER=#{ew.entity.modifyUser}</if>
|
|
<if test="ew.entity.modifiedDateTime!=null">AND MODIFIED_DATE_TIME=#{ew.entity.modifiedDateTime}
|
|
</if>
|
|
</if>
|
|
<if test="ew!=null and ew.sqlSegment!=null and ew.nonEmptyOfWhere">
|
|
${ew.sqlSegment}
|
|
</if>
|
|
</if>
|
|
</where>
|
|
<if test="ew!=null and ew.sqlSegment!=null and ew.emptyOfWhere">
|
|
${ew.sqlSegment}
|
|
</if>
|
|
</select>
|
|
|
|
<select id="selectObjs" resultType="Object">
|
|
SELECT
|
|
<choose>
|
|
<when test="ew != null and ew.sqlSelect != null">${ew.sqlSelect}</when>
|
|
<otherwise>
|
|
<include refid="Base_Column_List"></include>
|
|
</otherwise>
|
|
</choose>
|
|
FROM Z_ISSUE_ITEM
|
|
<where>
|
|
<if test="ew!=null">
|
|
<if test="ew.entity!=null">
|
|
<if test="ew.entity.handle!=null">
|
|
HANDLE=#{ew.entity.handle}
|
|
</if>
|
|
<if test="ew.entity.site!=null">AND SITE=#{ew.entity.site}</if>
|
|
<if test="ew.entity.item!=null">AND ITEM=#{ew.entity.item}</if>
|
|
<if test="ew.entity.inventory!=null">AND INVENTORY=#{ew.entity.inventory}</if>
|
|
<if test="ew.entity.qty!=null">AND QTY=#{ew.entity.qty}</if>
|
|
<if test="ew.entity.createUser!=null">AND CREATE_USER=#{ew.entity.createUser}</if>
|
|
<if test="ew.entity.createdDateTime!=null">AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</if>
|
|
<if test="ew.entity.modifyUser!=null">AND MODIFY_USER=#{ew.entity.modifyUser}</if>
|
|
<if test="ew.entity.modifiedDateTime!=null">AND MODIFIED_DATE_TIME=#{ew.entity.modifiedDateTime}
|
|
</if>
|
|
</if>
|
|
<if test="ew!=null and ew.sqlSegment!=null and ew.nonEmptyOfWhere">
|
|
${ew.sqlSegment}
|
|
</if>
|
|
</if>
|
|
</where>
|
|
<if test="ew!=null and ew.sqlSegment!=null and ew.emptyOfWhere">
|
|
${ew.sqlSegment}
|
|
</if>
|
|
</select>
|
|
|
|
<select id="selectPage" resultMap="BaseResultMap">
|
|
SELECT
|
|
<choose>
|
|
<when test="ew != null and ew.sqlSelect != null">${ew.sqlSelect}</when>
|
|
<otherwise>
|
|
<include refid="Base_Column_List"></include>
|
|
</otherwise>
|
|
</choose>
|
|
FROM Z_ISSUE_ITEM
|
|
<where>
|
|
<if test="ew!=null">
|
|
<if test="ew.entity!=null">
|
|
<if test="ew.entity.handle!=null">
|
|
HANDLE=#{ew.entity.handle}
|
|
</if>
|
|
<if test="ew.entity.site!=null">AND SITE=#{ew.entity.site}</if>
|
|
<if test="ew.entity.item!=null">AND ITEM=#{ew.entity.item}</if>
|
|
<if test="ew.entity.inventory!=null">AND INVENTORY=#{ew.entity.inventory}</if>
|
|
<if test="ew.entity.qty!=null">AND QTY=#{ew.entity.qty}</if>
|
|
<if test="ew.entity.createUser!=null">AND CREATE_USER=#{ew.entity.createUser}</if>
|
|
<if test="ew.entity.createdDateTime!=null">AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</if>
|
|
<if test="ew.entity.modifyUser!=null">AND MODIFY_USER=#{ew.entity.modifyUser}</if>
|
|
<if test="ew.entity.modifiedDateTime!=null">AND MODIFIED_DATE_TIME=#{ew.entity.modifiedDateTime}
|
|
</if>
|
|
</if>
|
|
<if test="ew!=null and ew.sqlSegment!=null and ew.nonEmptyOfWhere">
|
|
${ew.sqlSegment}
|
|
</if>
|
|
</if>
|
|
</where>
|
|
<if test="ew!=null and ew.sqlSegment!=null and ew.emptyOfWhere">
|
|
${ew.sqlSegment}
|
|
</if>
|
|
</select>
|
|
|
|
<select id="selectMapsPage" resultType="HashMap">
|
|
SELECT
|
|
<choose>
|
|
<when test="ew != null and ew.sqlSelect != null">${ew.sqlSelect}</when>
|
|
<otherwise>
|
|
<include refid="Base_Column_List"></include>
|
|
</otherwise>
|
|
</choose>
|
|
FROM Z_ISSUE_ITEM
|
|
<where>
|
|
<if test="ew!=null">
|
|
<if test="ew.entity!=null">
|
|
<if test="ew.entity.handle!=null">
|
|
HANDLE=#{ew.entity.handle}
|
|
</if>
|
|
<if test="ew.entity.site!=null">AND SITE=#{ew.entity.site}</if>
|
|
<if test="ew.entity.item!=null">AND ITEM=#{ew.entity.item}</if>
|
|
<if test="ew.entity.inventory!=null">AND INVENTORY=#{ew.entity.inventory}</if>
|
|
<if test="ew.entity.qty!=null">AND QTY=#{ew.entity.qty}</if>
|
|
<if test="ew.entity.createUser!=null">AND CREATE_USER=#{ew.entity.createUser}</if>
|
|
<if test="ew.entity.createdDateTime!=null">AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</if>
|
|
<if test="ew.entity.modifyUser!=null">AND MODIFY_USER=#{ew.entity.modifyUser}</if>
|
|
<if test="ew.entity.modifiedDateTime!=null">AND MODIFIED_DATE_TIME=#{ew.entity.modifiedDateTime}
|
|
</if>
|
|
</if>
|
|
<if test="ew!=null and ew.sqlSegment!=null and ew.nonEmptyOfWhere">
|
|
${ew.sqlSegment}
|
|
</if>
|
|
</if>
|
|
</where>
|
|
<if test="ew!=null and ew.sqlSegment!=null and ew.emptyOfWhere">
|
|
${ew.sqlSegment}
|
|
</if>
|
|
</select>
|
|
|
|
<insert id="insert" parameterType="com.foreverwin.mesnac.dispatch.model.IssueItem">
|
|
INSERT INTO Z_ISSUE_ITEM
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
HANDLE,
|
|
<if test="site!=null">SITE,</if>
|
|
<if test="item!=null">ITEM,</if>
|
|
<if test="inventory!=null">INVENTORY,</if>
|
|
<if test="qty!=null">QTY,</if>
|
|
<if test="createUser!=null">CREATE_USER,</if>
|
|
<if test="createdDateTime!=null">CREATED_DATE_TIME,</if>
|
|
<if test="modifyUser!=null">MODIFY_USER,</if>
|
|
<if test="modifiedDateTime!=null">MODIFIED_DATE_TIME,</if>
|
|
</trim>
|
|
VALUES
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
#{handle},
|
|
<if test="site!=null">#{site},</if>
|
|
<if test="item!=null">#{item},</if>
|
|
<if test="inventory!=null">#{inventory},</if>
|
|
<if test="qty!=null">#{qty},</if>
|
|
<if test="createUser!=null">#{createUser},</if>
|
|
<if test="createdDateTime!=null">#{createdDateTime},</if>
|
|
<if test="modifyUser!=null">#{modifyUser},</if>
|
|
<if test="modifiedDateTime!=null">#{modifiedDateTime},</if>
|
|
</trim>
|
|
</insert>
|
|
|
|
<insert id="insertAllColumn" parameterType="com.foreverwin.mesnac.dispatch.model.IssueItem">
|
|
INSERT INTO Z_ISSUE_ITEM
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
<include refid="Base_Column_List"></include>
|
|
</trim>
|
|
VALUES
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
#{handle},
|
|
#{site},
|
|
#{item},
|
|
#{inventory},
|
|
#{qty},
|
|
#{createUser},
|
|
#{createdDateTime},
|
|
#{modifyUser},
|
|
#{modifiedDateTime},
|
|
</trim>
|
|
</insert>
|
|
|
|
<update id="update">
|
|
UPDATE Z_ISSUE_ITEM
|
|
<trim prefix="SET" suffixOverrides=",">
|
|
<if test="et.handle!=null">HANDLE=#{et.handle},</if>
|
|
<if test="et.site!=null">SITE=#{et.site},</if>
|
|
<if test="et.item!=null">ITEM=#{et.item},</if>
|
|
<if test="et.inventory!=null">INVENTORY=#{et.inventory},</if>
|
|
<if test="et.qty!=null">QTY=#{et.qty},</if>
|
|
<if test="et.createUser!=null">CREATE_USER=#{et.createUser},</if>
|
|
<if test="et.createdDateTime!=null">CREATED_DATE_TIME=#{et.createdDateTime},</if>
|
|
<if test="et.modifyUser!=null">MODIFY_USER=#{et.modifyUser},</if>
|
|
<if test="et.modifiedDateTime!=null">MODIFIED_DATE_TIME=#{et.modifiedDateTime},</if>
|
|
</trim>
|
|
<where>
|
|
<if test="ew!=null">
|
|
<if test="ew.entity!=null">
|
|
HANDLE=#{ew.entity.handle}
|
|
<if test="ew.entity.site!=null">AND SITE=#{ew.entity.site}</if>
|
|
<if test="ew.entity.item!=null">AND ITEM=#{ew.entity.item}</if>
|
|
<if test="ew.entity.inventory!=null">AND INVENTORY=#{ew.entity.inventory}</if>
|
|
<if test="ew.entity.qty!=null">AND QTY=#{ew.entity.qty}</if>
|
|
<if test="ew.entity.createUser!=null">AND CREATE_USER=#{ew.entity.createUser}</if>
|
|
<if test="ew.entity.createdDateTime!=null">AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</if>
|
|
<if test="ew.entity.modifyUser!=null">AND MODIFY_USER=#{ew.entity.modifyUser}</if>
|
|
<if test="ew.entity.modifiedDateTime!=null">AND MODIFIED_DATE_TIME=#{ew.entity.modifiedDateTime}
|
|
</if>
|
|
</if>
|
|
<if test="ew!=null and ew.sqlSegment!=null and ew.nonEmptyOfWhere">
|
|
${ew.sqlSegment}
|
|
</if>
|
|
</if>
|
|
</where>
|
|
<if test="ew!=null and ew.sqlSegment!=null and ew.emptyOfWhere">
|
|
${ew.sqlSegment}
|
|
</if>
|
|
</update>
|
|
|
|
|
|
<delete id="deleteByMap">
|
|
DELETE FROM Z_ISSUE_ITEM
|
|
<if test="cm!=null and !cm.isEmpty">
|
|
<where>
|
|
<foreach collection="cm.keys" item="k" separator="AND">
|
|
<if test="cm[k] != null">
|
|
${k} = #{cm[${k}]}
|
|
</if>
|
|
</foreach>
|
|
</where>
|
|
</if>
|
|
</delete>
|
|
|
|
<delete id="delete">
|
|
DELETE FROM Z_ISSUE_ITEM
|
|
<where>
|
|
<if test="ew!=null">
|
|
<if test="ew.entity!=null">
|
|
<if test="ew.entity.handle!=null">
|
|
HANDLE=#{ew.entity.handle}
|
|
</if>
|
|
<if test="ew.entity.site!=null">AND SITE=#{ew.entity.site}</if>
|
|
<if test="ew.entity.item!=null">AND ITEM=#{ew.entity.item}</if>
|
|
<if test="ew.entity.inventory!=null">AND INVENTORY=#{ew.entity.inventory}</if>
|
|
<if test="ew.entity.qty!=null">AND QTY=#{ew.entity.qty}</if>
|
|
<if test="ew.entity.createUser!=null">AND CREATE_USER=#{ew.entity.createUser}</if>
|
|
<if test="ew.entity.createdDateTime!=null">AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</if>
|
|
<if test="ew.entity.modifyUser!=null">AND MODIFY_USER=#{ew.entity.modifyUser}</if>
|
|
<if test="ew.entity.modifiedDateTime!=null">AND MODIFIED_DATE_TIME=#{ew.entity.modifiedDateTime}
|
|
</if>
|
|
</if>
|
|
<if test="ew!=null and ew.sqlSegment!=null and ew.nonEmptyOfWhere">
|
|
${ew.sqlSegment}
|
|
</if>
|
|
</if>
|
|
</where>
|
|
<if test="ew!=null and ew.sqlSegment!=null and ew.emptyOfWhere">
|
|
${ew.sqlSegment}
|
|
</if>
|
|
</delete>
|
|
|
|
<!-- BaseMapper标准查询/修改/删除 -->
|
|
|
|
<select id="selectInvIssueQty" resultType="java.math.BigDecimal">
|
|
SELECT SUM(NVL(QTY, 0)) QTY
|
|
FROM Z_ISSUE_ITEM
|
|
WHERE SITE = #{site} AND INVENTORY = #{inventory}
|
|
GROUP BY SITE, INVENTORY
|
|
</select>
|
|
|
|
<select id="selectLoadInventoryQty" resultType="java.math.BigDecimal">
|
|
SELECT NVL(SUM(ZLI.QTY_ON_HAND),0) FROM Z_LOAD_INVENTORY ZLI
|
|
WHERE ZLI.SITE = #{site} AND ZLI.INVENTORY_ID = #{inventoryId}
|
|
</select>
|
|
|
|
</mapper>
|