IUserAuthorizeInfoDao.xml
3.33 KB
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
<?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.yohoufo.dal.user.IUserAuthorizeInfoDao" >
<resultMap id="BaseResultMap" type="com.yohoufo.dal.user.model.UserAuthorizeInfo" >
<id column="id" property="id" jdbcType="INTEGER" />
<result column="uid" property="uid" jdbcType="INTEGER" />
<result column="valid_status" property="validStatus" jdbcType="INTEGER" />
<result column="alipay_account" property="alipayAccount" jdbcType="VARCHAR" />
<result column="cert_name" property="certName" jdbcType="VARCHAR" />
<result column="alipay_uid" property="alipayUid" jdbcType="VARCHAR" />
<result column="nick_name" property="nickName" jdbcType="VARCHAR" />
<result column="create_time" property="createTime" jdbcType="INTEGER" />
<result column="update_time" property="updateTime" jdbcType="INTEGER" />
</resultMap>
<sql id="Base_Column_List" >
id, uid, valid_status,alipay_account, cert_name, alipay_uid, nick_name, create_time, update_time
</sql>
<select id="selectValidAuthorizeInfoByUid" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
select
<include refid="Base_Column_List" />
from authorize_info
where uid = #{uid} and valid_status = 1
order by id desc limit 1
</select>
<update id="updateToUnValidStatusByUid">
update authorize_info
set valid_status = 0,update_time = #{updateTime}
where uid = #{uid,jdbcType=INTEGER} and valid_status = 1
</update>
<insert id="insert" parameterType="com.yohoufo.dal.user.model.UserAuthorizeInfo" >
insert into authorize_info (uid, valid_status, alipay_account, cert_name, create_time, update_time)
values (#{uid},#{validStatus},
#{alipayAccount},#{certName},
#{createTime},#{updateTime})
</insert>
<insert id="insertSelective" parameterType="com.yohoufo.dal.user.model.UserAuthorizeInfo">
insert into authorize_info
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="uid != null">
uid,
</if>
<if test="validStatus != null">
valid_status,
</if>
<if test="alipayAccount != null">
alipay_account,
</if>
<if test="certName != null">
cert_name,
</if>
<if test="alipayUid != null">
alipay_uid,
</if>
<if test="nickName != null">
nick_name,
</if>
<if test="createTime != null">
create_time,
</if>
<if test="updateTime != null">
update_time,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="uid != null">
#{uid,jdbcType=INTEGER},
</if>
<if test="validStatus != null">
#{validStatus,jdbcType=INTEGER},
</if>
<if test="alipayAccount != null">
#{alipayAccount,jdbcType=VARCHAR},
</if>
<if test="certName != null">
#{certName,jdbcType=VARCHAR},
</if>
<if test="alipayUid != null">
#{alipayUid,jdbcType=VARCHAR},
</if>
<if test="nickName != null">
#{nickName,jdbcType=VARCHAR},
</if>
<if test="createTime != null">
#{createTime,jdbcType=INTEGER},
</if>
<if test="updateTime != null">
#{updateTime,jdbcType=INTEGER},
</if>
</trim>
</insert>
</mapper>