123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166 |
- <?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.users.UserDrawPrettyErbanNoMapper">
- <resultMap id="BaseResultMap" type="com.juxiao.xchat.module.xbd.domain.users.UserDrawPrettyErbanNo" >
- <id column="pretty_erban_no" property="prettyErbanNo" jdbcType="BIGINT" />
- <result column="type" property="type" jdbcType="TINYINT" />
- <result column="use_status" property="useStatus" jdbcType="TINYINT" />
- <result column="use_erban_no" property="useErbanNo" jdbcType="BIGINT" />
- <result column="seq" property="seq" jdbcType="TINYINT" />
- <result column="create_time" property="createTime" jdbcType="TIMESTAMP" />
- <result column="status" property="status" jdbcType="TINYINT" />
- <result column="uid" property="uid" jdbcType="BIGINT" />
- </resultMap>
- <sql id="Base_Column_List" >
- pretty_erban_no, type, use_status, use_erban_no, seq, create_time,uid,status
- </sql>
- <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Long" >
- select
- <include refid="Base_Column_List" />
- from user_draw_pretty_erban_no
- where pretty_erban_no = #{prettyErBanNo}
- </select>
- <insert id="insert" parameterType="com.juxiao.xchat.module.xbd.domain.users.UserDrawPrettyErbanNo" >
- insert into user_draw_pretty_erban_no (pretty_erban_no, type, use_status,
- use_erban_no, seq, create_time,uid,status
- )
- values (#{prettyErbanNo,jdbcType=BIGINT}, #{type,jdbcType=TINYINT}, #{useStatus,jdbcType=TINYINT},
- #{useErbanNo,jdbcType=BIGINT}, #{seq,jdbcType=TINYINT}, #{createTime,jdbcType=TIMESTAMP},
- #{uid,jdbcType=BIGINT},#{status,jdbcType=TINYINT}
- )
- </insert>
- <insert id="insertSelective" parameterType="com.juxiao.xchat.module.xbd.domain.users.UserDrawPrettyErbanNo" >
- insert into user_draw_pretty_erban_no
- <trim prefix="(" suffix=")" suffixOverrides="," >
- <if test="prettyErbanNo != null" >
- pretty_erban_no,
- </if>
- <if test="type != null" >
- type,
- </if>
- <if test="useStatus != null" >
- use_status,
- </if>
- <if test="useErbanNo != null" >
- use_erban_no,
- </if>
- <if test="seq != null" >
- seq,
- </if>
- <if test="createTime != null" >
- create_time,
- </if>
- <if test="uid != null" >
- uid,
- </if>
- <if test="status != null" >
- status,
- </if>
- </trim>
- <trim prefix="values (" suffix=")" suffixOverrides="," >
- <if test="prettyErbanNo != null" >
- #{prettyErbanNo,jdbcType=BIGINT},
- </if>
- <if test="type != null" >
- #{type,jdbcType=TINYINT},
- </if>
- <if test="useStatus != null" >
- #{useStatus,jdbcType=TINYINT},
- </if>
- <if test="useErbanNo != null" >
- #{useErbanNo,jdbcType=BIGINT},
- </if>
- <if test="seq != null" >
- #{seq,jdbcType=TINYINT},
- </if>
- <if test="createTime != null" >
- #{createTime,jdbcType=TIMESTAMP},
- </if>
- <if test="uid != null" >
- #{uid,jdbcType=BIGINT},
- </if>
- <if test="status != null" >
- #{status,jdbcType=TINYINT},
- </if>
- </trim>
- </insert>
- <update id="updateByPrimaryKeySelective" parameterType="com.juxiao.xchat.module.xbd.domain.users.UserDrawPrettyErbanNo" >
- update user_draw_pretty_erban_no
- <set >
- <if test="type != null" >
- type = #{type,jdbcType=TINYINT},
- </if>
- <if test="useStatus != null" >
- use_status = #{useStatus,jdbcType=TINYINT},
- </if>
- <if test="useErbanNo != null" >
- use_erban_no = #{useErbanNo,jdbcType=BIGINT},
- </if>
- <if test="seq != null" >
- seq = #{seq,jdbcType=TINYINT},
- </if>
- <if test="createTime != null" >
- create_time = #{createTime,jdbcType=TIMESTAMP},
- </if>
- <if test="uid != null" >
- uid = #{uid,jdbcType=BIGINT},
- </if>
- <if test="status != null" >
- status = #{status,jdbcType=TINYINT},
- </if>
- </set>
- where pretty_erban_no = #{prettyErbanNo,jdbcType=BIGINT}
- </update>
- <update id="updateByPrimaryKey" parameterType="com.juxiao.xchat.module.xbd.domain.users.UserDrawPrettyErbanNo" >
- update user_draw_pretty_erban_no
- set type = #{type,jdbcType=TINYINT},
- use_status = #{useStatus,jdbcType=TINYINT},
- use_erban_no = #{useErbanNo,jdbcType=BIGINT},
- seq = #{seq,jdbcType=TINYINT},
- create_time = #{createTime,jdbcType=TIMESTAMP},
- uid = #{useErbanNo,jdbcType=BIGINT},
- status = #{useStatus,jdbcType=TINYINT}
- where pretty_erban_no = #{prettyErbanNo,jdbcType=BIGINT}
- </update>
- <delete id="deleteByPrimaryKey" parameterType="java.lang.Long" >
- delete from user_draw_pretty_erban_no
- where pretty_erban_no = #{prettyErBanNo}
- </delete>
- <select id="selectUserPrettyNoByList" resultType="com.juxiao.xchat.module.xbd.vo.UserPrettyNoVO">
- SELECT p.pretty_erban_no as prettyErbanNo,p.type as type, p.use_status as useStatus,p.create_time as createTime,p.use_erban_no as erbanNo,
- u.uid as uid,u.has_pretty_erban_no as hasPrettyErbanNo,u.nick as nick, p.seq,p.uid,p.status
- FROM user_draw_pretty_erban_no p LEFT JOIN users u ON p.pretty_erban_no=u.erban_no
- <where>
- <if test="prettyErBanNo!=null">
- p.pretty_erban_no=#{prettyErBanNo}
- </if>
- <if test="beginDate!=null">
- AND p.create_time >= #{beginDate}
- </if>
- <if test="endDate!=null">
- AND p.create_time <= #{endDate}
- </if>
- <if test="status!=null">
- AND p.status = #{status}
- </if>
- <if test="type!=null">
- AND p.type = #{type}
- </if>
- </where>
- order by p.use_status asc, p.seq asc, p.create_time asc
- </select>
- </mapper>
|