admin
2020-05-06 24a8d17e007545f7426c48352109aa1a9c6587ee
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
<?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.yeshi.fanli.dao.mybatis.user.UserLotteryRecordMapper">
  <resultMap id="BaseResultMap" type="com.yeshi.fanli.entity.bus.user.UserLotteryRecord">
    <id column="ulr_id" property="id" jdbcType="BIGINT"/>
    <result column="ulr_type" property="type" jdbcType="VARCHAR"/>
    <result column="ulr_uid" property="uid" jdbcType="BIGINT"/>
    <result column="ulr_count" property="count" jdbcType="INTEGER"/>
    <result column="ulr_create_time" property="createTime" jdbcType="TIMESTAMP"/>
    <result column="ulr_update_time" property="updateTime" jdbcType="TIMESTAMP"/>
  </resultMap>
  <sql id="Base_Column_List">ulr_id,ulr_type,ulr_uid,ulr_count,ulr_create_time,ulr_update_time</sql>
  <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Long">select
    <include refid="Base_Column_List"/>from yeshi_ec_user_lottery_record where ulr_id = #{id,jdbcType=BIGINT}
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">delete from yeshi_ec_user_lottery_record where ulr_id = #{id,jdbcType=BIGINT}</delete>
  <insert id="insert" parameterType="com.yeshi.fanli.entity.bus.user.UserLotteryRecord" useGeneratedKeys="true" keyProperty="id">insert into yeshi_ec_user_lottery_record (ulr_id,ulr_type,ulr_uid,ulr_count,ulr_create_time,ulr_update_time) values (#{id,jdbcType=BIGINT},#{type,jdbcType=VARCHAR},#{uid,jdbcType=BIGINT},#{count,jdbcType=INTEGER},#{createTime,jdbcType=TIMESTAMP},#{updateTime,jdbcType=TIMESTAMP})</insert>
  <insert id="insertSelective" parameterType="com.yeshi.fanli.entity.bus.user.UserLotteryRecord" useGeneratedKeys="true" keyProperty="id">insert into yeshi_ec_user_lottery_record
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="id != null">ulr_id,</if>
      <if test="type != null">ulr_type,</if>
      <if test="uid != null">ulr_uid,</if>
      <if test="count != null">ulr_count,</if>
      <if test="createTime != null">ulr_create_time,</if>
      <if test="updateTime != null">ulr_update_time,</if>
    </trim>values
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="id != null">#{id,jdbcType=BIGINT},</if>
      <if test="type != null">#{type,jdbcType=VARCHAR},</if>
      <if test="uid != null">#{uid,jdbcType=BIGINT},</if>
      <if test="count != null">#{count,jdbcType=INTEGER},</if>
      <if test="createTime != null">#{createTime,jdbcType=TIMESTAMP},</if>
      <if test="updateTime != null">#{updateTime,jdbcType=TIMESTAMP},</if>
    </trim>
  </insert>
  <update id="updateByPrimaryKey" parameterType="com.yeshi.fanli.entity.bus.user.UserLotteryRecord">update yeshi_ec_user_lottery_record set ulr_type = #{type,jdbcType=VARCHAR},ulr_uid = #{uid,jdbcType=BIGINT},ulr_count = #{count,jdbcType=INTEGER},ulr_create_time = #{createTime,jdbcType=TIMESTAMP},ulr_update_time = #{updateTime,jdbcType=TIMESTAMP} where ulr_id = #{id,jdbcType=BIGINT}</update>
  <update id="updateByPrimaryKeySelective" parameterType="com.yeshi.fanli.entity.bus.user.UserLotteryRecord">update yeshi_ec_user_lottery_record
    <set>
      <if test="type != null">ulr_type=#{type,jdbcType=VARCHAR},</if>
      <if test="uid != null">ulr_uid=#{uid,jdbcType=BIGINT},</if>
      <if test="count != null">ulr_count=#{count,jdbcType=INTEGER},</if>
      <if test="createTime != null">ulr_create_time=#{createTime,jdbcType=TIMESTAMP},</if>
      <if test="updateTime != null">ulr_update_time=#{updateTime,jdbcType=TIMESTAMP},</if>
    </set> where ulr_id = #{id,jdbcType=BIGINT}
  </update>
  
  <select id="getByTypeAndUid" resultMap="BaseResultMap">
      SELECT * FROM  yeshi_ec_user_lottery_record  t 
    WHERE t.`ulr_uid` = #{uid} AND  t.`ulr_type` = #{type} 
  </select>
  
</mapper>