admin
2021-06-24 df4441322e9801c102299451da41d7c40b4502e9
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
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
<?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.daylucky.mapper.UserInfoMapper">
    <resultMap id="BaseResultMap" type="com.ks.daylucky.pojo.DO.UserInfo">
        <id column="id" property="id" jdbcType="BIGINT"/>
        <result column="app_id" property="appId" jdbcType="BIGINT"/>
        <result column="identify_code" property="identifyCode" jdbcType="VARCHAR"/>
        <result column="nick_name" property="nickName" jdbcType="VARCHAR"/>
        <result column="portrait" property="portrait" jdbcType="VARCHAR"/>
        <result column="mobile" property="mobile" jdbcType="VARCHAR"/>
        <result column="alipay_uid" property="alipayUid" jdbcType="VARCHAR"/>
        <result column="alipay_portrait" property="alipayPortrait" jdbcType="VARCHAR"/>
        <result column="alipay_nick_name" property="alipayNickName" jdbcType="VARCHAR"/>
        <result column="wx_open_id" property="wxOpenId" jdbcType="VARCHAR"/>
        <result column="wx_union_id" property="wxUnionId" jdbcType="VARCHAR"/>
        <result column="wx_portrait" property="wxPortrait" jdbcType="VARCHAR"/>
        <result column="create_time" property="createTime" jdbcType="TIMESTAMP"/>
        <result column="update_time" property="updateTime" jdbcType="TIMESTAMP"/>
        <result column="type" property="type" jdbcType="INTEGER"/>
        <result column="state" property="state" jdbcType="INTEGER"/>
        <result column="state_desc" property="stateDesc" jdbcType="VARCHAR"/>
    </resultMap>
    <sql id="Base_Column_List">id, app_id, identify_code, nick_name, portrait, mobile, alipay_uid, alipay_portrait, wx_open_id, wx_union_id, wx_portrait, create_time, update_time,alipay_nick_name,`type`,state,state_desc</sql>
    <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Long">select
        <include refid="Base_Column_List"/>
        from user_info where id = #{id,jdbcType=BIGINT}
    </select>
    <!-- 非模板 -->
    <sql id="listWhere">
        <if test="query.appId!=null">and app_id=#{query.appId}</if>
        <if test="query.identifyCode!=null">and identify_code=#{query.identifyCode}</if>
        <if test="query.key!=null">and nick_name like '${query.key}%'</if>
        <if test="query.mobile!=null">and mobile=#{query.mobile}</if>
        <if test="query.alipayUid!=null">and alipay_uid=#{query.alipayUid}</if>
        <if test="query.wxOpenId!=null">and wx_open_id=#{query.wxOpenId}</if>
        <if test="query.wxUnionId!=null">and wx_union_id=#{query.wxUnionId}</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.type!=null">and #{query.type}=`type`</if>
 
 
    </sql>
    <select id="list" resultMap="BaseResultMap">select
        <include refid="Base_Column_List"/>
        from user_info where 1=1
        <include refid="listWhere"/>
        <if test="query.sortList!=null">
            <foreach collection="query.sortList" item="item" separator="," open=" order by ">${item}</foreach>
        </if>
        limit #{query.start},#{query.count}
    </select>
    <select id="listUserInfo" resultMap="BaseResultMap">select
        <include refid="Base_Column_List"/>
        from user_info where 1=1
        <foreach collection="userList" item="user" open=" and (" close=")" separator=" or ">#{user.uid}=id and
            app_id=#{user.appId}
        </foreach>
    </select>
    <select id="count" resultType="java.lang.Long">select count(*) from user_info where 1=1
        <include refid="listWhere"/>
    </select>
    <delete id="deleteByPrimaryKey"
            parameterType="java.lang.Long">delete from user_info where id = #{id,jdbcType=BIGINT}</delete>
    <insert id="insert" useGeneratedKeys="true" keyProperty="id"
            parameterType="com.ks.daylucky.pojo.DO.UserInfo">insert into user_info (id, app_id, identify_code, nick_name, portrait, mobile, alipay_uid, alipay_portrait, wx_open_id, wx_union_id, wx_portrait, create_time, update_time,alipay_nick_name,type,state,state_desc) values (#{id,jdbcType=BIGINT}, #{appId,jdbcType=BIGINT}, #{identifyCode,jdbcType=VARCHAR}, #{nickName,jdbcType=VARCHAR}, #{portrait,jdbcType=VARCHAR}, #{mobile,jdbcType=VARCHAR}, #{alipayUid,jdbcType=VARCHAR}, #{alipayPortrait,jdbcType=VARCHAR}, #{wxOpenId,jdbcType=VARCHAR}, #{wxUnionId,jdbcType=VARCHAR}, #{wxPortrait,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP},#{alipayNickName,jdbcType=VARCHAR},#{type,jdbcType=INTEGER},#{state,jdbcType=INTEGER},#{stateDesc,jdbcType=VARCHAR})</insert>
    <insert id="insertSelective" useGeneratedKeys="true" keyProperty="id"
            parameterType="com.ks.daylucky.pojo.DO.UserInfo">insert into user_info
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="id != null">id,</if>
            <if test="appId != null">app_id,</if>
            <if test="identifyCode != null">identify_code,</if>
            <if test="nickName != null">nick_name,</if>
            <if test="portrait != null">portrait,</if>
            <if test="mobile != null">mobile,</if>
            <if test="alipayUid != null">alipay_uid,</if>
            <if test="alipayPortrait != null">alipay_portrait,</if>
            <if test="wxOpenId != null">wx_open_id,</if>
            <if test="wxUnionId != null">wx_union_id,</if>
            <if test="wxPortrait != null">wx_portrait,</if>
            <if test="createTime != null">create_time,</if>
            <if test="updateTime != null">update_time,</if>
            <if test="alipayNickName != null">alipay_nick_name,</if>
            <if test="type != null">type,</if>
            <if test="state != null">state,</if>
            <if test="stateDesc != null">state_desc,</if>
        </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
            <if test="id != null">#{id,jdbcType=BIGINT},</if>
            <if test="appId != null">#{appId,jdbcType=BIGINT},</if>
            <if test="identifyCode != null">#{identifyCode,jdbcType=VARCHAR},</if>
            <if test="nickName != null">#{nickName,jdbcType=VARCHAR},</if>
            <if test="portrait != null">#{portrait,jdbcType=VARCHAR},</if>
            <if test="mobile != null">#{mobile,jdbcType=VARCHAR},</if>
            <if test="alipayUid != null">#{alipayUid,jdbcType=VARCHAR},</if>
            <if test="alipayPortrait != null">#{alipayPortrait,jdbcType=VARCHAR},</if>
            <if test="wxOpenId != null">#{wxOpenId,jdbcType=VARCHAR},</if>
            <if test="wxUnionId != null">#{wxUnionId,jdbcType=VARCHAR},</if>
            <if test="wxPortrait != null">#{wxPortrait,jdbcType=VARCHAR},</if>
            <if test="createTime != null">#{createTime,jdbcType=TIMESTAMP},</if>
            <if test="updateTime != null">#{updateTime,jdbcType=TIMESTAMP},</if>
            <if test="alipayNickName != null">#{alipayNickName,jdbcType=VARCHAR},</if>
            <if test="type != null">#{type,jdbcType=INTEGER},</if>
            <if test="state != null">#{state,jdbcType=INTEGER},</if>
            <if test="stateDesc != null">#{stateDesc,jdbcType=VARCHAR},</if>
        </trim>
    </insert>
    <update id="updateByPrimaryKeySelective" parameterType="com.ks.daylucky.pojo.DO.UserInfo">update user_info
        <set>
            <if test="appId != null">app_id = #{appId,jdbcType=BIGINT},</if>
            <if test="identifyCode != null">identify_code = #{identifyCode,jdbcType=VARCHAR},</if>
            <if test="nickName != null">nick_name = #{nickName,jdbcType=VARCHAR},</if>
            <if test="portrait != null">portrait = #{portrait,jdbcType=VARCHAR},</if>
            <if test="mobile != null">mobile = #{mobile,jdbcType=VARCHAR},</if>
            <if test="alipayUid != null">alipay_uid = #{alipayUid,jdbcType=VARCHAR},</if>
            <if test="alipayPortrait != null">alipay_portrait = #{alipayPortrait,jdbcType=VARCHAR},</if>
            <if test="wxOpenId != null">wx_open_id = #{wxOpenId,jdbcType=VARCHAR},</if>
            <if test="wxUnionId != null">wx_union_id = #{wxUnionId,jdbcType=VARCHAR},</if>
            <if test="wxPortrait != null">wx_portrait = #{wxPortrait,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="alipayNickName !=null">alipay_nick_name =#{alipayNickName,jdbcType=VARCHAR},</if>
            <if test="type !=null">type =#{type,jdbcType=INTEGER},</if>
            <if test="state !=null">state =#{state,jdbcType=INTEGER},</if>
            <if test="stateDesc !=null">state_desc =#{stateDesc,jdbcType=VARCHAR},</if>
        </set>
        where id = #{id,jdbcType=BIGINT}
    </update>
    <update id="updateByPrimaryKey"
            parameterType="com.ks.daylucky.pojo.DO.UserInfo">update user_info set app_id = #{appId,jdbcType=BIGINT}, identify_code = #{identifyCode,jdbcType=VARCHAR}, nick_name = #{nickName,jdbcType=VARCHAR}, portrait = #{portrait,jdbcType=VARCHAR}, mobile = #{mobile,jdbcType=VARCHAR}, alipay_uid = #{alipayUid,jdbcType=VARCHAR}, alipay_portrait = #{alipayPortrait,jdbcType=VARCHAR}, wx_open_id = #{wxOpenId,jdbcType=VARCHAR}, wx_union_id = #{wxUnionId,jdbcType=VARCHAR}, wx_portrait = #{wxPortrait,jdbcType=VARCHAR}, create_time = #{createTime,jdbcType=TIMESTAMP}, update_time = #{updateTime,jdbcType=TIMESTAMP} ,alipay_nick_name =#{alipayNickName,jdbcType=VARCHAR} ,type =#{type,jdbcType=INTEGER} ,state =#{state,jdbcType=INTEGER} ,state_desc =#{stateDesc,jdbcType=VARCHAR} where id = #{id,jdbcType=BIGINT}</update>
</mapper>