admin
2020-05-20 98b1a0affd69bbe63223c21fdd2c404e8bedfccb
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
<?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.DeviceLotteryRecordMapper">
  <resultMap id="BaseResultMap" type="com.yeshi.fanli.entity.bus.user.DeviceLotteryRecord">
    <id column="dlr_id" property="id" jdbcType="BIGINT"/>
    <result column="dlr_platform" property="platform" jdbcType="INTEGER"/>
    <result column="dlr_device" property="device" jdbcType="VARCHAR"/>
    <result column="dlr_system_counpon_id" property="systemCouponId" jdbcType="BIGINT"/>
    <result column="dlr_create_time" property="createTime" jdbcType="TIMESTAMP"/>
  </resultMap>
  <sql id="Base_Column_List">dlr_id,dlr_platform,dlr_device,dlr_system_counpon_id,dlr_create_time</sql>
  <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Long">select
    <include refid="Base_Column_List"/>from yeshi_ec_device_lottery_record where dlr_id = #{id,jdbcType=BIGINT}
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">delete from yeshi_ec_device_lottery_record where dlr_id = #{id,jdbcType=BIGINT}</delete>
  <insert id="insert" parameterType="com.yeshi.fanli.entity.bus.user.DeviceLotteryRecord" useGeneratedKeys="true" keyProperty="id">insert into yeshi_ec_device_lottery_record (dlr_id,dlr_platform,dlr_device,dlr_system_counpon_id,dlr_create_time) values (#{id,jdbcType=BIGINT},#{platform,jdbcType=INTEGER},#{device,jdbcType=VARCHAR},#{systemCouponId,jdbcType=BIGINT},#{createTime,jdbcType=TIMESTAMP})</insert>
  <insert id="insertSelective" parameterType="com.yeshi.fanli.entity.bus.user.DeviceLotteryRecord" useGeneratedKeys="true" keyProperty="id">insert into yeshi_ec_device_lottery_record
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="id != null">dlr_id,</if>
      <if test="platform != null">dlr_platform,</if>
      <if test="device != null">dlr_device,</if>
      <if test="systemCouponId != null">dlr_system_counpon_id,</if>
      <if test="createTime != null">dlr_create_time,</if>
    </trim>values
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="id != null">#{id,jdbcType=BIGINT},</if>
      <if test="platform != null">#{platform,jdbcType=INTEGER},</if>
      <if test="device != null">#{device,jdbcType=VARCHAR},</if>
      <if test="systemCouponId != null">#{systemCouponId,jdbcType=BIGINT},</if>
      <if test="createTime != null">#{createTime,jdbcType=TIMESTAMP},</if>
    </trim>
  </insert>
  <update id="updateByPrimaryKey" parameterType="com.yeshi.fanli.entity.bus.user.DeviceLotteryRecord">update yeshi_ec_device_lottery_record set dlr_platform = #{platform,jdbcType=INTEGER},dlr_device = #{device,jdbcType=VARCHAR},dlr_system_counpon_id = #{systemCouponId,jdbcType=BIGINT},dlr_create_time = #{createTime,jdbcType=TIMESTAMP} where dlr_id = #{id,jdbcType=BIGINT}</update>
  <update id="updateByPrimaryKeySelective" parameterType="com.yeshi.fanli.entity.bus.user.DeviceLotteryRecord">update yeshi_ec_device_lottery_record
    <set>
      <if test="platform != null">dlr_platform=#{platform,jdbcType=INTEGER},</if>
      <if test="device != null">dlr_device=#{device,jdbcType=VARCHAR},</if>
      <if test="systemCouponId != null">dlr_system_counpon_id=#{systemCouponId,jdbcType=BIGINT},</if>
      <if test="createTime != null">dlr_create_time=#{createTime,jdbcType=TIMESTAMP},</if>
    </set> where dlr_id = #{id,jdbcType=BIGINT}
  </update>
  
  <select id="listByPlatformAndDevice" resultMap="BaseResultMap">
      SELECT * FROM yeshi_ec_device_lottery_record
      WHERE `dlr_platform` = #{platform} AND `dlr_device`= #{device}
  </select>
  
</mapper>