|
@@ -456,36 +456,25 @@
|
|
|
<!-- 查询员工总量 -->
|
|
<!-- 查询员工总量 -->
|
|
|
<select id="getStaffCount" parameterType="Map" resultType="Map">
|
|
<select id="getStaffCount" parameterType="Map" resultType="Map">
|
|
|
select count(1) count
|
|
select count(1) count
|
|
|
- from
|
|
|
|
|
- u_user a
|
|
|
|
|
- ,u_org uo
|
|
|
|
|
- ,u_org_staff_rel uosr
|
|
|
|
|
- ,u_org puo
|
|
|
|
|
- where a.level_cd = '01'
|
|
|
|
|
- and a.user_id = uosr.staff_id
|
|
|
|
|
|
|
+ u_user u
|
|
|
|
|
+ left join u_org_staff_rel uosr on u.user_id = uosr.staff_id and uosr.status_cd = '0'
|
|
|
|
|
+ left join u_org uo on uosr.org_id = uo.org_id and uo.status_cd = '0'
|
|
|
|
|
+ where u.level_cd = '01'
|
|
|
<if test="storeId !=null and storeId != ''">
|
|
<if test="storeId !=null and storeId != ''">
|
|
|
and uosr.store_id = #{storeId}
|
|
and uosr.store_id = #{storeId}
|
|
|
</if>
|
|
</if>
|
|
|
- and uosr.org_id = uo.org_id
|
|
|
|
|
- and uo.parent_org_id = puo.org_id
|
|
|
|
|
- <if test="parentOrgId !=null and parentOrgId != ''">
|
|
|
|
|
- and uo.parent_org_id = #{parentOrgId}
|
|
|
|
|
- </if>
|
|
|
|
|
- <if test="departmentOrgId !=null and departmentOrgId != ''">
|
|
|
|
|
- and uosr.org_id = #{departmentOrgId}
|
|
|
|
|
|
|
+ <if test="orgId !=null and orgId != ''">
|
|
|
|
|
+ and uosr.org_id = #{orgId}
|
|
|
</if>
|
|
</if>
|
|
|
- and a.status_cd = '0'
|
|
|
|
|
- and uo.status_cd = '0'
|
|
|
|
|
- and uosr.status_cd = '0'
|
|
|
|
|
- and puo.status_cd = '0'
|
|
|
|
|
|
|
+ and u.status_cd = '0'
|
|
|
<if test="tel !=null and tel != ''">
|
|
<if test="tel !=null and tel != ''">
|
|
|
- and a.tel= #{tel}
|
|
|
|
|
|
|
+ and u.tel= #{tel}
|
|
|
</if>
|
|
</if>
|
|
|
<if test="name !=null and name != ''">
|
|
<if test="name !=null and name != ''">
|
|
|
- and a.name like concat('%',#{name},'%')
|
|
|
|
|
|
|
+ and u.name like concat('%',#{name},'%')
|
|
|
</if>
|
|
</if>
|
|
|
<if test="staffName !=null and staffName != ''">
|
|
<if test="staffName !=null and staffName != ''">
|
|
|
- and a.name like concat('%',#{staffName},'%')
|
|
|
|
|
|
|
+ and u.name like concat('%',#{staffName},'%')
|
|
|
</if>
|
|
</if>
|
|
|
<if test="staffId != null and staffId !=''">
|
|
<if test="staffId != null and staffId !=''">
|
|
|
and uosr.staff_id = #{staffId}
|
|
and uosr.staff_id = #{staffId}
|
|
@@ -496,37 +485,31 @@
|
|
|
<if test="bId != null and bId !=''">
|
|
<if test="bId != null and bId !=''">
|
|
|
and u.b_id = #{bId}
|
|
and u.b_id = #{bId}
|
|
|
</if>
|
|
</if>
|
|
|
|
|
+ <if test="userIds != null and userIds != null">
|
|
|
|
|
+ and u.user_id in
|
|
|
|
|
+ <foreach collection="userIds" item="item" open="(" close=")" separator=",">
|
|
|
|
|
+ #{item}
|
|
|
|
|
+ </foreach>
|
|
|
|
|
+ </if>
|
|
|
</select>
|
|
</select>
|
|
|
|
|
|
|
|
<!-- 查询员工总量 -->
|
|
<!-- 查询员工总量 -->
|
|
|
<select id="getStaffs" parameterType="Map" resultType="Map">
|
|
<select id="getStaffs" parameterType="Map" resultType="Map">
|
|
|
select uo.org_id orgId,uo.org_name,uo.org_name orgName,u.user_id, u.user_id userId,u.name,u.name
|
|
select uo.org_id orgId,uo.org_name,uo.org_name orgName,u.user_id, u.user_id userId,u.name,u.name
|
|
|
userName,u.email,u.address,u.location_cd,u.location_cd locationCd,
|
|
userName,u.email,u.address,u.location_cd,u.location_cd locationCd,
|
|
|
- u.age,u.sex,u.tel,u.level_cd levelCd,u.b_id,puo.org_id parentOrgId,puo.org_name
|
|
|
|
|
- parentOrgName,puo.belong_community_id belongCommunityId,
|
|
|
|
|
- uosr.store_id storeId,uosr.rel_cd relCd
|
|
|
|
|
|
|
+ u.age,u.sex,u.tel,u.level_cd levelCd,u.b_id,uosr.store_id storeId,uosr.rel_cd relCd
|
|
|
from
|
|
from
|
|
|
u_user u
|
|
u_user u
|
|
|
- ,u_org uo
|
|
|
|
|
- ,u_org_staff_rel uosr
|
|
|
|
|
- ,u_org puo
|
|
|
|
|
|
|
+ left join u_org_staff_rel uosr on u.user_id = uosr.staff_id and uosr.status_cd = '0'
|
|
|
|
|
+ left join u_org uo on uosr.org_id = uo.org_id and uo.status_cd = '0'
|
|
|
where u.level_cd = '01'
|
|
where u.level_cd = '01'
|
|
|
- and u.user_id = uosr.staff_id
|
|
|
|
|
<if test="storeId !=null and storeId != ''">
|
|
<if test="storeId !=null and storeId != ''">
|
|
|
and uosr.store_id = #{storeId}
|
|
and uosr.store_id = #{storeId}
|
|
|
</if>
|
|
</if>
|
|
|
- and uosr.org_id = uo.org_id
|
|
|
|
|
- and uo.parent_org_id = puo.org_id
|
|
|
|
|
- <if test="parentOrgId !=null and parentOrgId != ''">
|
|
|
|
|
- and uo.parent_org_id = #{parentOrgId}
|
|
|
|
|
- </if>
|
|
|
|
|
- <if test="departmentOrgId !=null and departmentOrgId != ''">
|
|
|
|
|
- and uosr.org_id = #{departmentOrgId}
|
|
|
|
|
|
|
+ <if test="orgId !=null and orgId != ''">
|
|
|
|
|
+ and uosr.org_id = #{orgId}
|
|
|
</if>
|
|
</if>
|
|
|
and u.status_cd = '0'
|
|
and u.status_cd = '0'
|
|
|
- and uo.status_cd = '0'
|
|
|
|
|
- and uosr.status_cd = '0'
|
|
|
|
|
- and puo.status_cd = '0'
|
|
|
|
|
<if test="tel !=null and tel != ''">
|
|
<if test="tel !=null and tel != ''">
|
|
|
and u.tel= #{tel}
|
|
and u.tel= #{tel}
|
|
|
</if>
|
|
</if>
|