<?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="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"/>
|
</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
|
</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>=#{query.minCreateTime}
|
</if>
|
|
<if test="query.maxCreateTime!=null">
|
and #{query.maxCreateTime}>create_time
|
</if>
|
|
</sql>
|
|
|
<select id="list" resultMap="BaseResultMap">
|
select
|
<include refid="Base_Column_List"/>
|
from user_info
|
where 1=1
|
<include refid="listWhere">
|
|
</include>
|
|
|
<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">
|
|
</include>
|
</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)
|
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})
|
</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>
|
</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>
|
</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>
|
</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}
|
where id = #{id,jdbcType=BIGINT}
|
</update>
|
</mapper>
|