123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174 |
- <?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.juxiao.xchat.module.xbd.mapper.marketing.HomeChannelMapper" >
- <resultMap id="BaseResultMap" type="com.juxiao.xchat.module.xbd.domain.marketing.HomeChannel" >
- <id column="id" property="id" jdbcType="BIGINT" />
- <result column="channel" property="channel" jdbcType="VARCHAR" />
- <result column="home_default" property="homeDefault" jdbcType="INTEGER" />
- <result column="is_news" property="isNews" jdbcType="TINYINT" />
- <result column="create_time" property="createTime" jdbcType="TIMESTAMP" />
- <result column="type" property="type" jdbcType="TINYINT" />
- <result column="group_id" property="groupId" jdbcType="INTEGER" />
- <result column="channel_name" property="channelName" jdbcType="VARCHAR" />
- <result column="superior_channel" property="superiorChannel" jdbcType="VARCHAR" />
- </resultMap>
- <sql id="Base_Column_List" >
- id, channel, home_default, is_news, create_time, type, group_id, channel_name, superior_channel
- </sql>
- <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Long" >
- select
- <include refid="Base_Column_List" />
- from home_channel
- where id = #{id,jdbcType=BIGINT}
- </select>
- <delete id="deleteByPrimaryKey" parameterType="java.lang.Long" >
- delete from home_channel
- where id = #{id,jdbcType=BIGINT}
- </delete>
- <insert id="insert" parameterType="com.juxiao.xchat.module.xbd.domain.marketing.HomeChannel" >
- <selectKey resultType="java.lang.Long" keyProperty="id" order="AFTER" >
- SELECT LAST_INSERT_ID()
- </selectKey>
- insert into home_channel (channel, home_default, is_news,
- create_time, type, group_id,
- channel_name, superior_channel)
- values (#{channel,jdbcType=VARCHAR}, #{homeDefault,jdbcType=INTEGER}, #{isNews,jdbcType=TINYINT},
- #{createTime,jdbcType=TIMESTAMP}, #{type,jdbcType=TINYINT}, #{groupId,jdbcType=INTEGER},
- #{channelName,jdbcType=VARCHAR}, #{superiorChannel,jdbcType=VARCHAR})
- </insert>
- <insert id="insertSelective" parameterType="com.juxiao.xchat.module.xbd.domain.marketing.HomeChannel" >
- <selectKey resultType="java.lang.Long" keyProperty="id" order="AFTER" >
- SELECT LAST_INSERT_ID()
- </selectKey>
- insert into home_channel
- <trim prefix="(" suffix=")" suffixOverrides="," >
- <if test="channel != null" >
- channel,
- </if>
- <if test="homeDefault != null" >
- home_default,
- </if>
- <if test="isNews != null" >
- is_news,
- </if>
- <if test="createTime != null" >
- create_time,
- </if>
- <if test="type != null" >
- type,
- </if>
- <if test="groupId != null" >
- group_id,
- </if>
- <if test="channelName != null" >
- channel_name,
- </if>
- <if test="superiorChannel != null" >
- superior_channel,
- </if>
- </trim>
- <trim prefix="values (" suffix=")" suffixOverrides="," >
- <if test="channel != null" >
- #{channel,jdbcType=VARCHAR},
- </if>
- <if test="homeDefault != null" >
- #{homeDefault,jdbcType=INTEGER},
- </if>
- <if test="isNews != null" >
- #{isNews,jdbcType=TINYINT},
- </if>
- <if test="createTime != null" >
- #{createTime,jdbcType=TIMESTAMP},
- </if>
- <if test="type != null" >
- #{type,jdbcType=TINYINT},
- </if>
- <if test="groupId != null" >
- #{groupId,jdbcType=INTEGER},
- </if>
- <if test="channelName != null" >
- #{channelName,jdbcType=VARCHAR},
- </if>
- <if test="superiorChannel != null" >
- #{superiorChannel,jdbcType=VARCHAR},
- </if>
- </trim>
- </insert>
- <update id="updateByPrimaryKeySelective" parameterType="com.juxiao.xchat.module.xbd.domain.marketing.HomeChannel" >
- update home_channel
- <set >
- <if test="channel != null" >
- channel = #{channel,jdbcType=VARCHAR},
- </if>
- <if test="homeDefault != null" >
- home_default = #{homeDefault,jdbcType=INTEGER},
- </if>
- <if test="isNews != null" >
- is_news = #{isNews,jdbcType=TINYINT},
- </if>
- <if test="createTime != null" >
- create_time = #{createTime,jdbcType=TIMESTAMP},
- </if>
- <if test="type != null" >
- type = #{type,jdbcType=TINYINT},
- </if>
- <if test="groupId != null" >
- group_id = #{groupId,jdbcType=INTEGER},
- </if>
- <if test="channelName != null" >
- channel_name = #{channelName,jdbcType=VARCHAR},
- </if>
- <if test="superiorChannel != null" >
- superior_channel = #{superiorChannel,jdbcType=VARCHAR},
- </if>
- </set>
- where id = #{id,jdbcType=BIGINT}
- </update>
- <update id="updateByPrimaryKey" parameterType="com.juxiao.xchat.module.xbd.domain.marketing.HomeChannel" >
- update home_channel
- set channel = #{channel,jdbcType=VARCHAR},
- home_default = #{homeDefault,jdbcType=INTEGER},
- is_news = #{isNews,jdbcType=TINYINT},
- create_time = #{createTime,jdbcType=TIMESTAMP},
- type = #{type,jdbcType=TINYINT},
- group_id = #{groupId,jdbcType=INTEGER},
- channel_name = #{channelName,jdbcType=VARCHAR},
- superior_channel = #{superiorChannel,jdbcType=VARCHAR}
- where id = #{id,jdbcType=BIGINT}
- </update>
- <select id="selectChannelByList" resultType="com.juxiao.xchat.module.xbd.domain.marketing.HomeChannel">
- select id,channel,channel_name as channelName , is_news as isNews , type,group_id as groupId,home_default as homeDefault
- from home_channel
- where channel_name <![CDATA[ <> '' ]]>
- </select>
- <select id="selectHomeChannelByList" resultMap="BaseResultMap">
- select
- <include refid="Base_Column_List" />
- from home_channel
- where 1 = 1
- <if test="channel != null and channel != ''">
- and channel like "%"#{channel}"%"
- </if>
- <if test="superiorChannel != null and superiorChannel != ''">
- and superior_channel LIKE concat(concat('%',#{superiorChannel}),'%')
- </if>
- <if test="groupId != null">
- and group_id = #{groupId}
- </if>
- order by create_time desc
- </select>
- </mapper>
|