|  | @@ -17,6 +17,7 @@
 | 
	
		
			
				|  |  |  		<result property="password"     column="password"     />
 | 
	
		
			
				|  |  |  		<result property="userType"     column="user_type"    />
 | 
	
		
			
				|  |  |  		<result property="openId"     	column="open_id"      />
 | 
	
		
			
				|  |  | +		<result property="unionId"     	column="union_id"     />
 | 
	
		
			
				|  |  |  		<result property="imgSrc"     	column="img_src"      />
 | 
	
		
			
				|  |  |  		<result property="sessionKey" 	column="session_key"  />
 | 
	
		
			
				|  |  |  		<result property="relatedNo" 	column="related_no"   />
 | 
	
	
		
			
				|  | @@ -52,7 +53,7 @@
 | 
	
		
			
				|  |  |  	</resultMap>
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |  	<sql id="selectUserVo">
 | 
	
		
			
				|  |  | -        select u.user_id, u.dept_id, u.user_name, u.nick_name, u.email, u.avatar, u.phonenumber, u.password, u.user_type, u.user_system, u.open_id, u.img_src, u.session_key,
 | 
	
		
			
				|  |  | +        select u.user_id, u.dept_id, u.user_name, u.nick_name, u.email, u.avatar, u.phonenumber, u.password, u.user_type, u.user_system, u.open_id, u.union_id, u.img_src, u.session_key,
 | 
	
		
			
				|  |  |           u.related_no, u.sex, u.status, u.del_flag, u.login_ip, u.login_date, u.create_by, u.create_time, u.remark,
 | 
	
		
			
				|  |  |          d.dept_id, d.parent_id, d.dept_name, d.order_num, d.leader, d.status as dept_status,
 | 
	
		
			
				|  |  |          r.role_id, r.role_name, r.role_key, r.role_sort, r.data_scope, r.status as role_status
 | 
	
	
		
			
				|  | @@ -63,7 +64,7 @@
 | 
	
		
			
				|  |  |      </sql>
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |  	<select id="selectUserList" parameterType="SysUser" resultMap="SysUserResult">
 | 
	
		
			
				|  |  | -		select u.user_id, u.dept_id, u.nick_name, u.user_name, u.email, u.avatar, u.phonenumber, u.password, u.user_type, u.user_system, u.open_id, u.img_src, u.session_key, u.related_no, u.sex, u.status, u.del_flag, u.login_ip, u.login_date, u.create_by, u.create_time, u.remark, d.dept_name, d.leader from sys_user u
 | 
	
		
			
				|  |  | +		select u.user_id, u.dept_id, u.nick_name, u.user_name, u.email, u.avatar, u.phonenumber, u.password, u.user_type, u.user_system, u.open_id, u.union_id, u.img_src, u.session_key, u.related_no, u.sex, u.status, u.del_flag, u.login_ip, u.login_date, u.create_by, u.create_time, u.remark, d.dept_name, d.leader from sys_user u
 | 
	
		
			
				|  |  |  		left join sys_dept d on u.dept_id = d.dept_id
 | 
	
		
			
				|  |  |  		where u.del_flag = '0'
 | 
	
		
			
				|  |  |  		<if test="userName != null and userName != ''">
 | 
	
	
		
			
				|  | @@ -81,6 +82,9 @@
 | 
	
		
			
				|  |  |  		<if test="openId != null and openId != ''">
 | 
	
		
			
				|  |  |  			AND u.open_id = #{openId}
 | 
	
		
			
				|  |  |  		</if>
 | 
	
		
			
				|  |  | +		<if test="unionId != null and unionId != ''">
 | 
	
		
			
				|  |  | +			AND u.union_id = #{unionId}
 | 
	
		
			
				|  |  | +		</if>
 | 
	
		
			
				|  |  |  		<if test="sessionKey != null and sessionKey != ''">
 | 
	
		
			
				|  |  |  			AND u.session_key = #{sessionKey}
 | 
	
		
			
				|  |  |  		</if>
 | 
	
	
		
			
				|  | @@ -114,11 +118,15 @@
 | 
	
		
			
				|  |  |  	</select>
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |  	<select id="selectUserByopenId" parameterType="String" resultMap="SysUserResult">
 | 
	
		
			
				|  |  | -		SELECT user_id, user_name, nick_name, user_type, user_system, open_id, open_id, del_flag FROM sys_user WHERE open_id = #{openId}
 | 
	
		
			
				|  |  | +		SELECT user_id, user_name, nick_name, user_type, user_system, open_id, union_id, del_flag FROM sys_user WHERE open_id = #{openId}
 | 
	
		
			
				|  |  | +	</select>
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +	<select id="selectUserByUnionId" parameterType="String" resultMap="SysUserResult">
 | 
	
		
			
				|  |  | +		SELECT user_id, user_name, nick_name, user_type, user_system, open_id, union_id, del_flag FROM sys_user WHERE union_id = #{unionId}
 | 
	
		
			
				|  |  |  	</select>
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |  	<select id="selectUserByTel" parameterType="String" resultMap="SysUserResult">
 | 
	
		
			
				|  |  | -		SELECT user_id, user_name, nick_name, user_type, user_system, phonenumber, open_id, session_key, del_flag FROM sys_user WHERE phonenumber = #{phonenumber} and user_type = '11'
 | 
	
		
			
				|  |  | +		SELECT user_id, user_name, nick_name, user_type, user_system, phonenumber, open_id, union_id, session_key, del_flag FROM sys_user WHERE phonenumber = #{phonenumber} and user_type = '11'
 | 
	
		
			
				|  |  |  	</select>
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |  	<select id="checkUserNameUnique" parameterType="String" resultType="int">
 | 
	
	
		
			
				|  | @@ -133,7 +141,7 @@
 | 
	
		
			
				|  |  |  		select user_id, email from sys_user where email = #{email} limit 1
 | 
	
		
			
				|  |  |  	</select>
 | 
	
		
			
				|  |  |  	<select id="warehouseSelectUserByTel" resultType="com.ruoyi.common.core.domain.entity.SysUser">
 | 
	
		
			
				|  |  | -		SELECT user_id, user_name, nick_name, user_type, user_system, phonenumber, open_id, session_key, del_flag FROM sys_user WHERE phonenumber = #{phonenumber} and user_type = '00'
 | 
	
		
			
				|  |  | +		SELECT user_id, user_name, nick_name, user_type, user_system, phonenumber, open_id, union_id, session_key, del_flag FROM sys_user WHERE phonenumber = #{phonenumber} and user_type = '00'
 | 
	
		
			
				|  |  |  	</select>
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |  	<insert id="insertUser" parameterType="SysUser" useGeneratedKeys="true" keyProperty="userId">
 | 
	
	
		
			
				|  | @@ -150,6 +158,7 @@
 | 
	
		
			
				|  |  |  		<if test="userType != null and userType != ''">user_type,</if>
 | 
	
		
			
				|  |  |  		<if test="userSystem != null and userSystem != ''">user_system,</if>
 | 
	
		
			
				|  |  |  		<if test="openId != null and openId != ''">open_id,</if>
 | 
	
		
			
				|  |  | +		<if test="unionId != null and unionId != ''">union_id,</if>
 | 
	
		
			
				|  |  |  		<if test="imgSrc != null and imgSrc != ''">img_src,</if>
 | 
	
		
			
				|  |  |  		<if test="sessionKey != null and sessionKey != ''">session_key,</if>
 | 
	
		
			
				|  |  |  		<if test="relatedNo != null and relatedNo != ''">related_no,</if>
 | 
	
	
		
			
				|  | @@ -170,6 +179,7 @@
 | 
	
		
			
				|  |  |  		<if test="userType != null and userType != ''">#{userType},</if>
 | 
	
		
			
				|  |  |  		<if test="userSystem != null and userSystem != ''">#{userSystem},</if>
 | 
	
		
			
				|  |  |  		<if test="openId != null and openId != ''">#{openId},</if>
 | 
	
		
			
				|  |  | +		<if test="unionId != null and unionId != ''">#{unionId},</if>
 | 
	
		
			
				|  |  |  		<if test="imgSrc != null and imgSrc != ''">#{imgSrc},</if>
 | 
	
		
			
				|  |  |  		<if test="sessionKey != null and sessionKey != ''">#{sessionKey},</if>
 | 
	
		
			
				|  |  |  		<if test="status != null and status != ''">#{status},</if>
 | 
	
	
		
			
				|  | @@ -193,6 +203,7 @@
 | 
	
		
			
				|  |  |  			<if test="userType != null and userType != ''">user_type = #{userType},</if>
 | 
	
		
			
				|  |  |  			<if test="userSystem != null and userSystem != ''">user_system = #{userSystem},</if>
 | 
	
		
			
				|  |  |  			<if test="openId != null and openId != ''">open_id = #{openId},</if>
 | 
	
		
			
				|  |  | +			<if test="unionId != null and unionId != ''">union_id = #{unionId},</if>
 | 
	
		
			
				|  |  |  			<if test="imgSrc != null and imgSrc != ''">img_src = #{imgSrc},</if>
 | 
	
		
			
				|  |  |  			<if test="sessionKey != null and sessionKey != ''">session_key = #{sessionKey},</if>
 | 
	
		
			
				|  |  |  			<if test="relatedNo != null and relatedNo != ''">related_no = #{relatedNo},</if>
 |