123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130 |
- <?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.iamberry.wechat.service.mapper.ChannelPriceMapper">
- <resultMap id="BaseResultMap" type="ChannelPrice" >
- <result column="channel_price_id" property="channelPriceId" />
- <result column="channel_id" property="channelId" />
- <result column="product_id" property="productId" />
- <result column="color_id" property="colorId" />
- <result column="channel_price_offer" property="channelPriceOffer" />
- <result column="channel_price_status" property="channelPriceStatus" />
- <result column="channel_price_create_time" property="channelPriceCreateTime" />
- <result column="channel_price_update_time" property="channelPriceUpdateTime" />
- </resultMap>
- <sql id="Base_List" >
- t.channel_price_id,
- t.channel_id,
- t.product_id,
- t.color_id,
- t.channel_price_offer,
- t.channel_price_status,
- t.channel_price_create_time,
- t.channel_price_update_time
- </sql>
- <select id="getChannelPriceList" resultMap="BaseResultMap" parameterType="ChannelPrice" >
- select
- <include refid="Base_List" />
- from tb_iamberry_channel_price t
- <where>
- <if test="channelPriceId != null ">
- AND t.channel_price_id = #{channelPriceId}
- </if >
- <if test="channelId != null ">
- AND t.channel_id = #{channelId}
- </if >
- <if test="productId != null ">
- AND t.product_id = #{productId}
- </if >
- <if test="colorId != null ">
- AND t.color_id = #{colorId}
- </if >
- <if test="channelPriceOffer != null ">
- AND t.channel_price_offer = #{channelPriceOffer}
- </if >
- <if test="channelPriceStatus != null ">
- AND t.channel_price_status = #{channelPriceStatus}
- </if >
- </where>
- </select>
- <select id="getChannelPriceById" resultMap="BaseResultMap" parameterType="Integer" >
- select
- <include refid="Base_List" />
- from tb_iamberry_channel_price t
- where t.channel_price_id= #{channelPriceId}
- </select>
- <insert id="save" parameterType="ChannelPrice" >
- insert into
- tb_iamberry_channel_price
- (
- channel_id,
- product_id,
- color_id,
- channel_price_offer,
- channel_price_status
- )
- values
- (
- #{channelId},
- #{productId},
- #{colorId},
- #{channelPriceOffer},
- #{channelPriceStatus}
- )
- </insert>
- <update id="update" parameterType="ChannelPrice" >
- update
- tb_iamberry_channel_price
- <set >
- <if test="channelId != null ">
- channel_id = #{channelId},
- </if >
- <if test="productId != null ">
- product_id = #{productId},
- </if >
- <if test="colorId != null ">
- color_id = #{colorId},
- </if >
- <if test="channelPriceOffer != null ">
- channel_price_offer = #{channelPriceOffer},
- </if >
- <if test="channelPriceStatus != null ">
- channel_price_status = #{channelPriceStatus},
- </if >
- </set >
- where channel_price_id= #{channelPriceId}
- </update>
- <delete id="delete" parameterType="Integer" >
- delete
- tb_iamberry_channel_price
- where channel_price_id=#{channelPriceId}
- </delete>
- <insert id="saveList" parameterType="java.util.List" >
- insert into
- tb_iamberry_channel_price
- (
- channel_id,
- product_id,
- color_id,
- channel_price_offer,
- channel_price_status
- )
- values
- <foreach collection="list" item="node" index="index" separator="," open="" close="">
- (
- #{node.channelId},
- #{node.productId},
- #{node.colorId},
- #{node.channelPriceOffer},
- #{node.channelPriceStatus}
- )
- </foreach >
- </insert>
- <delete id="deleteList" parameterType="String" >
- delete
- tb_iamberry_channel_price
- where channel_price_id in
- <foreach collection="ids" item="item" index="index" separator="," open="(" close=")">
- #{item}
- </foreach >
- </delete>
- </mapper>
|