| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153 |
- <?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.xingxi.business.ProdInventory.mapper.ProdInventoryMapper">
- <resultMap type="ProdInventory" id="ProdInventoryResult">
- <result property="prodInventoryId" column="prodInventoryId" />
- <result property="prodId" column="prodId" />
- <result property="prodAttrId" column="prodAttrId" />
- <result property="mercId" column="mercId" />
- <result property="quantity" column="quantity" />
- <result property="availQty" column="availQty" />
- <result property="delFlag" column="delFlag" />
- <result property="createUser" column="createUser" />
- <result property="createTime" column="createTime" />
- <result property="updateUser" column="updateUser" />
- <result property="updateTime" column="updateTime" />
- </resultMap>
- <sql id="selectProdInventory">
- select prodInventoryId, prodId, prodAttrId, mercId, quantity, availQty, delFlag, createUser, createTime, updateUser, updateTime from t_prod_inventory
- </sql>
- <sql id="selectProdInventoryExt">
- select
- ${tableAlias}.prodInventoryId,
- ${tableAlias}.prodId,
- ${tableAlias}.prodAttrId,
- ${tableAlias}.mercId,
- ${tableAlias}.quantity,
- ${tableAlias}.availQty,
- ${tableAlias}.delFlag,
- ${tableAlias}.createUser,
- ${tableAlias}.createTime,
- ${tableAlias}.updateUser,
- ${tableAlias}.updateTime
- from t_prod_inventory ${tableAlias}
- </sql>
- <select id="selectProdInventoryList" parameterType="ProdInventory" resultMap="ProdInventoryResult">
- <include refid="selectProdInventory"/>
- <where>
- <if test="prodId != null "> and prodId = #{prodId}</if>
- <if test="prodAttrId != null "> and prodAttrId = #{prodAttrId}</if>
- <if test="mercId != null "> and mercId = #{mercId}</if>
- <if test="quantity != null "> and quantity = #{quantity}</if>
- <if test="availQty != null "> and availQty = #{availQty}</if>
- <if test="delFlag != null and delFlag != ''"> and delFlag = #{delFlag}</if>
- <if test="createUser != null and createUser != ''"> and createUser = #{createUser}</if>
- <if test="createTime != null "> and createTime = #{createTime}</if>
- <if test="updateUser != null and updateUser != ''"> and updateUser = #{updateUser}</if>
- <if test="updateTime != null "> and updateTime = #{updateTime}</if>
- </where>
- </select>
-
- <select id="selectProdInventoryByProdInventoryId" parameterType="Long" resultMap="ProdInventoryResult">
- <include refid="selectProdInventory"/>
- where prodInventoryId = #{prodInventoryId}
- </select>
-
- <insert id="insertProdInventory" parameterType="ProdInventory" useGeneratedKeys="true" keyProperty="prodInventoryId">
- insert into t_prod_inventory
- <trim prefix="(" suffix=")" suffixOverrides=",">
- <if test="prodId != null">prodId,</if>
- <if test="prodAttrId != null">prodAttrId,</if>
- <if test="mercId != null">mercId,</if>
- <if test="quantity != null">quantity,</if>
- <if test="availQty != null">availQty,</if>
- <if test="delFlag != null">delFlag,</if>
- <if test="createUser != null">createUser,</if>
- <if test="createTime != null">createTime,</if>
- <if test="updateUser != null">updateUser,</if>
- <if test="updateTime != null">updateTime,</if>
- </trim>
- <trim prefix="values (" suffix=")" suffixOverrides=",">
- <if test="prodId != null">#{prodId},</if>
- <if test="prodAttrId != null">#{prodAttrId},</if>
- <if test="mercId != null">#{mercId},</if>
- <if test="quantity != null">#{quantity},</if>
- <if test="availQty != null">#{availQty},</if>
- <if test="delFlag != null">#{delFlag},</if>
- <if test="createUser != null">#{createUser},</if>
- <if test="createTime != null">#{createTime},</if>
- <if test="updateUser != null">#{updateUser},</if>
- <if test="updateTime != null">#{updateTime},</if>
- </trim>
- </insert>
- <insert id="batchInsertProdInventory">
- insert into t_prod_inventory( prodId, prodAttrId, mercId, quantity, availQty, delFlag, createUser, createTime, updateUser, updateTime) values
- <foreach item="item" index="index" collection="list" separator=",">
- ( #{item.prodId}, #{item.prodAttrId}, #{item.mercId}, #{item.quantity}, #{item.availQty}, #{item.delFlag}, #{item.createUser}, #{item.createTime}, #{item.updateUser}, #{item.updateTime})
- </foreach>
- </insert>
- <update id="updateProdInventory" parameterType="ProdInventory">
- update t_prod_inventory
- <trim prefix="SET" suffixOverrides=",">
- <if test="prodId != null">prodId = #{prodId},</if>
- <if test="prodAttrId != null">prodAttrId = #{prodAttrId},</if>
- <if test="mercId != null">mercId = #{mercId},</if>
- <if test="quantity != null">quantity = #{quantity},</if>
- <if test="availQty != null">availQty = #{availQty},</if>
- <if test="delFlag != null">delFlag = #{delFlag},</if>
- <if test="createUser != null">createUser = #{createUser},</if>
- <if test="createTime != null">createTime = #{createTime},</if>
- <if test="updateUser != null">updateUser = #{updateUser},</if>
- <if test="updateTime != null">updateTime = #{updateTime},</if>
- </trim>
- where prodInventoryId = #{prodInventoryId}
- </update>
- <delete id="deleteProdInventoryByProdInventoryId" parameterType="Long">
- delete from t_prod_inventory where prodInventoryId = #{prodInventoryId}
- </delete>
- <delete id="deleteProdInventoryByProdInventoryIds" parameterType="String">
- delete from t_prod_inventory where prodInventoryId in
- <foreach item="prodInventoryId" collection="array" open="(" separator="," close=")">
- #{prodInventoryId}
- </foreach>
- </delete>
- <update id="logicDeleteProdInventoryByProdInventoryId" parameterType="Long">
- update t_prod_inventory
- set delFlag = '1'
- where prodInventoryId = #{prodInventoryId}
- </update>
- <update id="logicDeleteProdInventoryByProdInventoryIds" parameterType="String">
- update t_prod_inventory
- set delFlag = '1'
- where prodInventoryId in
- <foreach item="prodInventoryId" collection="array" open="(" separator="," close=")">
- #{prodInventoryId}
- </foreach>
- </update>
- <update id="logicDeleteProdInventoryByCondition" parameterType="ProdInventory">
- update t_prod_inventory
- set delFlag = '1'
- <where>
- <if test="prodId != null "> and prodId = #{prodId}</if>
- <if test="prodAttrId != null "> and prodAttrId = #{prodAttrId}</if>
- <if test="mercId != null "> and mercId = #{mercId}</if>
- <if test="quantity != null "> and quantity = #{quantity}</if>
- <if test="availQty != null "> and availQty = #{availQty}</if>
- <if test="delFlag != null and delFlag != ''"> and delFlag = #{delFlag}</if>
- <if test="createUser != null and createUser != ''"> and createUser = #{createUser}</if>
- <if test="createTime != null "> and createTime = #{createTime}</if>
- <if test="updateUser != null and updateUser != ''"> and updateUser = #{updateUser}</if>
- <if test="updateTime != null "> and updateTime = #{updateTime}</if>
- </where>
- </update>
- </mapper>
|