Blame view

src/main/resources/mapper/ChannelProductMapper.xml 3.91 KB
f318719c   louyao   渠道商后台
1
2
3
4
5
6
<?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.sincere.wechatbusiness.mapper.ChannelProductMapper">
    <resultMap id="ChannelProductMap" type="com.sincere.wechatbusiness.model.ChannelProduct">
        <id column="id" jdbcType="INTEGER" property="id" />
        <result column="channelId" jdbcType="INTEGER" property="channelId" />
962b0bfd   louyao   渠道商移动端
7
        <result column="productId" jdbcType="INTEGER" property="productId" />
f318719c   louyao   渠道商后台
8
9
        <result column="product_name" jdbcType="VARCHAR" property="productName" />
        <result column="price" jdbcType="VARCHAR" property="price" />
962b0bfd   louyao   渠道商移动端
10
        <result column="img_url" jdbcType="VARCHAR" property="imgUrl" />
f318719c   louyao   渠道商后台
11
12
13
14
        <result column="channel_price" jdbcType="VARCHAR" property="channelPrice" />
        <result column="caption" jdbcType="VARCHAR" property="caption" />
        <result column="state" jdbcType="INTEGER" property="state"/>
        <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
eca46c74   陈杰   1
15
16
        <result column="promotion_price" jdbcType="VARCHAR" property="promotionPrice" />
        <result column="end_time" jdbcType="TIMESTAMP" property="endTime" />
e9031310   陈杰   内容下发
17
18
19
20
        <result column="channel_title" jdbcType="VARCHAR" property="channelTitle" />
        <result column="channel_img" jdbcType="VARCHAR" property="channelImg" />
        <result column="channel_require" jdbcType="VARCHAR" property="channelRequire" />
        <result column="channel_explain" jdbcType="VARCHAR" property="channelExplain" />
eca46c74   陈杰   1
21
        <result column="title" jdbcType="VARCHAR" property="title" />
cdc58444   陈杰   1
22
        <result column="open_address" jdbcType="INTEGER" property="openAddress"/>
f318719c   louyao   渠道商后台
23
24
25
26
27
28
29
    </resultMap>

    <select id="getList" parameterType="java.lang.Integer" resultMap="ChannelProductMap">
        select * from channel_product where state=1 and channelId=#{id} order by create_time
    </select>

    <insert id="insert" parameterType="com.sincere.wechatbusiness.model.ChannelProduct">
bbcd213f   陈杰   渠道商 动态码
30
31
    insert into channel_product (channelId,productId,product_name,price,img_url,channel_title,channel_img,channel_require,channel_explain)
    values (#{channelId,jdbcType=INTEGER},#{productId,jdbcType=INTEGER}, #{productName,jdbcType=VARCHAR},
9c4d6326   陈杰   渠道商品 编辑
32
     #{price,jdbcType=VARCHAR}, #{imgUrl,jdbcType=VARCHAR},#{channelTitle},#{channelImg},#{channelRequire},#{channelExplain}
bbcd213f   陈杰   渠道商 动态码
33
34
      )
    </insert>
f318719c   louyao   渠道商后台
35
36
37

    <update id="updateChannelProductMsg" parameterType="com.sincere.wechatbusiness.model.ChannelProduct">
        update channel_product set channel_title = #{channelTitle} , channel_img =#{channelImg} ,
9c4d6326   陈杰   渠道商品 编辑
38
39
40
41
42
43
        channel_require =#{channelRequire} , channel_explain=#{channelExplain}
        where id =#{id}
    </update>

    <update id="update" parameterType="com.sincere.wechatbusiness.model.ChannelProduct">
        update channel_product
f318719c   louyao   渠道商后台
44
45
46
        <trim prefix="set" suffixOverrides=",">
            <if test="channelPrice!=null and channelPrice!=''">
                channel_price=#{channelPrice},
bbcd213f   陈杰   渠道商 动态码
47
48
49
            </if>
            <if test="caption!=null and caption!=''">
                caption=#{caption},
f318719c   louyao   渠道商后台
50
51
52
53
54
55
            </if>
            <if test="promotionPrice!=null and promotionPrice!=''">
                promotion_price=#{promotionPrice},
            </if>
            <if test="endTime!=null">
                end_time=#{endTime},
eca46c74   陈杰   1
56
57
58
            </if>
            <if test="title!=null and title!=''">
                title=#{title},
4582f838   陈杰   1
59
            </if>
eca46c74   陈杰   1
60
61
62
63
64
        </trim>
        where id = #{id}
    </update>

    <update id="updateProductOpenAddress">
f318719c   louyao   渠道商后台
65
66
67
68
        update channel_product set open_address=#{openAddress} where id=#{id}
    </update>

    <update id="deleteChannelProduct" parameterType="java.lang.Integer">
cdc58444   陈杰   1
69
70
71
72
        update channel_product set state=0 where channelId=#{id}
    </update>

    <select id="getDetail" parameterType="java.lang.Integer" resultMap="ChannelProductMap">
f318719c   louyao   渠道商后台
73
74
75
        select * from channel_product where id=#{id}
    </select>
</mapper>
962b0bfd   louyao   渠道商移动端

f318719c   louyao   渠道商后台