123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227 |
- <?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.home.BannerMapper">
- <resultMap id="BaseResultMap" type="com.juxiao.xchat.module.xbd.domain.home.Banner" >
- <id column="banner_id" property="bannerId" jdbcType="INTEGER" />
- <result column="banner_name" property="bannerName" jdbcType="VARCHAR" />
- <result column="banner_pic" property="bannerPic" jdbcType="VARCHAR" />
- <result column="skip_type" property="skipType" jdbcType="TINYINT" />
- <result column="skip_uri" property="skipUri" jdbcType="VARCHAR" />
- <result column="seq_no" property="seqNo" jdbcType="INTEGER" />
- <result column="os_type" property="osType" jdbcType="TINYINT" />
- <result column="is_new_user" property="isNewUser" jdbcType="TINYINT" />
- <result column="app_type" property="appType" jdbcType="TINYINT" />
- <result column="banner_status" property="bannerStatus" jdbcType="TINYINT" />
- <result column="start_time" property="startTime" jdbcType="VARCHAR" />
- <result column="end_time" property="endTime" jdbcType="VARCHAR" />
- <result column="create_tiem" property="createTiem" jdbcType="TIMESTAMP" />
- <result column="view_type" property="viewType" jdbcType="TINYINT" />
- </resultMap>
- <sql id="Base_Column_List" >
- banner_id, banner_name, banner_pic, skip_type, skip_uri, seq_no, os_type, is_new_user,
- app_type, banner_status, start_time, end_time, create_tiem, view_type
- </sql>
- <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
- select
- <include refid="Base_Column_List" />
- from banner
- where banner_id = #{bannerId,jdbcType=INTEGER}
- </select>
- <insert id="insert" parameterType="com.juxiao.xchat.module.xbd.domain.home.Banner" >
- insert into banner (banner_id, banner_name, banner_pic,
- skip_type, skip_uri, seq_no,
- os_type, is_new_user, app_type,
- banner_status, start_time, end_time,
- create_tiem, view_type)
- values (#{bannerId,jdbcType=INTEGER}, #{bannerName,jdbcType=VARCHAR}, #{bannerPic,jdbcType=VARCHAR},
- #{skipType,jdbcType=TINYINT}, #{skipUri,jdbcType=VARCHAR}, #{seqNo,jdbcType=INTEGER},
- #{osType,jdbcType=TINYINT}, #{isNewUser,jdbcType=TINYINT}, #{appType,jdbcType=TINYINT},
- #{bannerStatus,jdbcType=TINYINT}, #{startTime,jdbcType=VARCHAR}, #{endTime,jdbcType=VARCHAR},
- #{createTiem,jdbcType=TIMESTAMP}, #{viewType,jdbcType=TINYINT})
- </insert>
- <insert id="insertSelective" parameterType="com.juxiao.xchat.module.xbd.domain.home.Banner" >
- insert into banner
- <trim prefix="(" suffix=")" suffixOverrides="," >
- <if test="bannerId != null" >
- banner_id,
- </if>
- <if test="bannerName != null" >
- banner_name,
- </if>
- <if test="bannerPic != null" >
- banner_pic,
- </if>
- <if test="skipType != null" >
- skip_type,
- </if>
- <if test="skipUri != null" >
- skip_uri,
- </if>
- <if test="seqNo != null" >
- seq_no,
- </if>
- <if test="osType != null" >
- os_type,
- </if>
- <if test="isNewUser != null" >
- is_new_user,
- </if>
- <if test="appType != null" >
- app_type,
- </if>
- <if test="bannerStatus != null" >
- banner_status,
- </if>
- <if test="startTime != null" >
- start_time,
- </if>
- <if test="endTime != null" >
- end_time,
- </if>
- <if test="createTiem != null" >
- create_tiem,
- </if>
- <if test="viewType != null" >
- view_type,
- </if>
- </trim>
- <trim prefix="values (" suffix=")" suffixOverrides="," >
- <if test="bannerId != null" >
- #{bannerId,jdbcType=INTEGER},
- </if>
- <if test="bannerName != null" >
- #{bannerName,jdbcType=VARCHAR},
- </if>
- <if test="bannerPic != null" >
- #{bannerPic,jdbcType=VARCHAR},
- </if>
- <if test="skipType != null" >
- #{skipType,jdbcType=TINYINT},
- </if>
- <if test="skipUri != null" >
- #{skipUri,jdbcType=VARCHAR},
- </if>
- <if test="seqNo != null" >
- #{seqNo,jdbcType=INTEGER},
- </if>
- <if test="osType != null" >
- #{osType,jdbcType=TINYINT},
- </if>
- <if test="isNewUser != null" >
- #{isNewUser,jdbcType=TINYINT},
- </if>
- <if test="appType != null" >
- #{appType,jdbcType=TINYINT},
- </if>
- <if test="bannerStatus != null" >
- #{bannerStatus,jdbcType=TINYINT},
- </if>
- <if test="startTime != null" >
- #{startTime,jdbcType=VARCHAR},
- </if>
- <if test="endTime != null" >
- #{endTime,jdbcType=VARCHAR},
- </if>
- <if test="createTiem != null" >
- #{createTiem,jdbcType=TIMESTAMP},
- </if>
- <if test="viewType != null" >
- #{viewType,jdbcType=TINYINT},
- </if>
- </trim>
- </insert>
- <update id="updateByPrimaryKeySelective" parameterType="com.juxiao.xchat.module.xbd.domain.home.Banner" >
- update banner
- <set >
- <if test="bannerName != null" >
- banner_name = #{bannerName,jdbcType=VARCHAR},
- </if>
- <if test="bannerPic != null" >
- banner_pic = #{bannerPic,jdbcType=VARCHAR},
- </if>
- <if test="skipType != null" >
- skip_type = #{skipType,jdbcType=TINYINT},
- </if>
- <if test="skipUri != null" >
- skip_uri = #{skipUri,jdbcType=VARCHAR},
- </if>
- <if test="seqNo != null" >
- seq_no = #{seqNo,jdbcType=INTEGER},
- </if>
- <if test="osType != null" >
- os_type = #{osType,jdbcType=TINYINT},
- </if>
- <if test="isNewUser != null" >
- is_new_user = #{isNewUser,jdbcType=TINYINT},
- </if>
- <if test="appType != null" >
- app_type = #{appType,jdbcType=TINYINT},
- </if>
- <if test="bannerStatus != null" >
- banner_status = #{bannerStatus,jdbcType=TINYINT},
- </if>
- <if test="startTime != null" >
- start_time = #{startTime,jdbcType=VARCHAR},
- </if>
- <if test="endTime != null" >
- end_time = #{endTime,jdbcType=VARCHAR},
- </if>
- <if test="createTiem != null" >
- create_tiem = #{createTiem,jdbcType=TIMESTAMP},
- </if>
- <if test="viewType != null" >
- view_type = #{viewType,jdbcType=TINYINT},
- </if>
- </set>
- where banner_id = #{bannerId,jdbcType=INTEGER}
- </update>
- <update id="updateByPrimaryKey" parameterType="com.juxiao.xchat.module.xbd.domain.home.Banner" >
- update banner
- set banner_name = #{bannerName,jdbcType=VARCHAR},
- banner_pic = #{bannerPic,jdbcType=VARCHAR},
- skip_type = #{skipType,jdbcType=TINYINT},
- skip_uri = #{skipUri,jdbcType=VARCHAR},
- seq_no = #{seqNo,jdbcType=INTEGER},
- os_type = #{osType,jdbcType=TINYINT},
- is_new_user = #{isNewUser,jdbcType=TINYINT},
- app_type = #{appType,jdbcType=TINYINT},
- banner_status = #{bannerStatus,jdbcType=TINYINT},
- start_time = #{startTime,jdbcType=VARCHAR},
- end_time = #{endTime,jdbcType=VARCHAR},
- create_tiem = #{createTiem,jdbcType=TIMESTAMP},
- view_type = #{viewType,jdbcType=TINYINT}
- where banner_id = #{bannerId,jdbcType=INTEGER}
- </update>
- <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
- delete from banner
- where banner_id = #{bannerId,jdbcType=INTEGER}
- </delete>
- <select id="selectBannerByList" resultMap="BaseResultMap">
- select
- <include refid="Base_Column_List" />
- from banner
- where 1 = 1
- <if test="skipType">
- and skip_type = #{skipType}
- </if>
- <if test="bannerStatus">
- and banner_status = #{bannerStatus}
- </if>
- <if test="viewType">
- and view_type = #{viewType}
- </if>
- order by start_time desc
- </select>
- </mapper>
|