<?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.nq.dao.UserMapper">
|
<resultMap id="BaseResultMap" type="com.nq.pojo.User" >
|
<constructor >
|
<idArg column="id" jdbcType="INTEGER" javaType="java.lang.Integer" />
|
<arg column="agent_id" jdbcType="INTEGER" javaType="java.lang.Integer" />
|
<arg column="agent_name" jdbcType="VARCHAR" javaType="java.lang.String" />
|
<arg column="phone" jdbcType="VARCHAR" javaType="java.lang.String" />
|
<arg column="user_pwd" jdbcType="VARCHAR" javaType="java.lang.String" />
|
<arg column="with_pwd" jdbcType="VARCHAR" javaType="java.lang.String" />
|
<arg column="nick_name" jdbcType="VARCHAR" javaType="java.lang.String" />
|
<arg column="real_name" jdbcType="VARCHAR" javaType="java.lang.String" />
|
<arg column="id_card" jdbcType="VARCHAR" javaType="java.lang.String" />
|
<arg column="account_type" jdbcType="INTEGER" javaType="java.lang.Integer" />
|
<arg column="user_amt" jdbcType="DECIMAL" javaType="java.math.BigDecimal" />
|
<arg column="enable_amt" jdbcType="DECIMAL" javaType="java.math.BigDecimal" />
|
<arg column="enale_withdraw_amt" jdbcType="DECIMAL" javaType="java.math.BigDecimal" />
|
<arg column="hk_amt" jdbcType="DECIMAL" javaType="java.math.BigDecimal" />
|
<arg column="sum_charge_amt" jdbcType="DECIMAL" javaType="java.math.BigDecimal" />
|
<arg column="sum_buy_amt" jdbcType="DECIMAL" javaType="java.math.BigDecimal" />
|
<arg column="recom_phone" jdbcType="VARCHAR" javaType="java.lang.String" />
|
<arg column="is_lock" jdbcType="INTEGER" javaType="java.lang.Integer" />
|
<arg column="is_login" jdbcType="INTEGER" javaType="java.lang.Integer" />
|
<arg column="reg_time" jdbcType="TIMESTAMP" javaType="java.util.Date" />
|
<arg column="reg_ip" jdbcType="VARCHAR" javaType="java.lang.String" />
|
<arg column="reg_address" jdbcType="VARCHAR" javaType="java.lang.String" />
|
<arg column="img1_key" jdbcType="VARCHAR" javaType="java.lang.String" />
|
<arg column="img2_key" jdbcType="VARCHAR" javaType="java.lang.String" />
|
<arg column="img3_key" jdbcType="VARCHAR" javaType="java.lang.String" />
|
<arg column="is_active" jdbcType="INTEGER" javaType="java.lang.Integer" />
|
<arg column="auth_msg" jdbcType="VARCHAR" javaType="java.lang.String" />
|
<arg column="user_index_amt" jdbcType="DECIMAL" javaType="java.math.BigDecimal" />
|
<arg column="enable_index_amt" jdbcType="DECIMAL" javaType="java.math.BigDecimal" />
|
<arg column="user_fut_amt" jdbcType="DECIMAL" javaType="java.math.BigDecimal" />
|
<arg column="enable_fut_amt" jdbcType="DECIMAL" javaType="java.math.BigDecimal" />
|
<arg column="withdrawal_Pwd" jdbcType="VARCHAR" javaType="java.lang.String" />
|
<arg column="trading_amount" jdbcType="DECIMAL" javaType="java.math.BigDecimal" />
|
<arg column="is_authorize" jdbcType="INTEGER" javaType="java.lang.Integer" />
|
<arg column="sgzj" jdbcType="DECIMAL" javaType="java.math.BigDecimal" />
|
<arg column="djzj" jdbcType="DECIMAL" javaType="java.math.BigDecimal" />
|
<arg column="is_signed_contract" jdbcType="VARCHAR" javaType="java.lang.String" />
|
<arg column="is_signed_agreement" jdbcType="VARCHAR" javaType="java.lang.String" />
|
</constructor>
|
</resultMap>
|
<sql id="Example_Where_Clause" >
|
<where >
|
<foreach collection="oredCriteria" item="criteria" separator="or" >
|
<if test="criteria.valid" >
|
<trim prefix="(" suffix=")" prefixOverrides="and" >
|
<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 collection="criterion.value" item="listItem" open="(" close=")" 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="(" suffix=")" prefixOverrides="and" >
|
<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 collection="criterion.value" item="listItem" open="(" close=")" separator="," >
|
#{listItem}
|
</foreach>
|
</when>
|
</choose>
|
</foreach>
|
</trim>
|
</if>
|
</foreach>
|
</where>
|
</sql>
|
<sql id="Base_Column_List" >
|
id, agent_id, agent_name, phone, user_pwd, with_pwd, nick_name, real_name, id_card,
|
account_type, user_amt, enable_amt, enale_withdraw_amt, hk_amt, sum_charge_amt, sum_buy_amt,
|
recom_phone, is_lock, is_login, reg_time, reg_ip, reg_address, img1_key, img2_key,
|
img3_key, is_active, auth_msg, user_index_amt, enable_index_amt, user_fut_amt, enable_fut_amt,
|
withdrawal_Pwd, trading_amount, is_authorize, sgzj, djzj,is_signed_contract,is_signed_agreement
|
</sql>
|
<select id="selectByExample" resultMap="BaseResultMap" parameterType="com.nq.pojo.UserExample" >
|
select
|
<if test="distinct" >
|
distinct
|
</if>
|
<include refid="Base_Column_List" />
|
from user
|
<if test="_parameter != null" >
|
<include refid="Example_Where_Clause" />
|
</if>
|
<if test="orderByClause != null" >
|
order by ${orderByClause}
|
</if>
|
</select>
|
<select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
|
select
|
<include refid="Base_Column_List" />
|
from user
|
where id = #{id,jdbcType=INTEGER}
|
</select>
|
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
|
delete from user
|
where id = #{id,jdbcType=INTEGER}
|
</delete>
|
<delete id="deleteByExample" parameterType="com.nq.pojo.UserExample" >
|
delete from user
|
<if test="_parameter != null" >
|
<include refid="Example_Where_Clause" />
|
</if>
|
</delete>
|
<insert id="insert" parameterType="com.nq.pojo.User" >
|
<selectKey resultType="java.lang.Integer" keyProperty="id" order="BEFORE" >
|
SELECT LAST_INSERT_ID()
|
</selectKey>
|
insert into user ( agent_id, agent_name,
|
phone, user_pwd, with_pwd,
|
nick_name, real_name, id_card,
|
account_type, user_amt, enable_amt,
|
enale_withdraw_amt, hk_amt, sum_charge_amt,
|
sum_buy_amt, recom_phone, is_lock,
|
is_login, reg_time, reg_ip,
|
reg_address, img1_key, img2_key,
|
img3_key, is_active, auth_msg,
|
user_index_amt, enable_index_amt, user_fut_amt,
|
enable_fut_amt, withdrawal_Pwd, trading_amount,
|
is_authorize, sgzj, djzj,is_signed_contract,is_signed_agreement
|
)
|
values ( #{agentId,jdbcType=INTEGER}, #{agentName,jdbcType=VARCHAR},
|
#{phone,jdbcType=VARCHAR}, #{userPwd,jdbcType=VARCHAR}, #{withPwd,jdbcType=VARCHAR},
|
#{nickName,jdbcType=VARCHAR}, #{realName,jdbcType=VARCHAR}, #{idCard,jdbcType=VARCHAR},
|
#{accountType,jdbcType=INTEGER}, #{userAmt,jdbcType=DECIMAL}, #{enableAmt,jdbcType=DECIMAL},
|
#{enaleWithdrawAmt,jdbcType=DECIMAL}, #{hkAmt,jdbcType=DECIMAL}, #{sumChargeAmt,jdbcType=DECIMAL},
|
#{sumBuyAmt,jdbcType=DECIMAL}, #{recomPhone,jdbcType=VARCHAR}, #{isLock,jdbcType=INTEGER},
|
#{isLogin,jdbcType=INTEGER}, #{regTime,jdbcType=TIMESTAMP}, #{regIp,jdbcType=VARCHAR},
|
#{regAddress,jdbcType=VARCHAR}, #{img1Key,jdbcType=VARCHAR}, #{img2Key,jdbcType=VARCHAR},
|
#{img3Key,jdbcType=VARCHAR}, #{isActive,jdbcType=INTEGER}, #{authMsg,jdbcType=VARCHAR},
|
#{userIndexAmt,jdbcType=DECIMAL}, #{enableIndexAmt,jdbcType=DECIMAL}, #{userFutAmt,jdbcType=DECIMAL},
|
#{enableFutAmt,jdbcType=DECIMAL}, #{withdrawalPwd,jdbcType=VARCHAR}, #{tradingAmount,jdbcType=DECIMAL},
|
#{isAuthorize,jdbcType=INTEGER}, #{sgzj,jdbcType=DECIMAL}, #{djzj,jdbcType=DECIMAL}, #{isSignedContract,jdbcType=VARCHAR}, #{isSignedAgreement,jdbcType=VARCHAR}
|
)
|
</insert>
|
<insert id="insertSelective" parameterType="com.nq.pojo.User" >
|
<selectKey resultType="java.lang.Integer" keyProperty="id" order="BEFORE" >
|
SELECT LAST_INSERT_ID()
|
</selectKey>
|
insert into user
|
<trim prefix="(" suffix=")" suffixOverrides="," >
|
id,
|
<if test="agentId != null" >
|
agent_id,
|
</if>
|
<if test="agentName != null" >
|
agent_name,
|
</if>
|
<if test="phone != null" >
|
phone,
|
</if>
|
<if test="userPwd != null" >
|
user_pwd,
|
</if>
|
<if test="withPwd != null" >
|
with_pwd,
|
</if>
|
<if test="nickName != null" >
|
nick_name,
|
</if>
|
<if test="realName != null" >
|
real_name,
|
</if>
|
<if test="idCard != null" >
|
id_card,
|
</if>
|
<if test="accountType != null" >
|
account_type,
|
</if>
|
<if test="userAmt != null" >
|
user_amt,
|
</if>
|
<if test="enableAmt != null" >
|
enable_amt,
|
</if>
|
<if test="enaleWithdrawAmt != null" >
|
enale_withdraw_amt,
|
</if>
|
<if test="hkAmt != null" >
|
hk_amt,
|
</if>
|
<if test="sumChargeAmt != null" >
|
sum_charge_amt,
|
</if>
|
<if test="sumBuyAmt != null" >
|
sum_buy_amt,
|
</if>
|
<if test="recomPhone != null" >
|
recom_phone,
|
</if>
|
<if test="isLock != null" >
|
is_lock,
|
</if>
|
<if test="isLogin != null" >
|
is_login,
|
</if>
|
<if test="regTime != null" >
|
reg_time,
|
</if>
|
<if test="regIp != null" >
|
reg_ip,
|
</if>
|
<if test="regAddress != null" >
|
reg_address,
|
</if>
|
<if test="img1Key != null" >
|
img1_key,
|
</if>
|
<if test="img2Key != null" >
|
img2_key,
|
</if>
|
<if test="img3Key != null" >
|
img3_key,
|
</if>
|
<if test="isActive != null" >
|
is_active,
|
</if>
|
<if test="authMsg != null" >
|
auth_msg,
|
</if>
|
<if test="userIndexAmt != null" >
|
user_index_amt,
|
</if>
|
<if test="enableIndexAmt != null" >
|
enable_index_amt,
|
</if>
|
<if test="userFutAmt != null" >
|
user_fut_amt,
|
</if>
|
<if test="enableFutAmt != null" >
|
enable_fut_amt,
|
</if>
|
<if test="withdrawalPwd != null" >
|
withdrawal_Pwd,
|
</if>
|
<if test="tradingAmount != null" >
|
trading_amount,
|
</if>
|
<if test="isAuthorize != null" >
|
is_authorize,
|
</if>
|
<if test="sgzj != null" >
|
sgzj,
|
</if>
|
<if test="djzj != null" >
|
djzj,
|
</if>
|
<if test="withdrawalPwd != null" >
|
is_signed_contract,
|
</if>
|
<if test="withdrawalPwd != null" >
|
is_signed_agreement,
|
</if>
|
</trim>
|
<trim prefix="values (" suffix=")" suffixOverrides="," >
|
#{id,jdbcType=INTEGER},
|
<if test="agentId != null" >
|
#{agentId,jdbcType=INTEGER},
|
</if>
|
<if test="agentName != null" >
|
#{agentName,jdbcType=VARCHAR},
|
</if>
|
<if test="phone != null" >
|
#{phone,jdbcType=VARCHAR},
|
</if>
|
<if test="userPwd != null" >
|
#{userPwd,jdbcType=VARCHAR},
|
</if>
|
<if test="withPwd != null" >
|
#{withPwd,jdbcType=VARCHAR},
|
</if>
|
<if test="nickName != null" >
|
#{nickName,jdbcType=VARCHAR},
|
</if>
|
<if test="realName != null" >
|
#{realName,jdbcType=VARCHAR},
|
</if>
|
<if test="idCard != null" >
|
#{idCard,jdbcType=VARCHAR},
|
</if>
|
<if test="accountType != null" >
|
#{accountType,jdbcType=INTEGER},
|
</if>
|
<if test="userAmt != null" >
|
#{userAmt,jdbcType=DECIMAL},
|
</if>
|
<if test="enableAmt != null" >
|
#{enableAmt,jdbcType=DECIMAL},
|
</if>
|
<if test="enaleWithdrawAmt != null" >
|
#{enaleWithdrawAmt,jdbcType=DECIMAL},
|
</if>
|
<if test="hkAmt != null" >
|
#{hkAmt,jdbcType=DECIMAL},
|
</if>
|
<if test="sumChargeAmt != null" >
|
#{sumChargeAmt,jdbcType=DECIMAL},
|
</if>
|
<if test="sumBuyAmt != null" >
|
#{sumBuyAmt,jdbcType=DECIMAL},
|
</if>
|
<if test="recomPhone != null" >
|
#{recomPhone,jdbcType=VARCHAR},
|
</if>
|
<if test="isLock != null" >
|
#{isLock,jdbcType=INTEGER},
|
</if>
|
<if test="isLogin != null" >
|
#{isLogin,jdbcType=INTEGER},
|
</if>
|
<if test="regTime != null" >
|
#{regTime,jdbcType=TIMESTAMP},
|
</if>
|
<if test="regIp != null" >
|
#{regIp,jdbcType=VARCHAR},
|
</if>
|
<if test="regAddress != null" >
|
#{regAddress,jdbcType=VARCHAR},
|
</if>
|
<if test="img1Key != null" >
|
#{img1Key,jdbcType=VARCHAR},
|
</if>
|
<if test="img2Key != null" >
|
#{img2Key,jdbcType=VARCHAR},
|
</if>
|
<if test="img3Key != null" >
|
#{img3Key,jdbcType=VARCHAR},
|
</if>
|
<if test="isActive != null" >
|
#{isActive,jdbcType=INTEGER},
|
</if>
|
<if test="authMsg != null" >
|
#{authMsg,jdbcType=VARCHAR},
|
</if>
|
<if test="userIndexAmt != null" >
|
#{userIndexAmt,jdbcType=DECIMAL},
|
</if>
|
<if test="enableIndexAmt != null" >
|
#{enableIndexAmt,jdbcType=DECIMAL},
|
</if>
|
<if test="userFutAmt != null" >
|
#{userFutAmt,jdbcType=DECIMAL},
|
</if>
|
<if test="enableFutAmt != null" >
|
#{enableFutAmt,jdbcType=DECIMAL},
|
</if>
|
<if test="withdrawalPwd != null" >
|
#{withdrawalPwd,jdbcType=VARCHAR},
|
</if>
|
<if test="tradingAmount != null" >
|
#{tradingAmount,jdbcType=DECIMAL},
|
</if>
|
<if test="isAuthorize != null" >
|
#{isAuthorize,jdbcType=INTEGER},
|
</if>
|
<if test="sgzj != null" >
|
#{sgzj,jdbcType=DECIMAL},
|
</if>
|
<if test="djzj != null" >
|
#{djzj,jdbcType=DECIMAL},
|
</if>
|
<if test="isSignedContract != null" >
|
#{isSignedContract,jdbcType=VARCHAR},
|
</if>
|
<if test="isSignedAgreement != null" >
|
#{isSignedAgreement,jdbcType=VARCHAR},
|
</if>
|
</trim>
|
</insert>
|
<select id="countByExample" parameterType="com.nq.pojo.UserExample" resultType="java.lang.Integer" >
|
select count(*) from user
|
<if test="_parameter != null" >
|
<include refid="Example_Where_Clause" />
|
</if>
|
</select>
|
<update id="updateByExampleSelective" parameterType="map" >
|
update user
|
<set >
|
<if test="record.id != null" >
|
id = #{record.id,jdbcType=INTEGER},
|
</if>
|
<if test="record.agentId != null" >
|
agent_id = #{record.agentId,jdbcType=INTEGER},
|
</if>
|
<if test="record.agentName != null" >
|
agent_name = #{record.agentName,jdbcType=VARCHAR},
|
</if>
|
<if test="record.phone != null" >
|
phone = #{record.phone,jdbcType=VARCHAR},
|
</if>
|
<if test="record.withPwd != null" >
|
with_pwd = #{record.withPwd,jdbcType=VARCHAR},
|
</if>
|
<if test="record.nickName != null" >
|
nick_name = #{record.nickName,jdbcType=VARCHAR},
|
</if>
|
<if test="record.realName != null" >
|
real_name = #{record.realName,jdbcType=VARCHAR},
|
</if>
|
<if test="record.idCard != null" >
|
id_card = #{record.idCard,jdbcType=VARCHAR},
|
</if>
|
<if test="record.accountType != null" >
|
account_type = #{record.accountType,jdbcType=INTEGER},
|
</if>
|
<if test="record.userAmt != null" >
|
user_amt = #{record.userAmt,jdbcType=DECIMAL},
|
</if>
|
<if test="record.enableAmt != null" >
|
enable_amt = #{record.enableAmt,jdbcType=DECIMAL},
|
</if>
|
<if test="record.enaleWithdrawAmt != null" >
|
enale_withdraw_amt = #{record.enaleWithdrawAmt,jdbcType=DECIMAL},
|
</if>
|
<if test="record.hkAmt != null" >
|
hk_amt = #{record.hkAmt,jdbcType=DECIMAL},
|
</if>
|
<if test="record.sumChargeAmt != null" >
|
sum_charge_amt = #{record.sumChargeAmt,jdbcType=DECIMAL},
|
</if>
|
<if test="record.sumBuyAmt != null" >
|
sum_buy_amt = #{record.sumBuyAmt,jdbcType=DECIMAL},
|
</if>
|
<if test="record.recomPhone != null" >
|
recom_phone = #{record.recomPhone,jdbcType=VARCHAR},
|
</if>
|
<if test="record.isLock != null" >
|
is_lock = #{record.isLock,jdbcType=INTEGER},
|
</if>
|
<if test="record.isLogin != null" >
|
is_login = #{record.isLogin,jdbcType=INTEGER},
|
</if>
|
<if test="record.regTime != null" >
|
reg_time = #{record.regTime,jdbcType=TIMESTAMP},
|
</if>
|
<if test="record.regIp != null" >
|
reg_ip = #{record.regIp,jdbcType=VARCHAR},
|
</if>
|
<if test="record.regAddress != null" >
|
reg_address = #{record.regAddress,jdbcType=VARCHAR},
|
</if>
|
<if test="record.img1Key != null" >
|
img1_key = #{record.img1Key,jdbcType=VARCHAR},
|
</if>
|
<if test="record.img2Key != null" >
|
img2_key = #{record.img2Key,jdbcType=VARCHAR},
|
</if>
|
<if test="record.img3Key != null" >
|
img3_key = #{record.img3Key,jdbcType=VARCHAR},
|
</if>
|
<if test="record.isActive != null" >
|
is_active = #{record.isActive,jdbcType=INTEGER},
|
</if>
|
<if test="record.authMsg != null" >
|
auth_msg = #{record.authMsg,jdbcType=VARCHAR},
|
</if>
|
<if test="record.userIndexAmt != null" >
|
user_index_amt = #{record.userIndexAmt,jdbcType=DECIMAL},
|
</if>
|
<if test="record.enableIndexAmt != null" >
|
enable_index_amt = #{record.enableIndexAmt,jdbcType=DECIMAL},
|
</if>
|
<if test="record.userFutAmt != null" >
|
user_fut_amt = #{record.userFutAmt,jdbcType=DECIMAL},
|
</if>
|
<if test="record.enableFutAmt != null" >
|
enable_fut_amt = #{record.enableFutAmt,jdbcType=DECIMAL},
|
</if>
|
<if test="record.withdrawalPwd != null" >
|
withdrawal_Pwd = #{record.withdrawalPwd,jdbcType=VARCHAR},
|
</if>
|
<if test="record.tradingAmount != null" >
|
trading_amount = #{record.tradingAmount,jdbcType=DECIMAL},
|
</if>
|
<if test="record.isAuthorize != null" >
|
is_authorize = #{record.isAuthorize,jdbcType=INTEGER},
|
</if>
|
<if test="record.sgzj != null" >
|
sgzj = #{record.sgzj,jdbcType=DECIMAL},
|
</if>
|
<if test="record.djzj != null" >
|
djzj = #{record.djzj,jdbcType=DECIMAL},
|
</if>
|
<if test="record.isSignedContract != null" >
|
is_signed_contract = #{record.isSignedContract,jdbcType=VARCHAR},
|
</if>
|
<if test="record.isSignedAgreement != null" >
|
is_signed_agreement = #{record.isSignedAgreement,jdbcType=VARCHAR},
|
</if>
|
</set>
|
<if test="_parameter != null" >
|
<include refid="Update_By_Example_Where_Clause" />
|
</if>
|
</update>
|
<update id="updateByExample" parameterType="map" >
|
update user
|
set id = #{record.id,jdbcType=INTEGER},
|
agent_id = #{record.agentId,jdbcType=INTEGER},
|
agent_name = #{record.agentName,jdbcType=VARCHAR},
|
phone = #{record.phone,jdbcType=VARCHAR},
|
with_pwd = #{record.withPwd,jdbcType=VARCHAR},
|
nick_name = #{record.nickName,jdbcType=VARCHAR},
|
real_name = #{record.realName,jdbcType=VARCHAR},
|
id_card = #{record.idCard,jdbcType=VARCHAR},
|
account_type = #{record.accountType,jdbcType=INTEGER},
|
user_amt = #{record.userAmt,jdbcType=DECIMAL},
|
enable_amt = #{record.enableAmt,jdbcType=DECIMAL},
|
enale_withdraw_amt = #{record.enaleWithdrawAmt,jdbcType=DECIMAL},
|
hk_amt = #{record.hkAmt,jdbcType=DECIMAL},
|
sum_charge_amt = #{record.sumChargeAmt,jdbcType=DECIMAL},
|
sum_buy_amt = #{record.sumBuyAmt,jdbcType=DECIMAL},
|
recom_phone = #{record.recomPhone,jdbcType=VARCHAR},
|
is_lock = #{record.isLock,jdbcType=INTEGER},
|
is_login = #{record.isLogin,jdbcType=INTEGER},
|
reg_time = #{record.regTime,jdbcType=TIMESTAMP},
|
reg_ip = #{record.regIp,jdbcType=VARCHAR},
|
reg_address = #{record.regAddress,jdbcType=VARCHAR},
|
img1_key = #{record.img1Key,jdbcType=VARCHAR},
|
img2_key = #{record.img2Key,jdbcType=VARCHAR},
|
img3_key = #{record.img3Key,jdbcType=VARCHAR},
|
is_active = #{record.isActive,jdbcType=INTEGER},
|
auth_msg = #{record.authMsg,jdbcType=VARCHAR},
|
user_index_amt = #{record.userIndexAmt,jdbcType=DECIMAL},
|
enable_index_amt = #{record.enableIndexAmt,jdbcType=DECIMAL},
|
user_fut_amt = #{record.userFutAmt,jdbcType=DECIMAL},
|
enable_fut_amt = #{record.enableFutAmt,jdbcType=DECIMAL},
|
withdrawal_Pwd = #{record.withdrawalPwd,jdbcType=VARCHAR},
|
trading_amount = #{record.tradingAmount,jdbcType=DECIMAL},
|
is_authorize = #{record.isAuthorize,jdbcType=INTEGER},
|
sgzj = #{record.sgzj,jdbcType=DECIMAL},
|
djzj = #{record.djzj,jdbcType=DECIMAL},
|
is_signed_contract = #{record.isSignedContract,jdbcType=VARCHAR},
|
is_signed_agreement = #{record.isSignedAgreement,jdbcType=VARCHAR}
|
<if test="_parameter != null" >
|
<include refid="Update_By_Example_Where_Clause" />
|
</if>
|
</update>
|
|
<!--修改密码使用的更新-->
|
<update id="updateByPrimaryKeySelective" parameterType="com.nq.pojo.User" >
|
update user
|
<set >
|
<if test="agentId != null" >
|
agent_id = #{agentId,jdbcType=INTEGER},
|
</if>
|
<if test="agentName != null" >
|
agent_name = #{agentName,jdbcType=VARCHAR},
|
</if>
|
<if test="phone != null" >
|
phone = #{phone,jdbcType=VARCHAR},
|
</if>
|
<if test="userPwd != null and userPwd != ''" >
|
user_pwd = #{userPwd,jdbcType=VARCHAR},
|
</if>
|
<if test="withPwd != null" >
|
with_pwd = #{withPwd,jdbcType=VARCHAR},
|
</if>
|
<if test="nickName != null" >
|
nick_name = #{nickName,jdbcType=VARCHAR},
|
</if>
|
<if test="realName != null" >
|
real_name = #{realName,jdbcType=VARCHAR},
|
</if>
|
<if test="idCard != null" >
|
id_card = #{idCard,jdbcType=VARCHAR},
|
</if>
|
<if test="accountType != null" >
|
account_type = #{accountType,jdbcType=INTEGER},
|
</if>
|
<if test="userAmt != null" >
|
user_amt = #{userAmt,jdbcType=DECIMAL},
|
</if>
|
<if test="enableAmt != null" >
|
enable_amt = #{enableAmt,jdbcType=DECIMAL},
|
</if>
|
<if test="enaleWithdrawAmt != null" >
|
enale_withdraw_amt = #{enaleWithdrawAmt,jdbcType=DECIMAL},
|
</if>
|
<if test="hkAmt != null" >
|
hk_amt = #{hkAmt,jdbcType=DECIMAL},
|
</if>
|
<if test="sumChargeAmt != null" >
|
sum_charge_amt = #{sumChargeAmt,jdbcType=DECIMAL},
|
</if>
|
<if test="sumBuyAmt != null" >
|
sum_buy_amt = #{sumBuyAmt,jdbcType=DECIMAL},
|
</if>
|
<if test="recomPhone != null" >
|
recom_phone = #{recomPhone,jdbcType=VARCHAR},
|
</if>
|
<if test="isLock != null" >
|
is_lock = #{isLock,jdbcType=INTEGER},
|
</if>
|
<if test="isLogin != null" >
|
is_login = #{isLogin,jdbcType=INTEGER},
|
</if>
|
<if test="regTime != null" >
|
reg_time = #{regTime,jdbcType=TIMESTAMP},
|
</if>
|
<if test="regIp != null" >
|
reg_ip = #{regIp,jdbcType=VARCHAR},
|
</if>
|
<if test="regAddress != null" >
|
reg_address = #{regAddress,jdbcType=VARCHAR},
|
</if>
|
<if test="img1Key != null" >
|
img1_key = #{img1Key,jdbcType=VARCHAR},
|
</if>
|
<if test="img2Key != null" >
|
img2_key = #{img2Key,jdbcType=VARCHAR},
|
</if>
|
<if test="img3Key != null" >
|
img3_key = #{img3Key,jdbcType=VARCHAR},
|
</if>
|
<if test="isActive != null" >
|
is_active = #{isActive,jdbcType=INTEGER},
|
</if>
|
<if test="authMsg != null" >
|
auth_msg = #{authMsg,jdbcType=VARCHAR},
|
</if>
|
<if test="userIndexAmt != null" >
|
user_index_amt = #{userIndexAmt,jdbcType=DECIMAL},
|
</if>
|
<if test="enableIndexAmt != null" >
|
enable_index_amt = #{enableIndexAmt,jdbcType=DECIMAL},
|
</if>
|
<if test="userFutAmt != null" >
|
user_fut_amt = #{userFutAmt,jdbcType=DECIMAL},
|
</if>
|
<if test="enableFutAmt != null" >
|
enable_fut_amt = #{enableFutAmt,jdbcType=DECIMAL},
|
</if>
|
<if test="withdrawalPwd != null" >
|
withdrawal_Pwd = #{withdrawalPwd,jdbcType=VARCHAR},
|
</if>
|
<if test="tradingAmount != null" >
|
trading_amount = #{tradingAmount,jdbcType=DECIMAL},
|
</if>
|
<if test="isAuthorize != null" >
|
is_authorize = #{isAuthorize,jdbcType=INTEGER},
|
</if>
|
<if test="sgzj != null" >
|
sgzj = #{sgzj,jdbcType=DECIMAL},
|
</if>
|
<if test="djzj != null" >
|
djzj = #{djzj,jdbcType=DECIMAL},
|
</if>
|
<if test="isSignedContract != null" >
|
is_signed_contract = #{isSignedContract,jdbcType=VARCHAR},
|
</if>
|
<if test="isSignedAgreement != null" >
|
is_signed_agreement = #{isSignedAgreement,jdbcType=VARCHAR},
|
</if>
|
</set>
|
where id = #{id,jdbcType=INTEGER}
|
</update>
|
<update id="updateSignedContract">
|
update user set is_signed_contract=#{signedContract,jdbcType=VARCHAR} where id = #{userId,jdbcType=INTEGER}
|
</update>
|
<update id="updateSignedAgreement">
|
update user set is_signed_agreement=#{signedAgreement,jdbcType=VARCHAR} where id = #{userId,jdbcType=INTEGER}
|
</update>
|
<update id="updateByPrimaryKey" parameterType="com.nq.pojo.User" >
|
update user
|
set agent_id = #{agentId,jdbcType=INTEGER},
|
agent_name = #{agentName,jdbcType=VARCHAR},
|
phone = #{phone,jdbcType=VARCHAR},
|
with_pwd = #{withPwd,jdbcType=VARCHAR},
|
nick_name = #{nickName,jdbcType=VARCHAR},
|
real_name = #{realName,jdbcType=VARCHAR},
|
id_card = #{idCard,jdbcType=VARCHAR},
|
account_type = #{accountType,jdbcType=INTEGER},
|
user_amt = #{userAmt,jdbcType=DECIMAL},
|
enable_amt = #{enableAmt,jdbcType=DECIMAL},
|
enale_withdraw_amt = #{enaleWithdrawAmt,jdbcType=DECIMAL},
|
hk_amt = #{hkAmt,jdbcType=DECIMAL},
|
sum_charge_amt = #{sumChargeAmt,jdbcType=DECIMAL},
|
sum_buy_amt = #{sumBuyAmt,jdbcType=DECIMAL},
|
recom_phone = #{recomPhone,jdbcType=VARCHAR},
|
is_lock = #{isLock,jdbcType=INTEGER},
|
is_login = #{isLogin,jdbcType=INTEGER},
|
reg_time = #{regTime,jdbcType=TIMESTAMP},
|
reg_ip = #{regIp,jdbcType=VARCHAR},
|
reg_address = #{regAddress,jdbcType=VARCHAR},
|
img1_key = #{img1Key,jdbcType=VARCHAR},
|
img2_key = #{img2Key,jdbcType=VARCHAR},
|
img3_key = #{img3Key,jdbcType=VARCHAR},
|
is_active = #{isActive,jdbcType=INTEGER},
|
auth_msg = #{authMsg,jdbcType=VARCHAR},
|
user_index_amt = #{userIndexAmt,jdbcType=DECIMAL},
|
enable_index_amt = #{enableIndexAmt,jdbcType=DECIMAL},
|
user_fut_amt = #{userFutAmt,jdbcType=DECIMAL},
|
enable_fut_amt = #{enableFutAmt,jdbcType=DECIMAL},
|
withdrawal_Pwd = #{withdrawalPwd,jdbcType=VARCHAR},
|
trading_amount = #{tradingAmount,jdbcType=DECIMAL},
|
is_authorize = #{isAuthorize,jdbcType=INTEGER},
|
sgzj = #{sgzj,jdbcType=DECIMAL},
|
djzj = #{djzj,jdbcType=DECIMAL},
|
is_signed_contract = #{record.isSignedContract,jdbcType=VARCHAR},
|
is_signed_agreement = #{record.isSignedAgreement,jdbcType=VARCHAR}
|
where id = #{id,jdbcType=INTEGER}
|
</update>
|
|
|
<select id="findByPhone" parameterType="string" resultMap="BaseResultMap">
|
SELECT
|
<include refid="Base_Column_List"/>
|
FROM user
|
WHERE phone = #{phoneNum}
|
</select>
|
|
<select id="login" resultMap="BaseResultMap" parameterType="map">
|
SELECT
|
<include refid="Base_Column_List"/>
|
FROM user
|
WHERE phone = #{phone} and user_pwd = #{userPwd}
|
</select>
|
|
<select id="listByAgent" resultMap="BaseResultMap" parameterType="map">
|
SELECT
|
<include refid="Base_Column_List"/>
|
FROM user
|
<where>
|
(agent_id = #{searchId} or
|
agent_id in (select a.id FROM agent_user a left join agent_distribution_user d on a.id = d.agent_id WHERE d.parent_id = #{searchId})
|
)
|
<if test="realName != null and realName != '' ">
|
and real_name like CONCAT('%','${realName}','%')
|
</if>
|
<if test="phone != null and phone != '' ">
|
and phone like CONCAT('%','${phone}','%')
|
</if>
|
<if test="accountType != null ">
|
and account_type = #{accountType}
|
</if>
|
</where>
|
ORDER BY id DESC
|
</select>
|
|
|
<select id="listByAdmin" resultMap="BaseResultMap" parameterType="map">
|
SELECT
|
<include refid="Base_Column_List"/>
|
FROM user
|
<where>
|
<if test="searchId != null ">
|
and agent_id = #{searchId}
|
</if>
|
<if test="realName != null and realName != '' ">
|
and real_name like CONCAT('%','${realName}','%')
|
</if>
|
<if test="phone != null and phone != '' ">
|
and phone like CONCAT('%','${phone}','%')
|
</if>
|
<if test="accountType != null ">
|
and account_type = #{accountType}
|
</if>
|
</where>
|
ORDER BY id DESC
|
</select>
|
|
|
<select id="CountUserSize" parameterType="integer" resultType="int">
|
SELECT COUNT(id) FROM user WHERE account_type = #{accountType}
|
</select>
|
|
<select id="CountUserAmt" parameterType="integer" resultType="decimal">
|
SELECT sum(user_amt) FROM user WHERE account_type = #{accountType}
|
</select>
|
<select id="CountEnableAmt" parameterType="integer" resultType="decimal">
|
SELECT sum(enable_amt) FROM user WHERE account_type = #{accountType}
|
</select>
|
|
<update id="updateUserAmt">
|
update `user` set user_amt = user_amt + #{user_amt} where id = #{user_id}
|
</update>
|
|
</mapper>
|