|  | @@ -1,86 +1,126 @@
 | 
	
		
			
				|  |  |  <?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">
 | 
	
		
			
				|  |  | +        PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 | 
	
		
			
				|  |  | +        "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 | 
	
		
			
				|  |  |  <mapper namespace="com.fs.store.mapper.FsUserMapper">
 | 
	
		
			
				|  |  |      <resultMap type="FsUser" id="FsUserResult">
 | 
	
		
			
				|  |  | -        <result property="userId"    column="user_id"    />
 | 
	
		
			
				|  |  | -        <result property="username"    column="username"    />
 | 
	
		
			
				|  |  | -        <result property="password"    column="password"    />
 | 
	
		
			
				|  |  | -        <result property="realName"    column="real_name"    />
 | 
	
		
			
				|  |  | -        <result property="birthday"    column="birthday"    />
 | 
	
		
			
				|  |  | -        <result property="idCard"    column="id_card"    />
 | 
	
		
			
				|  |  | -        <result property="remark"    column="remark"    />
 | 
	
		
			
				|  |  | -        <result property="nickname"    column="nickname"    />
 | 
	
		
			
				|  |  | -        <result property="avatar"    column="avatar"    />
 | 
	
		
			
				|  |  | -        <result property="phone"    column="phone"    />
 | 
	
		
			
				|  |  | -        <result property="createTime"    column="create_time"    />
 | 
	
		
			
				|  |  | -        <result property="updateTime"    column="update_time"    />
 | 
	
		
			
				|  |  | -        <result property="lastIp"    column="last_ip"    />
 | 
	
		
			
				|  |  | -        <result property="nowMoney"    column="now_money"    />
 | 
	
		
			
				|  |  | -        <result property="brokeragePrice"    column="brokerage_price"    />
 | 
	
		
			
				|  |  | -        <result property="integral"    column="integral"    />
 | 
	
		
			
				|  |  | -        <result property="signNum"    column="sign_num"    />
 | 
	
		
			
				|  |  | -        <result property="status"    column="status"    />
 | 
	
		
			
				|  |  | -        <result property="level"    column="level"    />
 | 
	
		
			
				|  |  | -        <result property="spreadUserId"    column="spread_user_id"    />
 | 
	
		
			
				|  |  | -        <result property="spreadTime"    column="spread_time"    />
 | 
	
		
			
				|  |  | -        <result property="userType"    column="user_type"    />
 | 
	
		
			
				|  |  | -        <result property="isPromoter"    column="is_promoter"    />
 | 
	
		
			
				|  |  | -        <result property="payCount"    column="pay_count"    />
 | 
	
		
			
				|  |  | -        <result property="spreadCount"    column="spread_count"    />
 | 
	
		
			
				|  |  | -        <result property="addres"    column="addres"    />
 | 
	
		
			
				|  |  | -        <result property="maOpenId"    column="ma_open_id"    />
 | 
	
		
			
				|  |  | -        <result property="mpOpenId"    column="mp_open_id"    />
 | 
	
		
			
				|  |  | -        <result property="unionId"    column="union_id"    />
 | 
	
		
			
				|  |  | -        <result property="isDel"    column="is_del"    />
 | 
	
		
			
				|  |  | -        <result property="isWeixinAuth"    column="is_weixin_auth"    />
 | 
	
		
			
				|  |  | -        <result property="companyId"    column="company_id"    />
 | 
	
		
			
				|  |  | -        <result property="companyUserId"    column="company_user_id"    />
 | 
	
		
			
				|  |  | -        <result property="registerDate"    column="register_date"    />
 | 
	
		
			
				|  |  | -        <result property="registerCode"    column="register_code"    />
 | 
	
		
			
				|  |  | -        <result property="source"    column="source"    />
 | 
	
		
			
				|  |  | -        <result property="userCode"    column="user_code"    />
 | 
	
		
			
				|  |  | -        <result property="isShow"    column="is_show"    />
 | 
	
		
			
				|  |  | +        <result property="userId" column="user_id"/>
 | 
	
		
			
				|  |  | +        <result property="username" column="username"/>
 | 
	
		
			
				|  |  | +        <result property="password" column="password"/>
 | 
	
		
			
				|  |  | +        <result property="realName" column="real_name"/>
 | 
	
		
			
				|  |  | +        <result property="birthday" column="birthday"/>
 | 
	
		
			
				|  |  | +        <result property="idCard" column="id_card"/>
 | 
	
		
			
				|  |  | +        <result property="remark" column="remark"/>
 | 
	
		
			
				|  |  | +        <result property="nickname" column="nickname"/>
 | 
	
		
			
				|  |  | +        <result property="avatar" column="avatar"/>
 | 
	
		
			
				|  |  | +        <result property="phone" column="phone"/>
 | 
	
		
			
				|  |  | +        <result property="createTime" column="create_time"/>
 | 
	
		
			
				|  |  | +        <result property="updateTime" column="update_time"/>
 | 
	
		
			
				|  |  | +        <result property="lastIp" column="last_ip"/>
 | 
	
		
			
				|  |  | +        <result property="nowMoney" column="now_money"/>
 | 
	
		
			
				|  |  | +        <result property="brokeragePrice" column="brokerage_price"/>
 | 
	
		
			
				|  |  | +        <result property="integral" column="integral"/>
 | 
	
		
			
				|  |  | +        <result property="signNum" column="sign_num"/>
 | 
	
		
			
				|  |  | +        <result property="status" column="status"/>
 | 
	
		
			
				|  |  | +        <result property="level" column="level"/>
 | 
	
		
			
				|  |  | +        <result property="spreadUserId" column="spread_user_id"/>
 | 
	
		
			
				|  |  | +        <result property="spreadTime" column="spread_time"/>
 | 
	
		
			
				|  |  | +        <result property="userType" column="user_type"/>
 | 
	
		
			
				|  |  | +        <result property="isPromoter" column="is_promoter"/>
 | 
	
		
			
				|  |  | +        <result property="payCount" column="pay_count"/>
 | 
	
		
			
				|  |  | +        <result property="spreadCount" column="spread_count"/>
 | 
	
		
			
				|  |  | +        <result property="addres" column="addres"/>
 | 
	
		
			
				|  |  | +        <result property="maOpenId" column="ma_open_id"/>
 | 
	
		
			
				|  |  | +        <result property="mpOpenId" column="mp_open_id"/>
 | 
	
		
			
				|  |  | +        <result property="unionId" column="union_id"/>
 | 
	
		
			
				|  |  | +        <result property="isDel" column="is_del"/>
 | 
	
		
			
				|  |  | +        <result property="isWeixinAuth" column="is_weixin_auth"/>
 | 
	
		
			
				|  |  | +        <result property="companyId" column="company_id"/>
 | 
	
		
			
				|  |  | +        <result property="companyUserId" column="company_user_id"/>
 | 
	
		
			
				|  |  | +        <result property="registerDate" column="register_date"/>
 | 
	
		
			
				|  |  | +        <result property="registerCode" column="register_code"/>
 | 
	
		
			
				|  |  | +        <result property="source" column="source"/>
 | 
	
		
			
				|  |  | +        <result property="userCode" column="user_code"/>
 | 
	
		
			
				|  |  | +        <result property="isShow" column="is_show"/>
 | 
	
		
			
				|  |  |      </resultMap>
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |      <sql id="selectFsUserVo">
 | 
	
		
			
				|  |  | -        select user_id,is_show, username, password, real_name, birthday, id_card, remark, nickname, avatar, phone, create_time, update_time, last_ip, now_money, brokerage_price, integral, sign_num, status, level, spread_user_id, spread_time, user_type, is_promoter, pay_count, spread_count, addres,ma_open_id,mp_open_id,union_id, is_del,is_weixin_auth,company_id,company_user_id,register_date,register_code,source,user_code from fs_user
 | 
	
		
			
				|  |  | +        select user_id,
 | 
	
		
			
				|  |  | +               is_show,
 | 
	
		
			
				|  |  | +               username,
 | 
	
		
			
				|  |  | +               password,
 | 
	
		
			
				|  |  | +               real_name,
 | 
	
		
			
				|  |  | +               birthday,
 | 
	
		
			
				|  |  | +               id_card,
 | 
	
		
			
				|  |  | +               remark,
 | 
	
		
			
				|  |  | +               nickname,
 | 
	
		
			
				|  |  | +               avatar,
 | 
	
		
			
				|  |  | +               phone,
 | 
	
		
			
				|  |  | +               create_time,
 | 
	
		
			
				|  |  | +               update_time,
 | 
	
		
			
				|  |  | +               last_ip,
 | 
	
		
			
				|  |  | +               now_money,
 | 
	
		
			
				|  |  | +               brokerage_price,
 | 
	
		
			
				|  |  | +               integral,
 | 
	
		
			
				|  |  | +               sign_num,
 | 
	
		
			
				|  |  | +               status,
 | 
	
		
			
				|  |  | +               level,
 | 
	
		
			
				|  |  | +               spread_user_id,
 | 
	
		
			
				|  |  | +               spread_time,
 | 
	
		
			
				|  |  | +               user_type,
 | 
	
		
			
				|  |  | +               is_promoter,
 | 
	
		
			
				|  |  | +               pay_count,
 | 
	
		
			
				|  |  | +               spread_count,
 | 
	
		
			
				|  |  | +               addres,
 | 
	
		
			
				|  |  | +               ma_open_id,
 | 
	
		
			
				|  |  | +               mp_open_id,
 | 
	
		
			
				|  |  | +               union_id,
 | 
	
		
			
				|  |  | +               is_del,
 | 
	
		
			
				|  |  | +               is_weixin_auth,
 | 
	
		
			
				|  |  | +               company_id,
 | 
	
		
			
				|  |  | +               company_user_id,
 | 
	
		
			
				|  |  | +               register_date,
 | 
	
		
			
				|  |  | +               register_code,
 | 
	
		
			
				|  |  | +               source,
 | 
	
		
			
				|  |  | +               user_code
 | 
	
		
			
				|  |  | +        from fs_user
 | 
	
		
			
				|  |  |      </sql>
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |      <select id="selectFsUserList" parameterType="FsUser" resultMap="FsUserResult">
 | 
	
		
			
				|  |  |          <include refid="selectFsUserVo"/>
 | 
	
		
			
				|  |  |          <where>
 | 
	
		
			
				|  |  | -            <if test="username != null  and username != ''"> and username like concat('%', #{username}, '%')</if>
 | 
	
		
			
				|  |  | -            <if test="password != null  and password != ''"> and password = #{password}</if>
 | 
	
		
			
				|  |  | -            <if test="realName != null  and realName != ''"> and real_name like concat('%', #{realName}, '%')</if>
 | 
	
		
			
				|  |  | -            <if test="birthday != null "> and birthday = #{birthday}</if>
 | 
	
		
			
				|  |  | -            <if test="idCard != null  and idCard != ''"> and id_card = #{idCard}</if>
 | 
	
		
			
				|  |  | -            <if test="remark != null  and remark != ''"> and remark = #{remark}</if>
 | 
	
		
			
				|  |  | -            <if test="nickname != null  and nickname != ''"> and nickname like concat('%', #{nickname}, '%')</if>
 | 
	
		
			
				|  |  | -            <if test="avatar != null  and avatar != ''"> and avatar = #{avatar}</if>
 | 
	
		
			
				|  |  | -            <if test="phone != null  and phone != ''"> and phone = #{phone}</if>
 | 
	
		
			
				|  |  | -            <if test="lastIp != null  and lastIp != ''"> and last_ip = #{lastIp}</if>
 | 
	
		
			
				|  |  | -            <if test="nowMoney != null "> and now_money = #{nowMoney}</if>
 | 
	
		
			
				|  |  | -            <if test="brokeragePrice != null "> and brokerage_price = #{brokeragePrice}</if>
 | 
	
		
			
				|  |  | -            <if test="integral != null "> and integral = #{integral}</if>
 | 
	
		
			
				|  |  | -            <if test="signNum != null "> and sign_num = #{signNum}</if>
 | 
	
		
			
				|  |  | -            <if test="status != null "> and status = #{status}</if>
 | 
	
		
			
				|  |  | -            <if test="level != null "> and level = #{level}</if>
 | 
	
		
			
				|  |  | -            <if test="spreadUserId != null "> and spread_user_id = #{spreadUserId}</if>
 | 
	
		
			
				|  |  | -            <if test="spreadTime != null "> and spread_time = #{spreadTime}</if>
 | 
	
		
			
				|  |  | -            <if test="userType != null  and userType != ''"> and user_type = #{userType}</if>
 | 
	
		
			
				|  |  | -            <if test="isPromoter != null "> and is_promoter = #{isPromoter}</if>
 | 
	
		
			
				|  |  | -            <if test="payCount != null "> and pay_count = #{payCount}</if>
 | 
	
		
			
				|  |  | -            <if test="spreadCount != null "> and spread_count = #{spreadCount}</if>
 | 
	
		
			
				|  |  | -            <if test="addres != null  and addres != ''"> and addres = #{addres}</if>
 | 
	
		
			
				|  |  | -            <if test="isDel != null "> and is_del = #{isDel}</if>
 | 
	
		
			
				|  |  | -            <if test="companyId != null "> and company_id = #{companyId}</if>
 | 
	
		
			
				|  |  | -            <if test="companyUserId != null "> and company_user_id = #{companyUserId}</if>
 | 
	
		
			
				|  |  | -            <if test="registerDate != null "> and DATE_FORMAT(register_date,'%Y-%m-%d') = DATE_FORMAT(#{registerDate},'%Y-%m-%d')</if>
 | 
	
		
			
				|  |  | -            <if test="registerCode != null   and registerCode != '' "> and register_code = #{registerCode}</if>
 | 
	
		
			
				|  |  | -            <if test="source != null  and source != '' "> and source = #{source}</if>
 | 
	
		
			
				|  |  | -            <if test="isShow != null  "> and is_show = #{isShow}</if>
 | 
	
		
			
				|  |  | +            <if test="username != null  and username != ''">and username like concat('%', #{username}, '%')</if>
 | 
	
		
			
				|  |  | +            <if test="password != null  and password != ''">and password = #{password}</if>
 | 
	
		
			
				|  |  | +            <if test="realName != null  and realName != ''">and real_name like concat('%', #{realName}, '%')</if>
 | 
	
		
			
				|  |  | +            <if test="birthday != null ">and birthday = #{birthday}</if>
 | 
	
		
			
				|  |  | +            <if test="idCard != null  and idCard != ''">and id_card = #{idCard}</if>
 | 
	
		
			
				|  |  | +            <if test="remark != null  and remark != ''">and remark = #{remark}</if>
 | 
	
		
			
				|  |  | +            <if test="nickname != null  and nickname != ''">and nickname like concat('%', #{nickname}, '%')</if>
 | 
	
		
			
				|  |  | +            <if test="avatar != null  and avatar != ''">and avatar = #{avatar}</if>
 | 
	
		
			
				|  |  | +            <if test="phone != null  and phone != ''">and phone = #{phone}</if>
 | 
	
		
			
				|  |  | +            <if test="lastIp != null  and lastIp != ''">and last_ip = #{lastIp}</if>
 | 
	
		
			
				|  |  | +            <if test="nowMoney != null ">and now_money = #{nowMoney}</if>
 | 
	
		
			
				|  |  | +            <if test="brokeragePrice != null ">and brokerage_price = #{brokeragePrice}</if>
 | 
	
		
			
				|  |  | +            <if test="integral != null ">and integral = #{integral}</if>
 | 
	
		
			
				|  |  | +            <if test="signNum != null ">and sign_num = #{signNum}</if>
 | 
	
		
			
				|  |  | +            <if test="status != null ">and status = #{status}</if>
 | 
	
		
			
				|  |  | +            <if test="level != null ">and level = #{level}</if>
 | 
	
		
			
				|  |  | +            <if test="spreadUserId != null ">and spread_user_id = #{spreadUserId}</if>
 | 
	
		
			
				|  |  | +            <if test="spreadTime != null ">and spread_time = #{spreadTime}</if>
 | 
	
		
			
				|  |  | +            <if test="userType != null  and userType != ''">and user_type = #{userType}</if>
 | 
	
		
			
				|  |  | +            <if test="isPromoter != null ">and is_promoter = #{isPromoter}</if>
 | 
	
		
			
				|  |  | +            <if test="payCount != null ">and pay_count = #{payCount}</if>
 | 
	
		
			
				|  |  | +            <if test="spreadCount != null ">and spread_count = #{spreadCount}</if>
 | 
	
		
			
				|  |  | +            <if test="addres != null  and addres != ''">and addres = #{addres}</if>
 | 
	
		
			
				|  |  | +            <if test="isDel != null ">and is_del = #{isDel}</if>
 | 
	
		
			
				|  |  | +            <if test="companyId != null ">and company_id = #{companyId}</if>
 | 
	
		
			
				|  |  | +            <if test="companyUserId != null ">and company_user_id = #{companyUserId}</if>
 | 
	
		
			
				|  |  | +            <if test="registerDate != null ">and DATE_FORMAT(register_date,'%Y-%m-%d') =
 | 
	
		
			
				|  |  | +                DATE_FORMAT(#{registerDate},'%Y-%m-%d')
 | 
	
		
			
				|  |  | +            </if>
 | 
	
		
			
				|  |  | +            <if test="registerCode != null   and registerCode != '' ">and register_code = #{registerCode}</if>
 | 
	
		
			
				|  |  | +            <if test="source != null  and source != '' ">and source = #{source}</if>
 | 
	
		
			
				|  |  | +            <if test="isShow != null  ">and is_show = #{isShow}</if>
 | 
	
		
			
				|  |  |          </where>
 | 
	
		
			
				|  |  |          order by user_id desc
 | 
	
		
			
				|  |  |      </select>
 | 
	
	
		
			
				|  | @@ -92,44 +132,91 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 | 
	
		
			
				|  |  |      <select id="selectFsUserListLimit" resultType="com.fs.store.domain.FsUser">
 | 
	
		
			
				|  |  |          <include refid="selectFsUserVo"/>
 | 
	
		
			
				|  |  |          <where>
 | 
	
		
			
				|  |  | -            <if test="password != null  and password != ''"> and password = #{password}</if>
 | 
	
		
			
				|  |  | -            <if test="realName != null  and realName != ''"> and real_name like concat('%', #{realName}, '%')</if>
 | 
	
		
			
				|  |  | -            <if test="birthday != null "> and birthday = #{birthday}</if>
 | 
	
		
			
				|  |  | -            <if test="idCard != null  and idCard != ''"> and id_card = #{idCard}</if>
 | 
	
		
			
				|  |  | -            <if test="remark != null  and remark != ''"> and remark = #{remark}</if>
 | 
	
		
			
				|  |  | -            <if test="avatar != null  and avatar != ''"> and avatar = #{avatar}</if>
 | 
	
		
			
				|  |  | -            <if test="lastIp != null  and lastIp != ''"> and last_ip = #{lastIp}</if>
 | 
	
		
			
				|  |  | -            <if test="nowMoney != null "> and now_money = #{nowMoney}</if>
 | 
	
		
			
				|  |  | -            <if test="brokeragePrice != null "> and brokerage_price = #{brokeragePrice}</if>
 | 
	
		
			
				|  |  | -            <if test="integral != null "> and integral = #{integral}</if>
 | 
	
		
			
				|  |  | -            <if test="signNum != null "> and sign_num = #{signNum}</if>
 | 
	
		
			
				|  |  | -            <if test="status != null "> and status = #{status}</if>
 | 
	
		
			
				|  |  | -            <if test="level != null "> and level = #{level}</if>
 | 
	
		
			
				|  |  | -            <if test="spreadUserId != null "> and spread_user_id = #{spreadUserId}</if>
 | 
	
		
			
				|  |  | -            <if test="spreadTime != null "> and spread_time = #{spreadTime}</if>
 | 
	
		
			
				|  |  | -            <if test="userType != null  and userType != ''"> and user_type = #{userType}</if>
 | 
	
		
			
				|  |  | -            <if test="isPromoter != null "> and is_promoter = #{isPromoter}</if>
 | 
	
		
			
				|  |  | -            <if test="payCount != null "> and pay_count = #{payCount}</if>
 | 
	
		
			
				|  |  | -            <if test="spreadCount != null "> and spread_count = #{spreadCount}</if>
 | 
	
		
			
				|  |  | -            <if test="addres != null  and addres != ''"> and addres = #{addres}</if>
 | 
	
		
			
				|  |  | -            <if test="isDel != null "> and is_del = #{isDel}</if>
 | 
	
		
			
				|  |  | -            <if test="companyId != null "> and company_id = #{companyId}</if>
 | 
	
		
			
				|  |  | -            <if test="companyUserId != null "> and company_user_id = #{companyUserId}</if>
 | 
	
		
			
				|  |  | -            <if test="registerDate != null "> and DATE_FORMAT(register_date,'%Y-%m-%d') = DATE_FORMAT(#{registerDate},'%Y-%m-%d')</if>
 | 
	
		
			
				|  |  | -            <if test="registerCode != null   and registerCode != '' "> and register_code = #{registerCode}</if>
 | 
	
		
			
				|  |  | -            <if test="source != null  and source != '' "> and source = #{source}</if>
 | 
	
		
			
				|  |  | -            <if test="isShow != null  "> and is_show = #{isShow}</if>
 | 
	
		
			
				|  |  | -             <if test="(username != null  and username != '') or (nickname != null  and nickname != '') or (phone != null  and phone != '')">
 | 
	
		
			
				|  |  | -                 and (
 | 
	
		
			
				|  |  | -                 <if test="username != null  and username != ''"> username like concat('%', #{username}, '%')</if>
 | 
	
		
			
				|  |  | -                 <if test="nickname != null  and nickname != ''"> or nickname like concat('%', #{nickname}, '%')</if>
 | 
	
		
			
				|  |  | -                 <if test="phone != null  and phone != ''"> or phone like concat('%',#{phone},'%')</if>
 | 
	
		
			
				|  |  | -                 )
 | 
	
		
			
				|  |  | -             </if>
 | 
	
		
			
				|  |  | +            <if test="password != null  and password != ''">and password = #{password}</if>
 | 
	
		
			
				|  |  | +            <if test="realName != null  and realName != ''">and real_name like concat('%', #{realName}, '%')</if>
 | 
	
		
			
				|  |  | +            <if test="birthday != null ">and birthday = #{birthday}</if>
 | 
	
		
			
				|  |  | +            <if test="idCard != null  and idCard != ''">and id_card = #{idCard}</if>
 | 
	
		
			
				|  |  | +            <if test="remark != null  and remark != ''">and remark = #{remark}</if>
 | 
	
		
			
				|  |  | +            <if test="avatar != null  and avatar != ''">and avatar = #{avatar}</if>
 | 
	
		
			
				|  |  | +            <if test="lastIp != null  and lastIp != ''">and last_ip = #{lastIp}</if>
 | 
	
		
			
				|  |  | +            <if test="nowMoney != null ">and now_money = #{nowMoney}</if>
 | 
	
		
			
				|  |  | +            <if test="brokeragePrice != null ">and brokerage_price = #{brokeragePrice}</if>
 | 
	
		
			
				|  |  | +            <if test="integral != null ">and integral = #{integral}</if>
 | 
	
		
			
				|  |  | +            <if test="signNum != null ">and sign_num = #{signNum}</if>
 | 
	
		
			
				|  |  | +            <if test="status != null ">and status = #{status}</if>
 | 
	
		
			
				|  |  | +            <if test="level != null ">and level = #{level}</if>
 | 
	
		
			
				|  |  | +            <if test="spreadUserId != null ">and spread_user_id = #{spreadUserId}</if>
 | 
	
		
			
				|  |  | +            <if test="spreadTime != null ">and spread_time = #{spreadTime}</if>
 | 
	
		
			
				|  |  | +            <if test="userType != null  and userType != ''">and user_type = #{userType}</if>
 | 
	
		
			
				|  |  | +            <if test="isPromoter != null ">and is_promoter = #{isPromoter}</if>
 | 
	
		
			
				|  |  | +            <if test="payCount != null ">and pay_count = #{payCount}</if>
 | 
	
		
			
				|  |  | +            <if test="spreadCount != null ">and spread_count = #{spreadCount}</if>
 | 
	
		
			
				|  |  | +            <if test="addres != null  and addres != ''">and addres = #{addres}</if>
 | 
	
		
			
				|  |  | +            <if test="isDel != null ">and is_del = #{isDel}</if>
 | 
	
		
			
				|  |  | +            <if test="companyId != null ">and company_id = #{companyId}</if>
 | 
	
		
			
				|  |  | +            <if test="companyUserId != null ">and company_user_id = #{companyUserId}</if>
 | 
	
		
			
				|  |  | +            <if test="registerDate != null ">and DATE_FORMAT(register_date,'%Y-%m-%d') =
 | 
	
		
			
				|  |  | +                DATE_FORMAT(#{registerDate},'%Y-%m-%d')
 | 
	
		
			
				|  |  | +            </if>
 | 
	
		
			
				|  |  | +            <if test="registerCode != null   and registerCode != '' ">and register_code = #{registerCode}</if>
 | 
	
		
			
				|  |  | +            <if test="source != null  and source != '' ">and source = #{source}</if>
 | 
	
		
			
				|  |  | +            <if test="isShow != null  ">and is_show = #{isShow}</if>
 | 
	
		
			
				|  |  | +            <if test="(username != null  and username != '') or (nickname != null  and nickname != '') or (phone != null  and phone != '')">
 | 
	
		
			
				|  |  | +                and (
 | 
	
		
			
				|  |  | +                <if test="username != null  and username != ''">username like concat('%', #{username}, '%')</if>
 | 
	
		
			
				|  |  | +                <if test="nickname != null  and nickname != ''">or nickname like concat('%', #{nickname}, '%')</if>
 | 
	
		
			
				|  |  | +                <if test="phone != null  and phone != ''">or phone like concat('%',#{phone},'%')</if>
 | 
	
		
			
				|  |  | +                )
 | 
	
		
			
				|  |  | +            </if>
 | 
	
		
			
				|  |  |          </where>
 | 
	
		
			
				|  |  |          order by user_id desc
 | 
	
		
			
				|  |  |          limit 10
 | 
	
		
			
				|  |  |      </select>
 | 
	
		
			
				|  |  | +    <select id="selectCusListPage" resultType="com.fs.store.domain.FsUser">
 | 
	
		
			
				|  |  | +        select user.user_id,
 | 
	
		
			
				|  |  | +        user.username,
 | 
	
		
			
				|  |  | +        user.real_name,
 | 
	
		
			
				|  |  | +        user.id_card,
 | 
	
		
			
				|  |  | +        user.phone,
 | 
	
		
			
				|  |  | +        user.addres,
 | 
	
		
			
				|  |  | +        user.nickname,
 | 
	
		
			
				|  |  | +        user.status,
 | 
	
		
			
				|  |  | +        user.company_id,
 | 
	
		
			
				|  |  | +        user.company_user_id,
 | 
	
		
			
				|  |  | +        user.create_time
 | 
	
		
			
				|  |  | +        from
 | 
	
		
			
				|  |  | +        fs_user `user` join (
 | 
	
		
			
				|  |  | +        select user_id from fs_user
 | 
	
		
			
				|  |  | +        <where>
 | 
	
		
			
				|  |  | +            <if test="companyId != null and companyId != ''">
 | 
	
		
			
				|  |  | +                AND company_id = #{companyId}
 | 
	
		
			
				|  |  | +            </if>
 | 
	
		
			
				|  |  | +            <if test="companyUserId != null and companyUserId != ''">
 | 
	
		
			
				|  |  | +                AND company_user_id = #{companyUserId}
 | 
	
		
			
				|  |  | +            </if>
 | 
	
		
			
				|  |  | +            <if test="phone != null and phone != ''">
 | 
	
		
			
				|  |  | +                AND phone = #{phone}
 | 
	
		
			
				|  |  | +            </if>
 | 
	
		
			
				|  |  | +        </where>
 | 
	
		
			
				|  |  | +        order by user_id desc
 | 
	
		
			
				|  |  | +        limit ${(pageNum-1)*pageSize},${pageSize}
 | 
	
		
			
				|  |  | +        ) t on t.user_id = `user`.user_id
 | 
	
		
			
				|  |  | +    </select>
 | 
	
		
			
				|  |  | +    <select id="selectCusListPageCount" resultType="java.lang.Long">
 | 
	
		
			
				|  |  | +        SELECT COUNT(user_id)
 | 
	
		
			
				|  |  | +        FROM fs_user
 | 
	
		
			
				|  |  | +        <where>
 | 
	
		
			
				|  |  | +            <if test="companyId != null and companyId != ''">
 | 
	
		
			
				|  |  | +                AND company_id = #{companyId}
 | 
	
		
			
				|  |  | +            </if>
 | 
	
		
			
				|  |  | +            <if test="companyUserId != null and companyUserId != ''">
 | 
	
		
			
				|  |  | +                AND company_user_id = #{companyUserId}
 | 
	
		
			
				|  |  | +            </if>
 | 
	
		
			
				|  |  | +            <if test="phone != null and phone != ''">
 | 
	
		
			
				|  |  | +                AND phone = #{phone}
 | 
	
		
			
				|  |  | +            </if>
 | 
	
		
			
				|  |  | +        </where>
 | 
	
		
			
				|  |  | +    </select>
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |      <insert id="insertFsUser" parameterType="FsUser" useGeneratedKeys="true" keyProperty="userId">
 | 
	
		
			
				|  |  |          insert into fs_user
 | 
	
	
		
			
				|  | @@ -171,7 +258,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 | 
	
		
			
				|  |  |              <if test="source != null">source,</if>
 | 
	
		
			
				|  |  |              <if test="userCode != null">user_code,</if>
 | 
	
		
			
				|  |  |              <if test="isShow != null">is_show,</if>
 | 
	
		
			
				|  |  | -         </trim>
 | 
	
		
			
				|  |  | +        </trim>
 | 
	
		
			
				|  |  |          <trim prefix="values (" suffix=")" suffixOverrides=",">
 | 
	
		
			
				|  |  |              <if test="username != null">#{username},</if>
 | 
	
		
			
				|  |  |              <if test="password != null">#{password},</if>
 | 
	
	
		
			
				|  | @@ -210,7 +297,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 | 
	
		
			
				|  |  |              <if test="source != null">#{source},</if>
 | 
	
		
			
				|  |  |              <if test="userCode != null">#{userCode},</if>
 | 
	
		
			
				|  |  |              <if test="isShow != null">#{isShow},</if>
 | 
	
		
			
				|  |  | -         </trim>
 | 
	
		
			
				|  |  | +        </trim>
 | 
	
		
			
				|  |  |      </insert>
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |      <update id="updateFsUser" parameterType="FsUser">
 | 
	
	
		
			
				|  | @@ -256,9 +343,20 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 | 
	
		
			
				|  |  |          </trim>
 | 
	
		
			
				|  |  |          where user_id = #{userId}
 | 
	
		
			
				|  |  |      </update>
 | 
	
		
			
				|  |  | +    <update id="transferCompanyUser">
 | 
	
		
			
				|  |  | +        update fs_user
 | 
	
		
			
				|  |  | +        set company_user_id=#{targetCompanyUserId}
 | 
	
		
			
				|  |  | +        where
 | 
	
		
			
				|  |  | +            user_id in
 | 
	
		
			
				|  |  | +        <foreach collection="userIds" open="(" close=")" separator="," item="item">
 | 
	
		
			
				|  |  | +            ${item}
 | 
	
		
			
				|  |  | +        </foreach>
 | 
	
		
			
				|  |  | +    </update>
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |      <delete id="deleteFsUserById" parameterType="Long">
 | 
	
		
			
				|  |  | -        delete from fs_user where user_id = #{userId}
 | 
	
		
			
				|  |  | +        delete
 | 
	
		
			
				|  |  | +        from fs_user
 | 
	
		
			
				|  |  | +        where user_id = #{userId}
 | 
	
		
			
				|  |  |      </delete>
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |      <delete id="deleteFsUserByIds" parameterType="String">
 | 
	
	
		
			
				|  | @@ -279,12 +377,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 | 
	
		
			
				|  |  |          fs_user_course_count.course_id,
 | 
	
		
			
				|  |  |          fs_user_course_count.part_course_count,
 | 
	
		
			
				|  |  |          fs_user_course_count.last_watch_date,
 | 
	
		
			
				|  |  | -        fs_user_course_count.STATUS AS course_count,
 | 
	
		
			
				|  |  | +        fs_user_course_count.STATUS AS courseCountStatus,
 | 
	
		
			
				|  |  |          fs_user_course_count.stop_watch_days,
 | 
	
		
			
				|  |  |          fs_user_course_count.create_time,
 | 
	
		
			
				|  |  |          fs_user_course_count.complete_watch_date,
 | 
	
		
			
				|  |  |          company_tag.tag,
 | 
	
		
			
				|  |  | -        company_tag_user.tag_ids
 | 
	
		
			
				|  |  | +        company_tag_user.tag_ids,
 | 
	
		
			
				|  |  | +        company_user.nick_name as companyUserNickName
 | 
	
		
			
				|  |  |          FROM
 | 
	
		
			
				|  |  |          fs_user
 | 
	
		
			
				|  |  |          left join company_user on fs_user.company_user_id = company_user.user_id
 | 
	
	
		
			
				|  | @@ -292,6 +391,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 | 
	
		
			
				|  |  |          LEFT JOIN company_tag_user ON fs_user.user_id = company_tag_user.user_id
 | 
	
		
			
				|  |  |          LEFT JOIN company_tag ON FIND_IN_SET(company_tag.tag_id, company_tag_user.tag_ids) > 0
 | 
	
		
			
				|  |  |          where company_user.parent_id = #{userId}
 | 
	
		
			
				|  |  | +        <if test="companyUserId != null and companyUserId !='' ">
 | 
	
		
			
				|  |  | +            and company_user.user_id = #{companyUserId}
 | 
	
		
			
				|  |  | +        </if>
 | 
	
		
			
				|  |  |          <choose>
 | 
	
		
			
				|  |  |              <when test = "isBlack">
 | 
	
		
			
				|  |  |                  AND fs_user.status = 0
 | 
	
	
		
			
				|  | @@ -353,6 +455,23 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 | 
	
		
			
				|  |  |                  </when>
 | 
	
		
			
				|  |  |              </choose>
 | 
	
		
			
				|  |  |          </if>
 | 
	
		
			
				|  |  | +        <if test="continueMissCourseSort != null and continueMissCourseSort !='' ">
 | 
	
		
			
				|  |  | +            order by
 | 
	
		
			
				|  |  | +            <choose>
 | 
	
		
			
				|  |  | +                <when test = "continueMissCourseSort == 0">
 | 
	
		
			
				|  |  | +                    fs_user_course_count.miss_course_days desc
 | 
	
		
			
				|  |  | +                </when>
 | 
	
		
			
				|  |  | +                <when test = "continueMissCourseSort == 1">
 | 
	
		
			
				|  |  | +                    fs_user_course_count.miss_course_days asc
 | 
	
		
			
				|  |  | +                </when>
 | 
	
		
			
				|  |  | +                <when test = "continueMissCourseSort == 2">
 | 
	
		
			
				|  |  | +                    fs_user.create_time desc
 | 
	
		
			
				|  |  | +                </when>
 | 
	
		
			
				|  |  | +                <when test = "continueMissCourseSort == 3">
 | 
	
		
			
				|  |  | +                    fs_user.nickname asc
 | 
	
		
			
				|  |  | +                </when>
 | 
	
		
			
				|  |  | +            </choose>
 | 
	
		
			
				|  |  | +        </if>
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |      </select>
 | 
	
		
			
				|  |  |  
 | 
	
	
		
			
				|  | @@ -371,9 +490,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |      <select id="getCountAnswer" resultType="UserDetailsVO">
 | 
	
		
			
				|  |  |          SELECT
 | 
	
		
			
				|  |  | -            (
 | 
	
		
			
				|  |  | +        (
 | 
	
		
			
				|  |  |                  SELECT
 | 
	
		
			
				|  |  | -                    count( DISTINCT log_id ) AS answerTime
 | 
	
		
			
				|  |  | +                ifnull(count( DISTINCT log_id ), 0) AS answerTime
 | 
	
		
			
				|  |  |                  FROM
 | 
	
		
			
				|  |  |                      fs_course_answer_logs
 | 
	
		
			
				|  |  |                          LEFT JOIN fs_user ON fs_user.user_id = fs_course_answer_logs.user_id
 | 
	
	
		
			
				|  | @@ -400,10 +519,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 | 
	
		
			
				|  |  |                      fs_user.user_id
 | 
	
		
			
				|  |  |                  HAVING
 | 
	
		
			
				|  |  |                      fs_user.user_id = #{fsUserId}
 | 
	
		
			
				|  |  | -            ),
 | 
	
		
			
				|  |  | +            ) AS answerTime,
 | 
	
		
			
				|  |  |              (
 | 
	
		
			
				|  |  |                  SELECT
 | 
	
		
			
				|  |  | -                    count( DISTINCT log_id ) AS answerRightTime
 | 
	
		
			
				|  |  | +                ifnull(count( DISTINCT log_id ), 0) AS answerRightTime
 | 
	
		
			
				|  |  |                  FROM
 | 
	
		
			
				|  |  |                      fs_course_answer_logs
 | 
	
		
			
				|  |  |                          LEFT JOIN fs_user ON fs_user.user_id = fs_course_answer_logs.user_id
 | 
	
	
		
			
				|  | @@ -431,24 +550,51 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 | 
	
		
			
				|  |  |                      fs_user.user_id
 | 
	
		
			
				|  |  |                  HAVING
 | 
	
		
			
				|  |  |                      fs_user.user_id = #{fsUserId}
 | 
	
		
			
				|  |  | -            );
 | 
	
		
			
				|  |  | +            ) AS answerRightTime;
 | 
	
		
			
				|  |  |      </select>
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | -    <select id="getCountRedPacket" resultType="UserDetailsVO">
 | 
	
		
			
				|  |  | +    <select id="getCountRedPacket" resultType="com.fs.store.vo.h5.UserDetailsVO">
 | 
	
		
			
				|  |  |          SELECT
 | 
	
		
			
				|  |  | -            count( DISTINCT log_id ) AS answerRedPacketTime,
 | 
	
		
			
				|  |  | -            sum( amount ) AS answerRedPacketAmount,
 | 
	
		
			
				|  |  | -            complete_watch_count,
 | 
	
		
			
				|  |  | -            watch_times,
 | 
	
		
			
				|  |  | -            fs_user.user_id
 | 
	
		
			
				|  |  | +        ifnull( count( DISTINCT log_id ), 0 ) AS answerRedPacketTime,
 | 
	
		
			
				|  |  | +        ifnull( sum( amount ), 0 ) AS answerRedPacketAmount,
 | 
	
		
			
				|  |  | +        ifnull( complete_watch_count, 0 ) AS completeWatchCount ,
 | 
	
		
			
				|  |  | +        ifnull( watch_times, 0 ) AS watchTimes,
 | 
	
		
			
				|  |  | +        fs_user.user_id
 | 
	
		
			
				|  |  |          FROM
 | 
	
		
			
				|  |  |              fs_course_red_packet_log
 | 
	
		
			
				|  |  |                  LEFT JOIN fs_user ON fs_user.user_id = fs_course_red_packet_log.user_id
 | 
	
		
			
				|  |  |                  LEFT JOIN company_user ON company_user.user_id = fs_user.company_user_id
 | 
	
		
			
				|  |  | +                LEFT JOIN fs_user_course_count ON fs_user_course_count.user_id = fs_user.user_id
 | 
	
		
			
				|  |  |          WHERE
 | 
	
		
			
				|  |  |              company_user.parent_id = #{userId}
 | 
	
		
			
				|  |  | +            <if test="dateTag != null and dateTag !='' ">
 | 
	
		
			
				|  |  | +                <choose>
 | 
	
		
			
				|  |  | +                    <when test = "dateTag == '今天'">
 | 
	
		
			
				|  |  | +                        and to_days(fs_course_red_packet_log.create_time) = to_days(now())
 | 
	
		
			
				|  |  | +                    </when>
 | 
	
		
			
				|  |  | +                    <when test = "dateTag == ' 昨天'">
 | 
	
		
			
				|  |  | +                        and to_days(now()) - to_days(fs_course_red_packet_log.create_time) <= 1
 | 
	
		
			
				|  |  | +                    </when>
 | 
	
		
			
				|  |  | +                    <when test = "dateTag == '前天'">
 | 
	
		
			
				|  |  | +                        and to_days(now()) - to_days(fs_course_red_packet_log.create_time) <= 2
 | 
	
		
			
				|  |  | +                    </when>
 | 
	
		
			
				|  |  | +                    <when test = "dateTag == '近七天'">
 | 
	
		
			
				|  |  | +                        and DATE_SUB(CURDATE(), INTERVAL 7 DAY) <= date(fs_course_red_packet_log.create_time)
 | 
	
		
			
				|  |  | +                    </when>
 | 
	
		
			
				|  |  | +                </choose>
 | 
	
		
			
				|  |  | +            </if>
 | 
	
		
			
				|  |  | +        GROUP BY
 | 
	
		
			
				|  |  | +        fs_user.user_id
 | 
	
		
			
				|  |  | +        HAVING
 | 
	
		
			
				|  |  | +        fs_user.user_id = #{fsUserId}
 | 
	
		
			
				|  |  |      </select>
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  | +    <update id="batchUpdateFsUserByIds" parameterType="Long">
 | 
	
		
			
				|  |  | +        update fs_user
 | 
	
		
			
				|  |  | +        set status = #{status} where user_id in
 | 
	
		
			
				|  |  | +        <foreach item="id" collection="ids" open="(" separator="," close=")">
 | 
	
		
			
				|  |  | +            #{id}
 | 
	
		
			
				|  |  | +        </foreach>
 | 
	
		
			
				|  |  | +    </update>
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |  </mapper>
 |