123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111 |
- <?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.fs.live.mapper.LiveOrderItemMapper">
- <resultMap type="LiveOrderItem" id="LiveOrderItemResult">
- <result property="itemId" column="item_id" />
- <result property="orderId" column="order_id" />
- <result property="orderCode" column="order_code" />
- <result property="cartId" column="cart_id" />
- <result property="goodsId" column="goods_id" />
- <result property="productId" column="product_id" />
- <result property="productAttrValueId" column="product_attr_value_id" />
- <result property="jsonInfo" column="json_info" />
- <result property="num" column="num" />
- <result property="isAfterSales" column="is_after_sales" />
- <result property="isPrescribe" column="is_prescribe" />
- <result property="storeId" column="store_id" />
- <result property="isGift" column="is_gift" />
- </resultMap>
- <sql id="selectLiveOrderItemVo">
- select item_id, order_id, order_code, cart_id, goods_id, product_id, product_attr_value_id, json_info, num, is_after_sales, is_prescribe, store_id, is_gift from live_order_item
- </sql>
- <select id="selectLiveOrderItemList" parameterType="LiveOrderItem" resultMap="LiveOrderItemResult">
- <include refid="selectLiveOrderItemVo"/>
- <where>
- <if test="orderId != null and orderId != ''"> and order_id = #{orderId}</if>
- <if test="orderCode != null and orderCode != ''"> and order_code = #{orderCode}</if>
- <if test="cartId != null and cartId != ''"> and cart_id = #{cartId}</if>
- <if test="goodsId != null "> and goods_id = #{goodsId}</if>
- <if test="productId != null and productId != ''"> and product_id = #{productId}</if>
- <if test="productAttrValueId != null "> and product_attr_value_id = #{productAttrValueId}</if>
- <if test="jsonInfo != null and jsonInfo != ''"> and json_info = #{jsonInfo}</if>
- <if test="num != null "> and num = #{num}</if>
- <if test="isAfterSales != null "> and is_after_sales = #{isAfterSales}</if>
- <if test="isPrescribe != null "> and is_prescribe = #{isPrescribe}</if>
- <if test="storeId != null "> and store_id = #{storeId}</if>
- <if test="isGift != null "> and is_gift = #{isGift}</if>
- </where>
- </select>
- <select id="selectLiveOrderItemByItemId" parameterType="String" resultMap="LiveOrderItemResult">
- <include refid="selectLiveOrderItemVo"/>
- where item_id = #{itemId}
- </select>
- <insert id="insertLiveOrderItem" parameterType="LiveOrderItem" useGeneratedKeys="true" keyProperty="itemId">
- insert into live_order_item
- <trim prefix="(" suffix=")" suffixOverrides=",">
- <if test="orderId != null and orderId != ''">order_id,</if>
- <if test="orderCode != null">order_code,</if>
- <if test="cartId != null and cartId != ''">cart_id,</if>
- <if test="goodsId != null">goods_id,</if>
- <if test="productId != null and productId != ''">product_id,</if>
- <if test="productAttrValueId != null">product_attr_value_id,</if>
- <if test="jsonInfo != null">json_info,</if>
- <if test="num != null">num,</if>
- <if test="isAfterSales != null">is_after_sales,</if>
- <if test="isPrescribe != null">is_prescribe,</if>
- <if test="storeId != null">store_id,</if>
- <if test="isGift != null">is_gift,</if>
- </trim>
- <trim prefix="values (" suffix=")" suffixOverrides=",">
- <if test="orderId != null and orderId != ''">#{orderId},</if>
- <if test="orderCode != null">#{orderCode},</if>
- <if test="cartId != null and cartId != ''">#{cartId},</if>
- <if test="goodsId != null">#{goodsId},</if>
- <if test="productId != null and productId != ''">#{productId},</if>
- <if test="productAttrValueId != null">#{productAttrValueId},</if>
- <if test="jsonInfo != null">#{jsonInfo},</if>
- <if test="num != null">#{num},</if>
- <if test="isAfterSales != null">#{isAfterSales},</if>
- <if test="isPrescribe != null">#{isPrescribe},</if>
- <if test="storeId != null">#{storeId},</if>
- <if test="isGift != null">#{isGift},</if>
- </trim>
- </insert>
- <update id="updateLiveOrderItem" parameterType="LiveOrderItem">
- update live_order_item
- <trim prefix="SET" suffixOverrides=",">
- <if test="orderId != null and orderId != ''">order_id = #{orderId},</if>
- <if test="orderCode != null">order_code = #{orderCode},</if>
- <if test="cartId != null and cartId != ''">cart_id = #{cartId},</if>
- <if test="goodsId != null">goods_id = #{goodsId},</if>
- <if test="productId != null and productId != ''">product_id = #{productId},</if>
- <if test="productAttrValueId != null">product_attr_value_id = #{productAttrValueId},</if>
- <if test="jsonInfo != null">json_info = #{jsonInfo},</if>
- <if test="num != null">num = #{num},</if>
- <if test="isAfterSales != null">is_after_sales = #{isAfterSales},</if>
- <if test="isPrescribe != null">is_prescribe = #{isPrescribe},</if>
- <if test="storeId != null">store_id = #{storeId},</if>
- <if test="isGift != null">is_gift = #{isGift},</if>
- </trim>
- where item_id = #{itemId}
- </update>
- <delete id="deleteLiveOrderItemByItemId" parameterType="String">
- delete from live_order_item where item_id = #{itemId}
- </delete>
- <delete id="deleteLiveOrderItemByItemIds" parameterType="String">
- delete from live_order_item where item_id in
- <foreach item="itemId" collection="array" open="(" separator="," close=")">
- #{itemId}
- </foreach>
- </delete>
- </mapper>
|