admin
2022-08-25 c9db68e33f90231b064b8864fc69ccf7d25f5e0b
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
<?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.lijin.mapper.LiJinProviderLinkMapper">
  <resultMap id="BaseResultMap" type="com.ks.lijin.pojo.DO.LiJinProviderLink">
    <id column="lk_id" property="id" jdbcType="BIGINT"/>
    <result column="lk_provider_id" property="providerId" jdbcType="BIGINT"/>
    <result column="lk_link" property="link" jdbcType="VARCHAR"/>
    <result column="lk_money" property="money" jdbcType="DECIMAL"/>
    <result column="lk_type" property="type" jdbcType="VARCHAR"/>
    <result column="lk_effect_time" property="effectTime" jdbcType="TIMESTAMP"/>
    <result column="lk_expire_time" property="expireTime" jdbcType="TIMESTAMP"/>
    <result column="lk_state" property="state" jdbcType="INTEGER"/>
    <result column="lk_creator_id" property="creatorId" jdbcType="BIGINT"/>
    <result column="lk_create_time" property="createTime" jdbcType="TIMESTAMP"/>
    <result column="lk_updator_id" property="updatorId" jdbcType="BIGINT"/>
    <result column="lk_update_time" property="updateTime" jdbcType="TIMESTAMP"/>
  </resultMap>
  <sql id="Base_Column_List">lk_id,lk_provider_id,lk_link,lk_money,lk_type,lk_effect_time,lk_expire_time,lk_state,lk_creator_id,lk_create_time,lk_updator_id,lk_update_time</sql>
  <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Long">select
    <include refid="Base_Column_List"/>from tlj_provider_link where lk_id = #{id,jdbcType=BIGINT}
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">delete from tlj_provider_link where lk_id = #{id,jdbcType=BIGINT}</delete>
  <insert id="insert" parameterType="com.ks.lijin.pojo.DO.LiJinProviderLink" useGeneratedKeys="true" keyProperty="id">insert into tlj_provider_link (lk_id, lk_provider_id, lk_link, lk_money, lk_type, lk_effect_time, lk_expire_time, lk_state, lk_creator_id, lk_create_time, lk_updator_id, lk_update_time)values (#{id,jdbcType=BIGINT}, #{providerId,jdbcType=BIGINT}, #{link,jdbcType=VARCHAR}, #{money,jdbcType=DECIMAL}, #{type,jdbcType=VARCHAR}, #{effectTime,jdbcType=TIMESTAMP}, #{expireTime,jdbcType=TIMESTAMP}, #{state,jdbcType=INTEGER}, #{creatorId,jdbcType=BIGINT}, #{createTime,jdbcType=TIMESTAMP}, #{updatorId,jdbcType=BIGINT}, #{updateTime,jdbcType=TIMESTAMP})</insert>
  <insert id="insertSelective" parameterType="com.ks.lijin.pojo.DO.LiJinProviderLink" useGeneratedKeys="true" keyProperty="id">insert into tlj_provider_link
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="id != null">lk_id,</if>
      <if test="providerId != null">lk_provider_id,</if>
      <if test="link != null">lk_link,</if>
      <if test="money != null">lk_money,</if>
      <if test="type != null">lk_type,</if>
      <if test="effectTime != null">lk_effect_time,</if>
      <if test="expireTime != null">lk_expire_time,</if>
      <if test="state != null">lk_state,</if>
      <if test="creatorId != null">lk_creator_id,</if>
      <if test="createTime != null">lk_create_time,</if>
      <if test="updatorId != null">lk_updator_id,</if>
      <if test="updateTime != null">lk_update_time,</if>
    </trim>values
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="id != null">#{id,jdbcType=BIGINT},</if>
      <if test="providerId != null">#{providerId,jdbcType=BIGINT},</if>
      <if test="link != null">#{link,jdbcType=VARCHAR},</if>
      <if test="money != null">#{money,jdbcType=DECIMAL},</if>
      <if test="type != null">#{type,jdbcType=VARCHAR},</if>
      <if test="effectTime != null">#{effectTime,jdbcType=TIMESTAMP},</if>
      <if test="expireTime != null">#{expireTime,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.lijin.pojo.DO.LiJinProviderLink">update tlj_provider_link set lk_provider_id = #{providerId,jdbcType=BIGINT},lk_link = #{link,jdbcType=VARCHAR},lk_money = #{money,jdbcType=DECIMAL},lk_type = #{type,jdbcType=VARCHAR},lk_effect_time = #{effectTime,jdbcType=TIMESTAMP},lk_expire_time = #{expireTime,jdbcType=TIMESTAMP},lk_state = #{state,jdbcType=INTEGER},lk_creator_id = #{creatorId,jdbcType=BIGINT},lk_create_time = #{createTime,jdbcType=TIMESTAMP},lk_updator_id = #{updatorId,jdbcType=BIGINT},lk_update_time = #{updateTime,jdbcType=TIMESTAMP}where lk_id = #{id,jdbcType=BIGINT}</update>
  <update id="updateByPrimaryKeySelective" parameterType="com.ks.lijin.pojo.DO.LiJinProviderLink">update tlj_provider_link
    <set>
      <if test="providerId != null">lk_provider_id=#{providerId,jdbcType=BIGINT},</if>
      <if test="link != null">lk_link=#{link,jdbcType=VARCHAR},</if>
      <if test="money != null">lk_money=#{money,jdbcType=DECIMAL},</if>
      <if test="type != null">lk_type=#{type,jdbcType=VARCHAR},</if>
      <if test="effectTime != null">lk_effect_time=#{effectTime,jdbcType=TIMESTAMP},</if>
      <if test="expireTime != null">lk_expire_time=#{expireTime,jdbcType=TIMESTAMP},</if>
      <if test="state != null">lk_state=#{state,jdbcType=INTEGER},</if>
      <if test="creatorId != null">lk_creator_id=#{creatorId,jdbcType=BIGINT},</if>
      <if test="createTime != null">lk_create_time=#{createTime,jdbcType=TIMESTAMP},</if>
      <if test="updatorId != null">lk_updator_id=#{updatorId,jdbcType=BIGINT},</if>
      <if test="updateTime != null">lk_update_time=#{updateTime,jdbcType=TIMESTAMP},</if>
    </set> where lk_id = #{id,jdbcType=BIGINT}
  </update>
 
 
  <!-- 非模板 -->
  <sql id="listWhere">
    <if test="query.id!=null">and lk_id=#{query.id}</if>
    <if test="query.link!=null and query.link!='' ">and lk_link like "%"#{query.link}"%"</if>
    <if test="query.type!=null and query.type!=''">and lk_type=#{query.type}</if>
    <if test="query.state!=null">and lk_state=#{query.state}</if>
  </sql>
 
 
  <select id="listByPage" resultMap="BaseResultMap">
    select <include refid="Base_Column_List"/>   from tlj_provider_link
    where 1=1
    <include refid="listWhere"/>
    limit #{query.start},#{query.count}
  </select>
 
  <select id="count" resultType="java.lang.Long">
    select count(*) from tlj_provider_link
    where 1=1
    <include refid="listWhere"/>
  </select>
 
</mapper>