| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160 |
- <?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.goafanti.common.dao.BannersMapper">
- <resultMap id="BaseResultMap" type="com.goafanti.common.model.Banners">
- <id column="id" jdbcType="BIGINT" property="id" />
- <result column="sign" jdbcType="VARCHAR" property="sign" />
- <result column="text" jdbcType="VARCHAR" property="text" />
- <result column="imgUrl" jdbcType="VARCHAR" property="imgurl" />
- <result column="url" jdbcType="VARCHAR" property="url" />
- <result column="width" jdbcType="INTEGER" property="width" />
- <result column="height" jdbcType="INTEGER" property="height" />
- <result column="start_date" jdbcType="TIMESTAMP" property="startDate" />
- <result column="end_date" jdbcType="TIMESTAMP" property="endDate" />
- </resultMap>
- <sql id="Base_Column_List">
- id, sign, text, imgUrl, url, width, height, start_date, end_date
- </sql>
- <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
- select
- <include refid="Base_Column_List" />
- from banners
- where id = #{id,jdbcType=BIGINT}
- </select>
- <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
- delete from banners
- where id = #{id,jdbcType=BIGINT}
- </delete>
- <insert id="insert" parameterType="com.goafanti.common.model.Banners">
- insert into banners (id, sign, text,
- imgUrl, url, width,
- height, start_date, end_date
- )
- values (#{id,jdbcType=BIGINT}, #{sign,jdbcType=VARCHAR}, #{text,jdbcType=VARCHAR},
- #{imgurl,jdbcType=VARCHAR}, #{url,jdbcType=VARCHAR}, #{width,jdbcType=INTEGER},
- #{height,jdbcType=INTEGER}, #{startDate,jdbcType=TIMESTAMP}, #{endDate,jdbcType=TIMESTAMP}
- )
- </insert>
- <insert id="insertSelective" parameterType="com.goafanti.common.model.Banners">
- insert into banners
- <trim prefix="(" suffix=")" suffixOverrides=",">
- <if test="id != null">
- id,
- </if>
- <if test="sign != null">
- sign,
- </if>
- <if test="text != null">
- text,
- </if>
- <if test="imgurl != null">
- imgUrl,
- </if>
- <if test="url != null">
- url,
- </if>
- <if test="width != null">
- width,
- </if>
- <if test="height != null">
- height,
- </if>
- <if test="startDate != null">
- start_date,
- </if>
- <if test="endDate != null">
- end_date,
- </if>
- </trim>
- <trim prefix="values (" suffix=")" suffixOverrides=",">
- <if test="id != null">
- #{id,jdbcType=BIGINT},
- </if>
- <if test="sign != null">
- #{sign,jdbcType=VARCHAR},
- </if>
- <if test="text != null">
- #{text,jdbcType=VARCHAR},
- </if>
- <if test="imgurl != null">
- #{imgurl,jdbcType=VARCHAR},
- </if>
- <if test="url != null">
- #{url,jdbcType=VARCHAR},
- </if>
- <if test="width != null">
- #{width,jdbcType=INTEGER},
- </if>
- <if test="height != null">
- #{height,jdbcType=INTEGER},
- </if>
- <if test="startDate != null">
- #{startDate,jdbcType=TIMESTAMP},
- </if>
- <if test="endDate != null">
- #{endDate,jdbcType=TIMESTAMP},
- </if>
- </trim>
- </insert>
- <update id="updateByPrimaryKeySelective" parameterType="com.goafanti.common.model.Banners">
- update banners
- <set>
- <if test="sign != null">
- sign = #{sign,jdbcType=VARCHAR},
- </if>
- <if test="text != null">
- text = #{text,jdbcType=VARCHAR},
- </if>
- <if test="imgurl != null">
- imgUrl = #{imgurl,jdbcType=VARCHAR},
- </if>
- <if test="url != null">
- url = #{url,jdbcType=VARCHAR},
- </if>
- <if test="width != null">
- width = #{width,jdbcType=INTEGER},
- </if>
- <if test="height != null">
- height = #{height,jdbcType=INTEGER},
- </if>
- <if test="startDate != null">
- start_date = #{startDate,jdbcType=TIMESTAMP},
- </if>
- <if test="endDate != null">
- end_date = #{endDate,jdbcType=TIMESTAMP},
- </if>
- </set>
- where id = #{id,jdbcType=BIGINT}
- </update>
- <update id="updateByPrimaryKey" parameterType="com.goafanti.common.model.Banners">
- update banners
- set sign = #{sign,jdbcType=VARCHAR},
- text = #{text,jdbcType=VARCHAR},
- imgUrl = #{imgurl,jdbcType=VARCHAR},
- url = #{url,jdbcType=VARCHAR},
- width = #{width,jdbcType=INTEGER},
- height = #{height,jdbcType=INTEGER},
- start_date = #{startDate,jdbcType=TIMESTAMP},
- end_date = #{endDate,jdbcType=TIMESTAMP}
- where id = #{id,jdbcType=BIGINT}
- </update>
- <select id="findBannerList" resultMap="BaseResultMap">
- select
- <include refid="Base_Column_List" />
- from banners where 1=1
- <if test="sign != null">
- and sign = #{sign,jdbcType=VARCHAR}
- </if>
- order by id desc
- <if test="pageNo != null and pageSize != null">
- limit #{pageNo,jdbcType=INTEGER}, #{pageSize,jdbcType=INTEGER}
- </if>
- </select>
- <select id="findBannerListCount" parameterType="java.lang.String" resultType="java.lang.Integer">
- select count(1)
- from banners where 1=1
- <if test="sign != null">
- and sign = #{sign,jdbcType=VARCHAR}
- </if>
- </select>
- </mapper>
|