admin
2025-08-20 f318c9c7c127b00f353bf45f273096d1dc4b424f
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
103
104
105
106
107
108
109
110
111
<?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.taoke.autopay.dao.agent.ChannelAgentMapper"> 
  <resultMap id="BaseResultMap" type="com.taoke.autopay.entity.agent.ChannelAgent"> 
    <id column="_id" property="id" jdbcType="BIGINT"/>  
    <result column="_name" property="name" jdbcType="VARCHAR"/>  
    <result column="_alias" property="alias" jdbcType="VARCHAR"/>  
    <result column="_account" property="account" jdbcType="VARCHAR"/>  
    <result column="_pwd" property="pwd" jdbcType="VARCHAR"/>  
    <result column="_alipay_name" property="alipayName" jdbcType="VARCHAR"/>  
    <result column="_alipay_account" property="alipayAccount" jdbcType="VARCHAR"/>  
    <result column="_alipay_update_time" property="alipayUpdateTime" jdbcType="TIMESTAMP"/>  
    <result column="_status" property="status" jdbcType="INTEGER"/>  
    <result column="_status_desc" property="statusDesc" jdbcType="VARCHAR"/>  
    <result column="_create_time" property="createTime" jdbcType="TIMESTAMP"/>  
    <result column="_update_time" property="updateTime" jdbcType="TIMESTAMP"/>  
    <result column="_id" property="id" jdbcType="BIGINT"/>  
    <result column="_shielded_areas" property="shieldedAreas" jdbcType="VARCHAR"/>
  </resultMap>  
  <sql id="Base_Column_List">_id ,_name,_alias,_account,_pwd,_alipay_name,_alipay_account,_alipay_update_time,_status,_status_desc,_create_time,_update_time,_shielded_areas</sql>  
  <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Long">select 
    <include refid="Base_Column_List"/> from table_agent where _id = #{id,jdbcType=BIGINT}
  </select>  
  <select id="selectByPrimaryKeyForUpdate" resultMap="BaseResultMap" parameterType="java.lang.Long">select 
    <include refid="Base_Column_List"/> from table_agent where _id = #{id,jdbcType=BIGINT} for update
  </select>  
  <sql id="listWhereSQL"> 
    <if test="query.id!=null">AND _id = #{query.id}</if>  
    <if test="query.searchKey!=null">AND (_name like '%${query.searchKey}%' or _alias = #{query.searchKey} )</if>  
    <if test="query.name!=null">AND _name like '%${query.name}%'</if>  
    <if test="query.alias!=null">AND _alias = #{query.alias}</if>  
    <if test="query.account!=null">AND _account = #{query.account}</if>  
    <if test="query.pwd!=null">AND _pwd = #{query.pwd}</if>  
    <if test="query.alipayName!=null">AND _alipay_name = #{query.alipayName}</if>  
    <if test="query.alipayAccount!=null">AND _alipay_account = #{query.alipayAccount}</if>  
    <if test="query.minAlipayUpdateTime!=null">AND _alipay_update_time &gt;= #{query.minAlipayUpdateTime}</if>  
    <if test="query.maxAlipayUpdateTime!=null">AND #{query.maxAlipayUpdateTime} &gt; _alipay_update_time</if>  
    <if test="query.status!=null">AND _status = #{query.status}</if>
    <if test="query.statusDesc!=null">AND _status_desc = #{query.statusDesc}</if>  
    <if test="query.minCreateTime!=null">AND _create_time &gt;= #{query.minCreateTime}</if>  
    <if test="query.maxCreateTime!=null">AND #{query.maxCreateTime} &gt; _create_time</if>  
    <if test="query.minUpdateTime!=null">AND _update_time &gt;= #{query.minUpdateTime}</if>  
    <if test="query.maxUpdateTime!=null">AND #{query.maxUpdateTime} &gt; _update_time</if> 
  </sql>  
  <select id="list" resultMap="BaseResultMap">select 
    <include refid="Base_Column_List"/> from table_agent where 1=1 
    <include refid="listWhereSQL"/>  
    <if test="query.sortList!=null"> 
      <foreach collection="query.sortList" item="item" open=" order by " separator=",">${item}</foreach> 
    </if> limit #{query.start},#{query.count}
  </select>  
  <select id="listByIds" resultMap="BaseResultMap">select 
    <include refid="Base_Column_List"/> from table_agent where 1=1 
    <foreach collection="ids" item="item" open=" AND (" close=")" separator=" or ">_id=#{item}</foreach> 
  </select>  
  <select id="count" resultType="java.lang.Long">select count(*) from table_agent where 1=1 
    <include refid="listWhereSQL"/> 
  </select>  
  <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">delete from table_agent where _id = #{id,jdbcType=BIGINT}</delete>  
  <insert id="insert" parameterType="com.taoke.autopay.entity.agent.ChannelAgent" useGeneratedKeys="true" keyProperty="id">insert into table_agent (_id, _name, _alias, _account, _pwd, _alipay_name, _alipay_account, _alipay_update_time, _status, _status_desc, _create_time, _update_time,_id,_shielded_areas) values (#{id,jdbcType=BIGINT}, #{name,jdbcType=VARCHAR}, #{alias,jdbcType=VARCHAR}, #{account,jdbcType=VARCHAR}, #{pwd,jdbcType=VARCHAR}, #{alipayName,jdbcType=VARCHAR}, #{alipayAccount,jdbcType=VARCHAR}, #{alipayUpdateTime,jdbcType=TIMESTAMP}, #{status,jdbcType=INTEGER}, #{statusDesc,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP},#{id,jdbcType=BIGINT},#{shieldedAreas,jdbcType=VARCHAR})</insert>  
  <insert id="insertSelective" parameterType="com.taoke.autopay.entity.agent.ChannelAgent" useGeneratedKeys="true" keyProperty="id">insert into table_agent 
    <trim prefix="(" suffix=")" suffixOverrides=","> 
      <if test="id != null">_id,</if>  
      <if test="name != null">_name,</if>  
      <if test="alias != null">_alias,</if>  
      <if test="account != null">_account,</if>  
      <if test="pwd != null">_pwd,</if>  
      <if test="alipayName != null">_alipay_name,</if>  
      <if test="alipayAccount != null">_alipay_account,</if>  
      <if test="alipayUpdateTime != null">_alipay_update_time,</if>  
      <if test="status != null">_status,</if>  
      <if test="statusDesc != null">_status_desc,</if>  
      <if test="createTime != null">_create_time,</if>  
      <if test="updateTime != null">_update_time,</if>  
      <if test="shieldedAreas != null">_shielded_areas,</if>
    </trim> values 
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="id != null">#{id,jdbcType=BIGINT},</if>
      <if test="name != null">#{name,jdbcType=VARCHAR},</if>
      <if test="alias != null">#{alias,jdbcType=VARCHAR},</if>  
      <if test="account != null">#{account,jdbcType=VARCHAR},</if>  
      <if test="pwd != null">#{pwd,jdbcType=VARCHAR},</if>  
      <if test="alipayName != null">#{alipayName,jdbcType=VARCHAR},</if>  
      <if test="alipayAccount != null">#{alipayAccount,jdbcType=VARCHAR},</if>  
      <if test="alipayUpdateTime != null">#{alipayUpdateTime,jdbcType=TIMESTAMP},</if>  
      <if test="status != null">#{status,jdbcType=INTEGER},</if>  
      <if test="statusDesc != null">#{statusDesc,jdbcType=VARCHAR},</if>  
      <if test="createTime != null">#{createTime,jdbcType=TIMESTAMP},</if>  
      <if test="updateTime != null">#{updateTime,jdbcType=TIMESTAMP},</if>  
      <if test="shieldedAreas != null">#{shieldedAreas,jdbcType=VARCHAR}</if> 
    </trim> 
  </insert>  
  <update id="updateByPrimaryKey" parameterType="com.taoke.autopay.entity.agent.ChannelAgent">update table_agent set _name = #{name,jdbcType=VARCHAR}, _alias = #{alias,jdbcType=VARCHAR}, _account = #{account,jdbcType=VARCHAR}, _pwd = #{pwd,jdbcType=VARCHAR}, _alipay_name = #{alipayName,jdbcType=VARCHAR}, _alipay_account = #{alipayAccount,jdbcType=VARCHAR}, _alipay_update_time = #{alipayUpdateTime,jdbcType=TIMESTAMP}, _status = #{status,jdbcType=INTEGER}, _status_desc = #{statusDesc,jdbcType=VARCHAR}, _create_time = #{createTime,jdbcType=TIMESTAMP}, _update_time = #{updateTime,jdbcType=TIMESTAMP} ,_shielded_areas =#{shieldedAreas,jdbcType=VARCHAR}, where _id = #{id,jdbcType=BIGINT}</update>  
  <update id="updateByPrimaryKeySelective" parameterType="com.taoke.autopay.entity.agent.ChannelAgent">update table_agent 
    <set> 
      <if test="name != null">_name=#{name,jdbcType=VARCHAR},</if>  
      <if test="alias != null">_alias=#{alias,jdbcType=VARCHAR},</if>  
      <if test="account != null">_account=#{account,jdbcType=VARCHAR},</if>  
      <if test="pwd != null">_pwd=#{pwd,jdbcType=VARCHAR},</if>  
      <if test="alipayName != null">_alipay_name=#{alipayName,jdbcType=VARCHAR},</if>  
      <if test="alipayAccount != null">_alipay_account=#{alipayAccount,jdbcType=VARCHAR},</if>  
      <if test="alipayUpdateTime != null">_alipay_update_time=#{alipayUpdateTime,jdbcType=TIMESTAMP},</if>  
      <if test="status != null">_status=#{status,jdbcType=INTEGER},</if>  
      <if test="statusDesc != null">_status_desc=#{statusDesc,jdbcType=VARCHAR},</if>  
      <if test="createTime != null">_create_time=#{createTime,jdbcType=TIMESTAMP},</if>  
      <if test="updateTime != null">_update_time=#{updateTime,jdbcType=TIMESTAMP},</if>  
      <if test="shieldedAreas !=null">_shielded_areas =#{shieldedAreas,jdbcType=VARCHAR},</if>
    </set> where _id = #{id,jdbcType=BIGINT}
  </update> 
</mapper>