admin
2021-05-29 40d0d99fb89665e6e7702ea62e45fabe2d01e51a
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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
<?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.ks.vip.mapper.VipCenterMapper">
  <resultMap id="BaseResultMap" type="com.ks.vip.pojo.DO.VipCenter">
    <id column="v_uid" property="uid" jdbcType="VARCHAR"/>
    <result column="v_grade_id" property="gradeId" jdbcType="BIGINT"/>
    <result column="v_start_time" property="startTime" jdbcType="TIMESTAMP"/>
    <result column="v_end_time" property="endTime" jdbcType="TIMESTAMP"/>
    <result column="v_state" property="state" jdbcType="INTEGER"/>
    <result column="v_creator_id" property="creatorId" jdbcType="BIGINT"/>
    <result column="v_create_time" property="createTime" jdbcType="TIMESTAMP"/>
    <result column="v_updator_id" property="updatorId" jdbcType="BIGINT"/>
    <result column="v_update_time" property="updateTime" jdbcType="TIMESTAMP"/>
  </resultMap>
  <sql id="Base_Column_List">v_uid,v_grade_id,v_start_time,v_end_time,v_state,v_creator_id,v_create_time,v_updator_id,v_update_time</sql>
  <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.String">select
    <include refid="Base_Column_List"/>from vip_center where v_uid = #{uid,jdbcType=VARCHAR}
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.String">delete from vip_center where v_uid = #{uid,jdbcType=VARCHAR}</delete>
  <insert id="insert" parameterType="com.ks.vip.pojo.DO.VipCenter" useGeneratedKeys="true" keyProperty="id">insert into vip_center (v_uid,v_grade_id,v_start_time,v_end_time,v_state,v_creator_id,v_create_time,v_updator_id,v_update_time) values (#{uid,jdbcType=VARCHAR},#{gradeId,jdbcType=BIGINT},#{startTime,jdbcType=TIMESTAMP},#{endTime,jdbcType=TIMESTAMP},#{state,jdbcType=INTEGER},#{creatorId,jdbcType=BIGINT},#{createTime,jdbcType=TIMESTAMP},#{updatorId,jdbcType=BIGINT},#{updateTime,jdbcType=TIMESTAMP})</insert>
  <insert id="insertSelective" parameterType="com.ks.vip.pojo.DO.VipCenter" useGeneratedKeys="true" keyProperty="id">insert into vip_center
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="uid != null">v_uid,</if>
      <if test="gradeId != null">v_grade_id,</if>
      <if test="startTime != null">v_start_time,</if>
      <if test="endTime != null">v_end_time,</if>
      <if test="state != null">v_state,</if>
      <if test="creatorId != null">v_creator_id,</if>
      <if test="createTime != null">v_create_time,</if>
      <if test="updatorId != null">v_updator_id,</if>
      <if test="updateTime != null">v_update_time,</if>
    </trim>values
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="uid != null">#{uid,jdbcType=VARCHAR},</if>
      <if test="gradeId != null">#{gradeId,jdbcType=BIGINT},</if>
      <if test="startTime != null">#{startTime,jdbcType=TIMESTAMP},</if>
      <if test="endTime != null">#{endTime,jdbcType=TIMESTAMP},</if>
      <if test="state != null">#{state,jdbcType=INTEGER},</if>
      <if test="creatorId != null">#{creatorId,jdbcType=BIGINT},</if>
      <if test="createTime != null">#{createTime,jdbcType=TIMESTAMP},</if>
      <if test="updatorId != null">#{updatorId,jdbcType=BIGINT},</if>
      <if test="updateTime != null">#{updateTime,jdbcType=TIMESTAMP},</if>
    </trim>
  </insert>
  <update id="updateByPrimaryKey" parameterType="com.ks.vip.pojo.DO.VipCenter">update vip_center set v_grade_id = #{gradeId,jdbcType=BIGINT},v_start_time = #{startTime,jdbcType=TIMESTAMP},v_end_time = #{endTime,jdbcType=TIMESTAMP},v_state = #{state,jdbcType=INTEGER},v_creator_id = #{creatorId,jdbcType=BIGINT},v_create_time = #{createTime,jdbcType=TIMESTAMP},v_updator_id = #{updatorId,jdbcType=BIGINT},v_update_time = #{updateTime,jdbcType=TIMESTAMP} where v_uid = #{uid,jdbcType=VARCHAR}</update>
  <update id="updateByPrimaryKeySelective" parameterType="com.ks.vip.pojo.DO.VipCenter">update vip_center
    <set>
      <if test="gradeId != null">v_grade_id=#{gradeId,jdbcType=BIGINT},</if>
      <if test="startTime != null">v_start_time=#{startTime,jdbcType=TIMESTAMP},</if>
      <if test="endTime != null">v_end_time=#{endTime,jdbcType=TIMESTAMP},</if>
      <if test="state != null">v_state=#{state,jdbcType=INTEGER},</if>
      <if test="creatorId != null">v_creator_id=#{creatorId,jdbcType=BIGINT},</if>
      <if test="createTime != null">v_create_time=#{createTime,jdbcType=TIMESTAMP},</if>
      <if test="updatorId != null">v_updator_id=#{updatorId,jdbcType=BIGINT},</if>
      <if test="updateTime != null">v_update_time=#{updateTime,jdbcType=TIMESTAMP},</if>
    </set> where v_uid = #{uid,jdbcType=VARCHAR}
  </update>
 
  <!-- 非模板 -->
 
  <delete id="deteleByUid" parameterType="java.lang.String">delete from vip_center where v_uid = #{uid,jdbcType=VARCHAR}</delete>
 
  <select id="getByUid" resultMap="BaseResultMap" parameterType="java.lang.String">select
    <include refid="Base_Column_List"/>from vip_center where v_uid = #{uid,jdbcType=VARCHAR}
  </select>
 
 
  <select id="selectForUpdate" resultMap="BaseResultMap" parameterType="java.lang.String">
    SELECT <include refid="Base_Column_List"/> FROM vip_center
    WHERE v_uid = #{uid,jdbcType=VARCHAR} FOR UPDATE
  </select>
 
 
  <sql id="listWhere">
    <if test="query.uid!=null">and v_uid=#{query.uid}</if>
    <if test="query.gradeId!=null">and v_grade_id=#{query.gradeId}</if>
    <if test="query.state!=null">and v_state=#{query.state}</if>
  </sql>
 
 
  <select id="listByPage" resultMap="BaseResultMap">
    select <include refid="Base_Column_List"/>  from vip_center
    where 1=1
    <include refid="listWhere"/>
    limit #{query.start},#{query.count}
  </select>
 
  <select id="count" resultType="java.lang.Long">
    select count(*) from vip_center
    where 1=1
    <include refid="listWhere"/>
  </select>
 
 
  <select id="getByThreeOrderId" resultMap="BaseResultMap">
    select <include refid="Base_Column_List"/>  from vip_center
    where o_three_order_id=#{query.threeOrderId}
  </select>
 
 
</mapper>