|
@@ -91,6 +91,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<result property="dataScope" column="data_scope" />
|
|
<result property="dataScope" column="data_scope" />
|
|
|
<result property="status" column="role_status" />
|
|
<result property="status" column="role_status" />
|
|
|
</resultMap>
|
|
</resultMap>
|
|
|
|
|
+
|
|
|
<select id="selectCompanyUserQwListVO" resultMap="CompanyUserQwListVOResult">
|
|
<select id="selectCompanyUserQwListVO" resultMap="CompanyUserQwListVOResult">
|
|
|
select
|
|
select
|
|
|
u.user_id, u.user_name, u.nick_name, u.company_id, u.status,
|
|
u.user_id, u.user_name, u.nick_name, u.company_id, u.status,
|
|
@@ -100,15 +101,17 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
u.avatar,u.address_id,
|
|
u.avatar,u.address_id,
|
|
|
u.qw_user_id,
|
|
u.qw_user_id,
|
|
|
u.doctor_id,
|
|
u.doctor_id,
|
|
|
- u.cid_server_id,
|
|
|
|
|
d.dept_name,
|
|
d.dept_name,
|
|
|
d.leader,
|
|
d.leader,
|
|
|
- u.ai_sip_call_user_id
|
|
|
|
|
|
|
+ GROUP_CONCAT(fu.nick_name) bindUser,
|
|
|
|
|
+ cfu.`status` bindStatus
|
|
|
from
|
|
from
|
|
|
company_user u
|
|
company_user u
|
|
|
left join
|
|
left join
|
|
|
company_dept d on u.dept_id = d.dept_id
|
|
company_dept d on u.dept_id = d.dept_id
|
|
|
-
|
|
|
|
|
|
|
+ LEFT JOIN
|
|
|
|
|
+ company_fs_user cfu on u.user_id=cfu.company_user_id
|
|
|
|
|
+ LEFT JOIN fs_user fu on cfu.fs_user_id=fu.user_id
|
|
|
where
|
|
where
|
|
|
u.del_flag = '0'
|
|
u.del_flag = '0'
|
|
|
<if test="userId != null ">
|
|
<if test="userId != null ">
|
|
@@ -149,11 +152,74 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<if test="deptId != null and deptId != 0">
|
|
<if test="deptId != null and deptId != 0">
|
|
|
AND (u.dept_id = #{deptId} OR u.dept_id IN ( SELECT t.dept_id FROM company_dept t WHERE find_in_set(#{deptId}, ancestors) ))
|
|
AND (u.dept_id = #{deptId} OR u.dept_id IN ( SELECT t.dept_id FROM company_dept t WHERE find_in_set(#{deptId}, ancestors) ))
|
|
|
</if>
|
|
</if>
|
|
|
-
|
|
|
|
|
|
|
+ GROUP BY u.user_id
|
|
|
<!-- 数据范围过滤 -->
|
|
<!-- 数据范围过滤 -->
|
|
|
${params.dataScope}
|
|
${params.dataScope}
|
|
|
</select>
|
|
</select>
|
|
|
|
|
|
|
|
|
|
+<!-- <select id="selectCompanyUserQwListVO" resultMap="CompanyUserQwListVOResult">-->
|
|
|
|
|
+<!-- select-->
|
|
|
|
|
+<!-- u.user_id, u.user_name, u.nick_name, u.company_id, u.status,-->
|
|
|
|
|
+<!-- u.qw_status, u.phonenumber, u.create_time, u.dept_id,-->
|
|
|
|
|
+<!-- u.qr_code_weixin, u.user_type, u.qr_code_wecom, u.jpush_id,-->
|
|
|
|
|
+<!-- u.is_need_register_member,u.is_allowed_all_register,-->
|
|
|
|
|
+<!-- u.avatar,u.address_id,-->
|
|
|
|
|
+<!-- u.qw_user_id,-->
|
|
|
|
|
+<!-- u.doctor_id,-->
|
|
|
|
|
+<!-- u.cid_server_id,-->
|
|
|
|
|
+<!-- d.dept_name,-->
|
|
|
|
|
+<!-- d.leader,-->
|
|
|
|
|
+<!-- u.ai_sip_call_user_id-->
|
|
|
|
|
+<!-- from-->
|
|
|
|
|
+<!-- company_user u-->
|
|
|
|
|
+<!-- left join-->
|
|
|
|
|
+<!-- company_dept d on u.dept_id = d.dept_id-->
|
|
|
|
|
+
|
|
|
|
|
+<!-- where-->
|
|
|
|
|
+<!-- u.del_flag = '0'-->
|
|
|
|
|
+<!-- <if test="userId != null ">-->
|
|
|
|
|
+<!-- AND u.user_id = #{userId}-->
|
|
|
|
|
+<!-- </if>-->
|
|
|
|
|
+<!-- <if test="userName != null and userName != ''">-->
|
|
|
|
|
+<!-- AND u.user_name like concat('%', #{userName}, '%')-->
|
|
|
|
|
+<!-- </if>-->
|
|
|
|
|
+
|
|
|
|
|
+<!-- <if test="nickName != null and nickName != ''">-->
|
|
|
|
|
+<!-- AND u.nick_name like concat( #{nickName}, '%')-->
|
|
|
|
|
+<!-- </if>-->
|
|
|
|
|
+
|
|
|
|
|
+<!-- <if test="companyId != null and companyId != ''">-->
|
|
|
|
|
+<!-- AND u.company_id = #{companyId}-->
|
|
|
|
|
+<!-- </if>-->
|
|
|
|
|
+
|
|
|
|
|
+<!-- <if test="status != null and status != ''">-->
|
|
|
|
|
+<!-- AND u.status = #{status}-->
|
|
|
|
|
+<!-- </if>-->
|
|
|
|
|
+
|
|
|
|
|
+<!-- <if test="qwStatus != null">-->
|
|
|
|
|
+<!-- AND u.qw_status = #{qwStatus}-->
|
|
|
|
|
+<!-- </if>-->
|
|
|
|
|
+
|
|
|
|
|
+<!-- <if test="phonenumber != null and phonenumber != ''">-->
|
|
|
|
|
+<!-- AND u.phonenumber like concat('%', #{phonenumber}, '%')-->
|
|
|
|
|
+<!-- </if>-->
|
|
|
|
|
+
|
|
|
|
|
+<!-- <if test="beginTime != null and beginTime != ''">-->
|
|
|
|
|
+<!-- AND date_format(u.create_time,'%y%m%d') >= date_format(#{beginTime},'%y%m%d')-->
|
|
|
|
|
+<!-- </if>-->
|
|
|
|
|
+
|
|
|
|
|
+<!-- <if test="endTime != null and endTime != ''">-->
|
|
|
|
|
+<!-- AND date_format(u.create_time,'%y%m%d') <= date_format(#{endTime},'%y%m%d')-->
|
|
|
|
|
+<!-- </if>-->
|
|
|
|
|
+
|
|
|
|
|
+<!-- <if test="deptId != null and deptId != 0">-->
|
|
|
|
|
+<!-- AND (u.dept_id = #{deptId} OR u.dept_id IN ( SELECT t.dept_id FROM company_dept t WHERE find_in_set(#{deptId}, ancestors) ))-->
|
|
|
|
|
+<!-- </if>-->
|
|
|
|
|
+
|
|
|
|
|
+<!-- <!– 数据范围过滤 –>-->
|
|
|
|
|
+<!-- ${params.dataScope}-->
|
|
|
|
|
+<!-- </select>-->
|
|
|
|
|
+
|
|
|
<!-- 角色子查询 -->
|
|
<!-- 角色子查询 -->
|
|
|
<select id="selectUserRoles" resultType="java.lang.String">
|
|
<select id="selectUserRoles" resultType="java.lang.String">
|
|
|
SELECT cr.role_name
|
|
SELECT cr.role_name
|