Files
peko-java/accompany-base/accompany-basic/accompany-basic-service/src/main/resources/sqlmappers/UsersMapper.xml
2025-10-14 16:30:55 +08:00

1089 lines
47 KiB
XML

<?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.accompany.core.mybatismapper.UsersMapper">
<resultMap id="BaseResultMap" type="com.accompany.core.model.Users">
<id column="uid" jdbcType="BIGINT" property="uid"/>
<result column="erban_no" jdbcType="BIGINT" property="erbanNo"/>
<result column="has_pretty_erban_no" jdbcType="BIT" property="hasPrettyErbanNo"/>
<result column="phone" jdbcType="VARCHAR" property="phone"/>
<result column="birth" jdbcType="DATE" property="birth"/>
<result column="star" jdbcType="TINYINT" property="star"/>
<result column="nick" jdbcType="VARCHAR" property="nick"/>
<result column="email" jdbcType="VARCHAR" property="email"/>
<result column="signture" jdbcType="VARCHAR" property="signture"/>
<result column="follow_num" jdbcType="INTEGER" property="followNum"/>
<result column="fans_num" jdbcType="INTEGER" property="fansNum"/>
<result column="def_user" jdbcType="TINYINT" property="defUser"/>
<result column="fortune" jdbcType="BIGINT" property="fortune"/>
<result column="channel_type" jdbcType="TINYINT" property="channelType"/>
<result column="last_login_time" jdbcType="TIMESTAMP" property="lastLoginTime"/>
<result column="last_login_ip" jdbcType="VARCHAR" property="lastLoginIp"/>
<result column="last_login_region" jdbcType="VARCHAR" property="lastLoginRegion"/>
<result column="gender" jdbcType="TINYINT" property="gender"/>
<result column="avatar" jdbcType="VARCHAR" property="avatar"/>
<result column="region" jdbcType="VARCHAR" property="region"/>
<result column="region_id" jdbcType="INTEGER" property="regionId"/>
<result column="partition_id" jdbcType="INTEGER" property="partitionId"/>
<result column="user_desc" jdbcType="VARCHAR" property="userDesc"/>
<result column="create_time" jdbcType="TIMESTAMP" property="createTime"/>
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime"/>
<result column="room_uid" jdbcType="BIGINT" property="roomUid"/>
<result column="share_uid" jdbcType="BIGINT" property="shareUid"/>
<result column="share_channel" jdbcType="TINYINT" property="shareChannel"/>
<result column="os" jdbcType="VARCHAR" property="os"/>
<result column="osVersion" jdbcType="VARCHAR" property="osversion"/>
<result column="app" jdbcType="VARCHAR" property="app"/>
<result column="imei" jdbcType="VARCHAR" property="imei"/>
<result column="channel" jdbcType="VARCHAR" property="channel"/>
<result column="linkedme_channel" jdbcType="VARCHAR" property="linkedmeChannel"/>
<result column="isp_type" jdbcType="VARCHAR" property="ispType"/>
<result column="net_type" jdbcType="VARCHAR" property="netType"/>
<result column="model" jdbcType="VARCHAR" property="model"/>
<result column="device_id" jdbcType="VARCHAR" property="deviceId"/>
<result column="invite_code" jdbcType="VARCHAR" property="inviteCode"/>
<result column="new_device" jdbcType="BIT" property="newDevice"/>
<result column="app_version" jdbcType="VARCHAR" property="appVersion"/>
<result column="acc_block_start_time" jdbcType="TIMESTAMP" property="accBlockStartTime"/>
<result column="acc_block_end_time" jdbcType="TIMESTAMP" property="accBlockEndTime"/>
<result column="device_block_start_time" jdbcType="TIMESTAMP" property="deviceBlockStartTime"/>
<result column="device_block_end_time" jdbcType="TIMESTAMP" property="deviceBlockEndTime"/>
<result column="payment_pwd" jdbcType="VARCHAR" property="paymentPwd"/>
<result column="real_name" jdbcType="VARCHAR" property="realName"/>
<result column="id_card_num" jdbcType="VARCHAR" property="idCardNum"/>
<result column="use_status" jdbcType="TINYINT" property="useStatus"/>
<result column="current_app" jdbcType="VARCHAR" property="currentApp"/>
<result column="platform_role" jdbcType="TINYINT" property="platformRole"/>
<result column="certify_modify_times" jdbcType="INTEGER" property="certifyModifyTimes"/>
<result column="phone_area_code" jdbcType="VARCHAR" property="phoneAreaCode"/>
</resultMap>
<sql id="Example_Where_Clause">
<where>
<foreach collection="oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="("
separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Update_By_Example_Where_Clause">
<where>
<foreach collection="example.oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="("
separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Base_Column_List">
`uid`, erban_no, has_pretty_erban_no, phone, birth, star, nick, email, signture,
follow_num, fans_num, def_user, fortune, channel_type, last_login_time,
last_login_ip, last_login_region, gender, avatar, region, region_id, partition_id, user_desc,
create_time, update_time, room_uid, share_uid, share_channel,
os, osVersion, app, imei, adid, channel, linkedme_channel, isp_type,
net_type, model, device_id, new_device, app_version, acc_block_start_time, acc_block_end_time,
device_block_start_time, device_block_end_time, payment_pwd,
real_name, id_card_num, use_status, current_app, platform_role,
certify_modify_times, invite_code, invite_uid, phone_area_code
</sql>
<select id="selectByExample" parameterType="com.accompany.core.model.UsersExample" resultMap="BaseResultMap">
/* SHARDINGSPHERE_HINT: WRITE_ROUTE_ONLY=true */
select
<if test="distinct">
distinct
</if>
<include refid="Base_Column_List"/>
from users
<if test="_parameter != null">
<include refid="Example_Where_Clause"/>
</if>
<if test="orderByClause != null">
order by ${orderByClause}
</if>
<if test="limit != null">
<if test="offset != null">
limit ${offset}, ${limit}
</if>
<if test="offset == null">
limit ${limit}
</if>
</if>
</select>
<select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
/* SHARDINGSPHERE_HINT: WRITE_ROUTE_ONLY=true */
select
<include refid="Base_Column_List"/>
from users
where `uid` = #{uid,jdbcType=BIGINT}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
delete from users
where `uid` = #{uid,jdbcType=BIGINT}
</delete>
<delete id="deleteByExample" parameterType="com.accompany.core.model.UsersExample">
delete from users
<if test="_parameter != null">
<include refid="Example_Where_Clause"/>
</if>
</delete>
<insert id="insert" parameterType="com.accompany.core.model.Users">
insert into users (`uid`, erban_no, has_pretty_erban_no,
phone, birth, star, nick,
email, signture, follow_num, fans_num,
def_user, fortune, channel_type,
last_login_time, last_login_ip, last_login_region,
gender, avatar, region, region_id, partition_id, user_desc,
create_time, update_time, room_uid, share_uid, share_channel, os, osVersion,
app, imei, adid, channel,
linkedme_channel, isp_type, net_type,
model, device_id, new_device,
app_version, acc_block_start_time, acc_block_end_time,
device_block_start_time, device_block_end_time, payment_pwd,
real_name, id_card_num, use_status, current_app,
platform_role, certify_modify_times)
values (#{uid,jdbcType=BIGINT}, #{erbanNo,jdbcType=BIGINT}, #{hasPrettyErbanNo,jdbcType=BIT},
#{phone,jdbcType=VARCHAR}, #{birth,jdbcType=DATE}, #{star,jdbcType=TINYINT}, #{nick,jdbcType=VARCHAR},
#{email,jdbcType=VARCHAR}, #{signture,jdbcType=VARCHAR}, #{followNum,jdbcType=INTEGER}, #{fansNum,jdbcType=INTEGER},
#{defUser,jdbcType=TINYINT}, #{fortune,jdbcType=BIGINT}, #{channelType,jdbcType=TINYINT},
#{lastLoginTime,jdbcType=TIMESTAMP}, #{lastLoginIp,jdbcType=VARCHAR}, #{lastLoginRegion,jdbcType=VARCHAR},
#{gender,jdbcType=TINYINT}, #{avatar,jdbcType=VARCHAR}, #{region,jdbcType=VARCHAR},#{regionId,jdbcType=INTEGER}, #{partitionId,jdbcType=INTEGER}, #{userDesc,jdbcType=VARCHAR},
#{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP}, #{roomUid,jdbcType=BIGINT},
#{shareUid,jdbcType=BIGINT}, #{shareChannel,jdbcType=TINYINT},#{os,jdbcType=VARCHAR}, #{osversion,jdbcType=VARCHAR},
#{app,jdbcType=VARCHAR}, #{imei,jdbcType=VARCHAR}, #{adid,jdbcType=VARCHAR}, #{channel,jdbcType=VARCHAR},
#{linkedmeChannel,jdbcType=VARCHAR}, #{ispType,jdbcType=VARCHAR}, #{netType,jdbcType=VARCHAR},
#{model,jdbcType=VARCHAR}, #{deviceId,jdbcType=VARCHAR}, #{newDevice,jdbcType=BIT},
#{appVersion,jdbcType=VARCHAR}, #{accBlockStartTime,jdbcType=TIMESTAMP}, #{accBlockEndTime,jdbcType=TIMESTAMP},
#{deviceBlockStartTime,jdbcType=TIMESTAMP}, #{deviceBlockEndTime,jdbcType=TIMESTAMP}, #{paymentPwd,jdbcType=VARCHAR},
#{realName,jdbcType=VARCHAR}, #{idCardNum,jdbcType=VARCHAR}, #{useStatus,jdbcType=TINYINT}, #{currentApp,jdbcType=VARCHAR},
#{platformRole,jdbcType=TINYINT}, #{certifyModifyTimes,jdbcType=INTEGER})
</insert>
<insert id="insertSelective" parameterType="com.accompany.core.model.Users">
insert into users
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="uid != null">
`uid`,
</if>
<if test="erbanNo != null">
erban_no,
</if>
<if test="hasPrettyErbanNo != null">
has_pretty_erban_no,
</if>
<if test="phone != null">
phone,
</if>
<if test="birth != null">
birth,
</if>
<if test="star != null">
star,
</if>
<if test="nick != null">
nick,
</if>
<if test="email != null">
email,
</if>
<if test="signture != null">
signture,
</if>
<if test="followNum != null">
follow_num,
</if>
<if test="fansNum != null">
fans_num,
</if>
<if test="defUser != null">
def_user,
</if>
<if test="fortune != null">
fortune,
</if>
<if test="channelType != null">
channel_type,
</if>
<if test="lastLoginTime != null">
last_login_time,
</if>
<if test="lastLoginIp != null">
last_login_ip,
</if>
<if test="lastLoginRegion != null">
last_login_region,
</if>
<if test="gender != null">
gender,
</if>
<if test="avatar != null">
avatar,
</if>
<if test="region != null">
region,
</if>
<if test="regionId != null">
region_id,
</if>
<if test="partitionId != null">
partition_id,
</if>
<if test="userDesc != null">
user_desc,
</if>
<if test="createTime != null">
create_time,
</if>
<if test="updateTime != null">
update_time,
</if>
<if test="roomUid != null">
room_uid,
</if>
<if test="shareUid != null">
share_uid,
</if>
<if test="shareChannel != null">
share_channel,
</if>
<if test="os != null">
os,
</if>
<if test="osversion != null">
osVersion,
</if>
<if test="app != null">
app,
</if>
<if test="imei != null">
imei,
</if>
<if test="adid != null">
adid,
</if>
<if test="channel != null">
channel,
</if>
<if test="linkedmeChannel != null">
linkedme_channel,
</if>
<if test="ispType != null">
isp_type,
</if>
<if test="netType != null">
net_type,
</if>
<if test="model != null">
model,
</if>
<if test="deviceId != null">
device_id,
</if>
<if test="inviteCode != null">
invite_code,
</if>
<if test="inviteUid != null">
invite_uid,
</if>
<if test="newDevice != null">
new_device,
</if>
<if test="appVersion != null">
app_version,
</if>
<if test="accBlockStartTime != null">
acc_block_start_time,
</if>
<if test="accBlockEndTime != null">
acc_block_end_time,
</if>
<if test="deviceBlockStartTime != null">
device_block_start_time,
</if>
<if test="deviceBlockEndTime != null">
device_block_end_time,
</if>
<if test="paymentPwd != null">
payment_pwd,
</if>
<if test="realName != null">
real_name,
</if>
<if test="idCardNum != null">
id_card_num,
</if>
<if test="useStatus != null">
use_status,
</if>
<if test="currentApp != null">
current_app,
</if>
<if test="platformRole != null">
platform_role,
</if>
<if test="certifyModifyTimes != null">
certify_modify_times,
</if>
<if test="phoneAreaCode != null">
phone_area_code,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="uid != null">
#{uid,jdbcType=BIGINT},
</if>
<if test="erbanNo != null">
#{erbanNo,jdbcType=BIGINT},
</if>
<if test="hasPrettyErbanNo != null">
#{hasPrettyErbanNo,jdbcType=BIT},
</if>
<if test="phone != null">
#{phone,jdbcType=VARCHAR},
</if>
<if test="birth != null">
#{birth,jdbcType=DATE},
</if>
<if test="star != null">
#{star,jdbcType=TINYINT},
</if>
<if test="nick != null">
#{nick,jdbcType=VARCHAR},
</if>
<if test="email != null">
#{email,jdbcType=VARCHAR},
</if>
<if test="signture != null">
#{signture,jdbcType=VARCHAR},
</if>
<if test="followNum != null">
#{followNum,jdbcType=INTEGER},
</if>
<if test="fansNum != null">
#{fansNum,jdbcType=INTEGER},
</if>
<if test="defUser != null">
#{defUser,jdbcType=TINYINT},
</if>
<if test="fortune != null">
#{fortune,jdbcType=BIGINT},
</if>
<if test="channelType != null">
#{channelType,jdbcType=TINYINT},
</if>
<if test="lastLoginTime != null">
#{lastLoginTime,jdbcType=TIMESTAMP},
</if>
<if test="lastLoginIp != null">
#{lastLoginIp,jdbcType=VARCHAR},
</if>
<if test="lastLoginRegion != null">
#{lastLoginRegion,jdbcType=VARCHAR},
</if>
<if test="gender != null">
#{gender,jdbcType=TINYINT},
</if>
<if test="avatar != null">
#{avatar,jdbcType=VARCHAR},
</if>
<if test="region != null">
#{region,jdbcType=VARCHAR},
</if>
<if test="regionId != null">
#{regionId,jdbcType=INTEGER},
</if>
<if test="partitionId != null">
#{partitionId,jdbcType=INTEGER},
</if>
<if test="userDesc != null">
#{userDesc,jdbcType=VARCHAR},
</if>
<if test="createTime != null">
#{createTime,jdbcType=TIMESTAMP},
</if>
<if test="updateTime != null">
#{updateTime,jdbcType=TIMESTAMP},
</if>
<if test="roomUid != null">
#{roomUid,jdbcType=BIGINT},
</if>
<if test="shareUid != null">
#{shareUid,jdbcType=BIGINT},
</if>
<if test="shareChannel != null">
#{shareChannel,jdbcType=TINYINT},
</if>
<if test="os != null">
#{os,jdbcType=VARCHAR},
</if>
<if test="osversion != null">
#{osversion,jdbcType=VARCHAR},
</if>
<if test="app != null">
#{app,jdbcType=VARCHAR},
</if>
<if test="imei != null">
#{imei,jdbcType=VARCHAR},
</if>
<if test="adid != null">
#{adid,jdbcType=VARCHAR},
</if>
<if test="channel != null">
#{channel,jdbcType=VARCHAR},
</if>
<if test="linkedmeChannel != null">
#{linkedmeChannel,jdbcType=VARCHAR},
</if>
<if test="ispType != null">
#{ispType,jdbcType=VARCHAR},
</if>
<if test="netType != null">
#{netType,jdbcType=VARCHAR},
</if>
<if test="model != null">
#{model,jdbcType=VARCHAR},
</if>
<if test="deviceId != null">
#{deviceId,jdbcType=VARCHAR},
</if>
<if test="inviteCode != null">
#{inviteCode,jdbcType=VARCHAR},
</if>
<if test="inviteUid != null">
#{inviteUid,jdbcType=BIGINT},
</if>
<if test="newDevice != null">
#{newDevice,jdbcType=BIT},
</if>
<if test="appVersion != null">
#{appVersion,jdbcType=VARCHAR},
</if>
<if test="accBlockStartTime != null">
#{accBlockStartTime,jdbcType=TIMESTAMP},
</if>
<if test="accBlockEndTime != null">
#{accBlockEndTime,jdbcType=TIMESTAMP},
</if>
<if test="deviceBlockStartTime != null">
#{deviceBlockStartTime,jdbcType=TIMESTAMP},
</if>
<if test="deviceBlockEndTime != null">
#{deviceBlockEndTime,jdbcType=TIMESTAMP},
</if>
<if test="paymentPwd != null">
#{paymentPwd,jdbcType=VARCHAR},
</if>
<if test="realName != null">
#{realName,jdbcType=VARCHAR},
</if>
<if test="idCardNum != null">
#{idCardNum,jdbcType=VARCHAR},
</if>
<if test="useStatus != null">
#{useStatus,jdbcType=TINYINT},
</if>
<if test="currentApp != null">
#{currentApp,jdbcType=VARCHAR},
</if>
<if test="platformRole != null">
#{platformRole,jdbcType=TINYINT},
</if>
<if test="certifyModifyTimes != null">
#{certifyModifyTimes,jdbcType=INTEGER},
</if>
<if test="phoneAreaCode != null">
#{phoneAreaCode,jdbcType=VARCHAR},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="com.accompany.core.model.UsersExample" resultType="java.lang.Integer">
select count(*) from users
<if test="_parameter != null">
<include refid="Example_Where_Clause"/>
</if>
</select>
<update id="updateByExampleSelective" parameterType="map">
update users
<set>
<if test="record.uid != null">
`uid` = #{record.uid,jdbcType=BIGINT},
</if>
<if test="record.erbanNo != null">
erban_no = #{record.erbanNo,jdbcType=BIGINT},
</if>
<if test="record.hasPrettyErbanNo != null">
has_pretty_erban_no = #{record.hasPrettyErbanNo,jdbcType=BIT},
</if>
<if test="record.phone != null">
phone = #{record.phone,jdbcType=VARCHAR},
</if>
<if test="record.birth != null">
birth = #{record.birth,jdbcType=DATE},
</if>
<if test="record.star != null">
star = #{record.star,jdbcType=TINYINT},
</if>
<if test="record.nick != null">
nick = #{record.nick,jdbcType=VARCHAR},
</if>
<if test="record.email != null">
email = #{record.email,jdbcType=VARCHAR},
</if>
<if test="record.signture != null">
signture = #{record.signture,jdbcType=VARCHAR},
</if>
<if test="record.followNum != null">
follow_num = #{record.followNum,jdbcType=INTEGER},
</if>
<if test="record.fansNum != null">
fans_num = #{record.fansNum,jdbcType=INTEGER},
</if>
<if test="record.defUser != null">
def_user = #{record.defUser,jdbcType=TINYINT},
</if>
<if test="record.fortune != null">
fortune = #{record.fortune,jdbcType=BIGINT},
</if>
<if test="record.channelType != null">
channel_type = #{record.channelType,jdbcType=TINYINT},
</if>
<if test="record.lastLoginTime != null">
last_login_time = #{record.lastLoginTime,jdbcType=TIMESTAMP},
</if>
<if test="record.lastLoginIp != null">
last_login_ip = #{record.lastLoginIp,jdbcType=VARCHAR},
</if>
<if test="record.lastLoginRegion != null">
last_login_region = #{record.lastLoginRegion,jdbcType=VARCHAR},
</if>
<if test="record.gender != null">
gender = #{record.gender,jdbcType=TINYINT},
</if>
<if test="record.avatar != null">
avatar = #{record.avatar,jdbcType=VARCHAR},
</if>
<if test="record.region != null">
region = #{record.region,jdbcType=VARCHAR},
</if>
<if test="record.regionId != null">
region_id = #{record.regionId,jdbcType=INTEGER},
</if>
<if test="record.partitionId != null">
partition_id = #{record.partitionId,jdbcType=INTEGER},
</if>
<if test="record.userDesc != null">
user_desc = #{record.userDesc,jdbcType=VARCHAR},
</if>
<if test="record.createTime != null">
create_time = #{record.createTime,jdbcType=TIMESTAMP},
</if>
<if test="record.updateTime != null">
update_time = #{record.updateTime,jdbcType=TIMESTAMP},
</if>
<if test="record.roomUid != null">
room_uid = #{record.roomUid,jdbcType=BIGINT},
</if>
<if test="record.shareUid != null">
share_uid = #{record.shareUid,jdbcType=BIGINT},
</if>
<if test="record.shareChannel != null">
share_channel = #{record.shareChannel,jdbcType=TINYINT},
</if>
<if test="record.os != null">
os = #{record.os,jdbcType=VARCHAR},
</if>
<if test="record.osversion != null">
osVersion = #{record.osversion,jdbcType=VARCHAR},
</if>
<if test="record.app != null">
app = #{record.app,jdbcType=VARCHAR},
</if>
<if test="record.imei != null">
imei = #{record.imei,jdbcType=VARCHAR},
</if>
<if test="record.adid != null">
adid = #{record.adid,jdbcType=VARCHAR},
</if>
<if test="record.channel != null">
channel = #{record.channel,jdbcType=VARCHAR},
</if>
<if test="record.linkedmeChannel != null">
linkedme_channel = #{record.linkedmeChannel,jdbcType=VARCHAR},
</if>
<if test="record.ispType != null">
isp_type = #{record.ispType,jdbcType=VARCHAR},
</if>
<if test="record.netType != null">
net_type = #{record.netType,jdbcType=VARCHAR},
</if>
<if test="record.model != null">
model = #{record.model,jdbcType=VARCHAR},
</if>
<if test="record.deviceId != null">
device_id = #{record.deviceId,jdbcType=VARCHAR},
</if>
<if test="record.newDevice != null">
new_device = #{record.newDevice,jdbcType=BIT},
</if>
<if test="record.appVersion != null">
app_version = #{record.appVersion,jdbcType=VARCHAR},
</if>
<if test="record.accBlockStartTime != null">
acc_block_start_time = #{record.accBlockStartTime,jdbcType=TIMESTAMP},
</if>
<if test="record.accBlockEndTime != null">
acc_block_end_time = #{record.accBlockEndTime,jdbcType=TIMESTAMP},
</if>
<if test="record.deviceBlockStartTime != null">
device_block_start_time = #{record.deviceBlockStartTime,jdbcType=TIMESTAMP},
</if>
<if test="record.deviceBlockEndTime != null">
device_block_end_time = #{record.deviceBlockEndTime,jdbcType=TIMESTAMP},
</if>
<if test="record.paymentPwd != null">
payment_pwd = #{record.paymentPwd,jdbcType=VARCHAR},
</if>
<if test="record.realName != null">
real_name = #{record.realName,jdbcType=VARCHAR},
</if>
<if test="record.idCardNum != null">
id_card_num = #{record.idCardNum,jdbcType=VARCHAR},
</if>
<if test="record.useStatus != null">
use_status = #{record.useStatus,jdbcType=TINYINT},
</if>
<if test="record.currentApp != null">
current_app = #{record.currentApp,jdbcType=VARCHAR},
</if>
<if test="record.platformRole != null">
platform_role = #{record.platformRole,jdbcType=TINYINT},
</if>
<if test="record.certifyModifyTimes != null">
certify_modify_times = #{record.certifyModifyTimes,jdbcType=INTEGER},
</if>
<if test="record.phoneAreaCode != null">
phone_area_code = #{record.phoneAreaCode,jdbcType=VARCHAR},
</if>
</set>
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause"/>
</if>
</update>
<update id="updateByExample" parameterType="map">
update users
set `uid` = #{record.uid,jdbcType=BIGINT},
erban_no = #{record.erbanNo,jdbcType=BIGINT},
has_pretty_erban_no = #{record.hasPrettyErbanNo,jdbcType=BIT},
phone = #{record.phone,jdbcType=VARCHAR},
birth = #{record.birth,jdbcType=DATE},
star = #{record.star,jdbcType=TINYINT},
nick = #{record.nick,jdbcType=VARCHAR},
email = #{record.email,jdbcType=VARCHAR},
signture = #{record.signture,jdbcType=VARCHAR},
follow_num = #{record.followNum,jdbcType=INTEGER},
fans_num = #{record.fansNum,jdbcType=INTEGER},
def_user = #{record.defUser,jdbcType=TINYINT},
fortune = #{record.fortune,jdbcType=BIGINT},
channel_type = #{record.channelType,jdbcType=TINYINT},
last_login_time = #{record.lastLoginTime,jdbcType=TIMESTAMP},
last_login_ip = #{record.lastLoginIp,jdbcType=VARCHAR},
last_login_region = #{record.lastLoginRegion,jdbcType=VARCHAR},
gender = #{record.gender,jdbcType=TINYINT},
avatar = #{record.avatar,jdbcType=VARCHAR},
region = #{record.region,jdbcType=VARCHAR},
region_id = #{record.regionId,jdbcType=INTEGER},
partition_id = #{record.partitionId,jdbcType=INTEGER},
user_desc = #{record.userDesc,jdbcType=VARCHAR},
create_time = #{record.createTime,jdbcType=TIMESTAMP},
update_time = #{record.updateTime,jdbcType=TIMESTAMP},
room_uid = #{record.roomUid,jdbcType=BIGINT},
share_uid = #{record.shareUid,jdbcType=BIGINT},
share_channel = #{record.shareChannel,jdbcType=TINYINT},
os = #{record.os,jdbcType=VARCHAR},
osVersion = #{record.osversion,jdbcType=VARCHAR},
app = #{record.app,jdbcType=VARCHAR},
imei = #{record.imei,jdbcType=VARCHAR},
adid = #{record.adid,jdbcType=VARCHAR},
channel = #{record.channel,jdbcType=VARCHAR},
linkedme_channel = #{record.linkedmeChannel,jdbcType=VARCHAR},
isp_type = #{record.ispType,jdbcType=VARCHAR},
net_type = #{record.netType,jdbcType=VARCHAR},
model = #{record.model,jdbcType=VARCHAR},
device_id = #{record.deviceId,jdbcType=VARCHAR},
new_device = #{record.newDevice,jdbcType=BIT},
app_version = #{record.appVersion,jdbcType=VARCHAR},
acc_block_start_time = #{record.accBlockStartTime,jdbcType=TIMESTAMP},
acc_block_end_time = #{record.accBlockEndTime,jdbcType=TIMESTAMP},
device_block_start_time = #{record.deviceBlockStartTime,jdbcType=TIMESTAMP},
device_block_end_time = #{record.deviceBlockEndTime,jdbcType=TIMESTAMP},
payment_pwd = #{record.paymentPwd,jdbcType=VARCHAR},
real_name = #{record.realName,jdbcType=VARCHAR},
id_card_num = #{record.idCardNum,jdbcType=VARCHAR},,
use_status = #{record.useStatus,jdbcType=TINYINT},
current_app = #{record.currentApp,jdbcType=VARCHAR},
platform_role = #{record.platformRole,jdbcType=TINYINT},
certify_modify_times = #{record.certifyModifyTimes,jdbcType=INTEGER},
phone_area_code = #{record.phoneAreaCode,jdbcType=VARCHAR}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause"/>
</if>
</update>
<update id="updateByPrimaryKeySelective" parameterType="com.accompany.core.model.Users">
update users
<set>
<if test="erbanNo != null">
erban_no = #{erbanNo,jdbcType=BIGINT},
</if>
<if test="hasPrettyErbanNo != null">
has_pretty_erban_no = #{hasPrettyErbanNo,jdbcType=BIT},
</if>
<if test="phone != null">
phone = #{phone,jdbcType=VARCHAR},
</if>
<if test="birth != null">
birth = #{birth,jdbcType=DATE},
</if>
<if test="star != null">
star = #{star,jdbcType=TINYINT},
</if>
<if test="nick != null">
nick = #{nick,jdbcType=VARCHAR},
</if>
<if test="email != null">
email = #{email,jdbcType=VARCHAR},
</if>
<if test="signture != null">
signture = #{signture,jdbcType=VARCHAR},
</if>
<if test="followNum != null">
follow_num = #{followNum,jdbcType=INTEGER},
</if>
<if test="fansNum != null">
fans_num = #{fansNum,jdbcType=INTEGER},
</if>
<if test="defUser != null">
def_user = #{defUser,jdbcType=TINYINT},
</if>
<if test="fortune != null">
fortune = #{fortune,jdbcType=BIGINT},
</if>
<if test="channelType != null">
channel_type = #{channelType,jdbcType=TINYINT},
</if>
<if test="lastLoginTime != null">
last_login_time = #{lastLoginTime,jdbcType=TIMESTAMP},
</if>
<if test="lastLoginIp != null">
last_login_ip = #{lastLoginIp,jdbcType=VARCHAR},
</if>
<if test="lastLoginRegion != null">
last_login_region = #{lastLoginRegion,jdbcType=VARCHAR},
</if>
<if test="gender != null">
gender = #{gender,jdbcType=TINYINT},
</if>
<if test="avatar != null">
avatar = #{avatar,jdbcType=VARCHAR},
</if>
<if test="region != null">
region = #{region,jdbcType=VARCHAR},
</if>
<if test="regionId != null">
region_id = #{regionId,jdbcType=INTEGER},
</if>
<if test="partitionId != null">
partition_id = #{partitionId,jdbcType=INTEGER},
</if>
<if test="userDesc != null">
user_desc = #{userDesc,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="roomUid != null">
room_uid = #{roomUid,jdbcType=BIGINT},
</if>
<if test="shareUid != null">
share_uid = #{shareUid,jdbcType=BIGINT},
</if>
<if test="shareChannel != null">
share_channel = #{shareChannel,jdbcType=TINYINT},
</if>
<if test="os != null">
os = #{os,jdbcType=VARCHAR},
</if>
<if test="osversion != null">
osVersion = #{osversion,jdbcType=VARCHAR},
</if>
<if test="app != null">
app = #{app,jdbcType=VARCHAR},
</if>
<if test="imei != null">
imei = #{imei,jdbcType=VARCHAR},
</if>
<if test="adid != null">
adid = #{adid,jdbcType=VARCHAR},
</if>
<if test="channel != null">
channel = #{channel,jdbcType=VARCHAR},
</if>
<if test="linkedmeChannel != null">
linkedme_channel = #{linkedmeChannel,jdbcType=VARCHAR},
</if>
<if test="ispType != null">
isp_type = #{ispType,jdbcType=VARCHAR},
</if>
<if test="netType != null">
net_type = #{netType,jdbcType=VARCHAR},
</if>
<if test="model != null">
model = #{model,jdbcType=VARCHAR},
</if>
<if test="deviceId != null">
device_id = #{deviceId,jdbcType=VARCHAR},
</if>
<if test="newDevice != null">
new_device = #{newDevice,jdbcType=BIT},
</if>
<if test="appVersion != null">
app_version = #{appVersion,jdbcType=VARCHAR},
</if>
<if test="accBlockStartTime != null">
acc_block_start_time = #{accBlockStartTime,jdbcType=TIMESTAMP},
</if>
<if test="accBlockEndTime != null">
acc_block_end_time = #{accBlockEndTime,jdbcType=TIMESTAMP},
</if>
<if test="deviceBlockStartTime != null">
device_block_start_time = #{deviceBlockStartTime,jdbcType=TIMESTAMP},
</if>
<if test="deviceBlockEndTime != null">
device_block_end_time = #{deviceBlockEndTime,jdbcType=TIMESTAMP},
</if>
<if test="paymentPwd != null">
payment_pwd = #{paymentPwd,jdbcType=VARCHAR},
</if>
<if test="realName != null">
real_name = #{realName,jdbcType=VARCHAR},
</if>
<if test="idCardNum != null">
id_card_num = #{idCardNum,jdbcType=VARCHAR},
</if>
<if test="useStatus != null">
use_status = #{useStatus,jdbcType=TINYINT},
</if>
<if test="currentApp != null">
current_app = #{currentApp,jdbcType=VARCHAR},
</if>
<if test="platformRole != null">
platform_role = #{platformRole,jdbcType=TINYINT},
</if>
<if test="certifyModifyTimes != null">
certify_modify_times = #{certifyModifyTimes,jdbcType=INTEGER},
</if>
<if test="inviteCode != null">
invite_code = #{inviteCode,jdbcType=VARCHAR},
</if>
<if test="inviteUid != null">
invite_uid = #{inviteUid,jdbcType=VARCHAR},
</if>
<if test="phoneAreaCode != null">
phone_area_code = #{phoneAreaCode,jdbcType=VARCHAR},
</if>
</set>
where `uid` = #{uid,jdbcType=BIGINT}
</update>
<update id="updateByPrimaryKey" parameterType="com.accompany.core.model.Users">
update users
set erban_no = #{erbanNo,jdbcType=BIGINT},
has_pretty_erban_no = #{hasPrettyErbanNo,jdbcType=BIT},
phone = #{phone,jdbcType=VARCHAR},
birth = #{birth,jdbcType=DATE},
star = #{star,jdbcType=TINYINT},
nick = #{nick,jdbcType=VARCHAR},
email = #{email,jdbcType=VARCHAR},
signture = #{signture,jdbcType=VARCHAR},
follow_num = #{followNum,jdbcType=INTEGER},
fans_num = #{fansNum,jdbcType=INTEGER},
def_user = #{defUser,jdbcType=TINYINT},
fortune = #{fortune,jdbcType=BIGINT},
channel_type = #{channelType,jdbcType=TINYINT},
last_login_time = #{lastLoginTime,jdbcType=TIMESTAMP},
last_login_ip = #{lastLoginIp,jdbcType=VARCHAR},
last_login_region = #{lastLoginRegion,jdbcType=VARCHAR},
gender = #{gender,jdbcType=TINYINT},
avatar = #{avatar,jdbcType=VARCHAR},
region = #{region,jdbcType=VARCHAR},
region_id = #{regionId,jdbcType=INTEGER},
partition_id = #{partitionId,jdbcType=INTEGER},
user_desc = #{userDesc,jdbcType=VARCHAR},
create_time = #{createTime,jdbcType=TIMESTAMP},
update_time = #{updateTime,jdbcType=TIMESTAMP},
room_uid = #{roomUid,jdbcType=BIGINT},
share_uid = #{shareUid,jdbcType=BIGINT},
share_channel = #{shareChannel,jdbcType=TINYINT},
os = #{os,jdbcType=VARCHAR},
osVersion = #{osversion,jdbcType=VARCHAR},
app = #{app,jdbcType=VARCHAR},
imei = #{imei,jdbcType=VARCHAR},
adid = #{adid,jdbcType=VARCHAR},
channel = #{channel,jdbcType=VARCHAR},
linkedme_channel = #{linkedmeChannel,jdbcType=VARCHAR},
isp_type = #{ispType,jdbcType=VARCHAR},
net_type = #{netType,jdbcType=VARCHAR},
model = #{model,jdbcType=VARCHAR},
device_id = #{deviceId,jdbcType=VARCHAR},
new_device = #{newDevice,jdbcType=BIT},
app_version = #{appVersion,jdbcType=VARCHAR},
acc_block_start_time = #{accBlockStartTime,jdbcType=TIMESTAMP},
acc_block_end_time = #{accBlockEndTime,jdbcType=TIMESTAMP},
device_block_start_time = #{deviceBlockStartTime,jdbcType=TIMESTAMP},
device_block_end_time = #{deviceBlockEndTime,jdbcType=TIMESTAMP},
payment_pwd = #{paymentPwd,jdbcType=VARCHAR},
real_name = #{realName,jdbcType=VARCHAR},
id_card_num = #{idCardNum,jdbcType=VARCHAR},
use_status = #{useStatus,jdbcType=TINYINT},
current_app = #{currentApp,jdbcType=VARCHAR},
platform_role = #{platformRole,jdbcType=TINYINT},
certify_modify_times = #{certifyModifyTimes,jdbcType=INTEGER},
phone_area_code = #{phoneAreaCode,jdbcType=VARCHAR}
where `uid` = #{uid,jdbcType=BIGINT}
</update>
<select id="findUidByErbanNos" parameterType="java.util.List" resultType="java.lang.String">
select uid from users where erban_no in
<foreach collection="erbanNos" item="erbanNo" open="(" separator="," close=")">
#{erbanNo}
</foreach>
</select>
<select id="listNoInviteCodeUserByPage" resultType="com.accompany.core.model.Users">
select
<include refid="Base_Column_List"/>
from users u
where not exists(select 1 from user_invite_code uic where uic.uid = u.uid)
limit ${page - 1}, ${pageSize}
</select>
<select id="listInvitedUsers" resultType="com.accompany.core.vo.user.InvitedUserVO">
select a.uid, a.phone,a.phone_area_code, u.nick, u.avatar, u.gender, a.sign_time createTime,
case when u.nick is null and u.gender is null then 0 else 1 end hasLoginActived from account a left join users u
on u.uid = a.uid
where ((a.prefill_invite_uid = ${uid} and u.nick is null and u.gender is null)
or u.invite_uid = ${uid})
<if test="signUpApps != null and signUpApps.size > 0">
and a.signup_app in
<foreach collection="signUpApps" item="signUpApp" open="(" separator="," close=")">
#{signUpApp}
</foreach>
</if>
order by a.sign_time desc
</select>
<select id="listInvitedUsersOfSpecialApp" resultMap="BaseResultMap">
select u.uid, u.nick, u.erban_no, u.gender, u.avatar, u.create_time from account a, users u
where a.uid = u.uid
<if test="signUpApps != null and signUpApps.size > 0">
and a.signup_app in
<foreach collection="signUpApps" item="signUpApp" open="(" separator="," close=")">
#{signUpApp}
</foreach>
</if>
and u.invite_uid = #{uid}
order by create_time desc ;
</select>
<select id="queryRoomVisitorSectionUser" resultType="java.lang.Long">
select uid from users where create_time between #{queryStartDate} and #{queryEndDate} and def_user = 1
</select>
<select id="getUidByPartial" resultType="java.lang.Long">
/* SHARDINGSPHERE_HINT: WRITE_ROUTE_ONLY=true */
select uid from users where def_user IN (1,2) order by uid asc limit #{start},#{len}
</select>
<select id="getErbanNoListByCreateTime" resultType="java.lang.Long">
/* SHARDINGSPHERE_HINT: WRITE_ROUTE_ONLY=true */
select erban_no from users u where create_time >= #{startDate} and create_time &lt;= #{endDate}
</select>
<select id="getUidByErBanNo" resultType="java.lang.Long">
/* SHARDINGSPHERE_HINT: WRITE_ROUTE_ONLY=true */
select uid from users where erban_no like concat('%', #{erBanNo}, '%')
</select>
<select id="getNewbies" resultType="java.lang.Long">
select uid from users
<where>
def_user = 1
<if test="uidList != null and uidList.size > 0">
and uid not in
<foreach collection="uidList" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>
</where>
order by create_time desc limit #{limitNum}
</select>
<select id="getActiveAnchorUidList" resultType="java.lang.Long">
select
distinct u.uid
from account_login_record as alr
inner join users as u on u.uid = alr.uid
<if test="gender != null">
and u.gender = #{gender}
</if>
inner join hall_member as hm on hm.uid = u.uid and hm.`status` = 1
where alr.create_time > #{lastLoginTime}
</select>
<select id="listUid" resultType="com.accompany.core.model.Users">
/* SHARDINGSPHERE_HINT: WRITE_ROUTE_ONLY=true */
select uid, partition_id partitionId from users order by uid asc limit #{start},#{len}
</select>
<select id="recharegeCount" resultType="java.lang.Integer">
select ifnull(count(1),0) from recharge_user where uid = #{uid}
</select>
</mapper>