95 lines
		
	
	
		
			3.1 KiB
		
	
	
	
		
			XML
		
	
		
		
			
		
	
	
			95 lines
		
	
	
		
			3.1 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.hcy.common.mapper.user.UserMapper"> | ||
|  |     <!-- 通用查询映射结果 --> | ||
|  |     <resultMap id="BaseResultMap" type="com.hcy.common.entity.user.User"> | ||
|  |          | ||
|  |     </resultMap> | ||
|  | 
 | ||
|  |     <select id="pageSearchByDist" resultType="com.hcy.common.dto.result.UserResultDto"> | ||
|  |         SELECT | ||
|  |         t.id, | ||
|  |         t.sn, | ||
|  |         t.avatar, | ||
|  |         t.real_name, | ||
|  |         t.nickname, | ||
|  |         t.username, | ||
|  |         t.password, | ||
|  |         t.mobile, | ||
|  |         t.channel, | ||
|  |         t.salt, | ||
|  |         t.money, | ||
|  |         t.sex, | ||
|  |         t.is_disable, | ||
|  |         t.is_delete, | ||
|  |         t.is_new, | ||
|  |         t.last_login_ip, | ||
|  |         t.last_login_time, | ||
|  |         t.create_time, | ||
|  |         t.update_time, | ||
|  |         t.delete_time, | ||
|  |         t.distributor_id, | ||
|  |         t.bind_time, | ||
|  |         t1.dist_num AS distNum, | ||
|  |         t1.group_id AS groupId, | ||
|  |         t1.name AS distName | ||
|  |         FROM la_user t | ||
|  |         LEFT JOIN la_distributor t1 | ||
|  |         ON (t1.id = t.distributor_id AND t1.is_delete = 0) | ||
|  |         <where> | ||
|  |             t.is_delete = 0 | ||
|  |             <if test="form.likeWork != null"> | ||
|  |                 AND (t.username LIKE '%${form.likeWork}%' | ||
|  |                 OR t.nickname LIKE '%${form.likeWork}%' | ||
|  |                 OR t.mobile LIKE '%${form.likeWork}%') | ||
|  |             </if> | ||
|  |             <if test="form.channel != null"> | ||
|  |                 And t.channel = #{form.channel} | ||
|  |             </if> | ||
|  |             <choose> | ||
|  |                 <when test="form.flag != null"> | ||
|  |                         AND t.distributor_id != 0 | ||
|  |                     <if test="form.startTime != null and form.endTime != null"> | ||
|  |                         AND (t.bind_time >= #{form.startTime} AND t.bind_time <= #{form.endTime}) | ||
|  |                     </if> | ||
|  |                 </when> | ||
|  |                 <otherwise> | ||
|  |                     <if test="form.startTime != null and form.endTime != null"> | ||
|  |                         AND (t.create_time >= #{form.startTime} AND t.create_time <= #{form.endTime}) | ||
|  |                     </if> | ||
|  |                 </otherwise> | ||
|  |             </choose> | ||
|  |             <if test="form.type != null"> | ||
|  |                 AND t.type = #{form.type} | ||
|  |             </if> | ||
|  |             <if test="form.distNum != null"> | ||
|  |                 AND (t1.dist_num LIKE '%${form.distNum}%') | ||
|  |             </if> | ||
|  |             <if test="form.distName != null"> | ||
|  |                 AND (t1.name LIKE '%${form.distName}%') | ||
|  |             </if> | ||
|  |             <if test="form.groupId != null"> | ||
|  |                 And t1.group_id = #{form.groupId} | ||
|  |             </if> | ||
|  |         </where> | ||
|  |         order by t.id desc | ||
|  |     </select> | ||
|  | 
 | ||
|  |     <select id="getNotBindingStaffUser" resultType="com.hcy.common.entity.user.User"> | ||
|  |         SELECT | ||
|  |         us.* | ||
|  |         FROM | ||
|  |         la_user AS us | ||
|  |         LEFT JOIN la_staff AS s ON s.user_id = us.id | ||
|  |         AND s.is_delete = 0 | ||
|  |         <where> | ||
|  |             us.is_delete = 0 | ||
|  |             AND s.id IS NULL | ||
|  |             AND us.type = 1 | ||
|  |             <if test="keyword != null and keyword != ''"> | ||
|  |                 AND ((us.sn LIKE '%${keyword}%') OR (us.mobile LIKE '%${keyword}%') OR (us.nickname LIKE '%${keyword}%')) | ||
|  |             </if> | ||
|  |         </where> | ||
|  |     </select> | ||
|  | </mapper> |