新增 findUserListByCompanyCodes 方法,根据公司编码获取用户编码和名称

This commit is contained in:
thinkgem
2025-02-20 17:48:48 +08:00
parent 3e68536eea
commit 87116f0fc7
4 changed files with 56 additions and 18 deletions

View File

@@ -38,6 +38,11 @@ public interface EmpUserDao extends CrudDao<EmpUser> {
*/ */
List<EmpUser> findUserListByOfficeCodes(EmpUser empUser); List<EmpUser> findUserListByOfficeCodes(EmpUser empUser);
/**
* 根据公司编码查询用户,仅返回基本信息
*/
List<EmpUser> findUserListByCompanyCodes(EmpUser empUser);
/** /**
* 根据角色编码查询用户,仅返回基本信息 * 根据角色编码查询用户,仅返回基本信息
*/ */

View File

@@ -48,6 +48,11 @@ public interface EmpUserService extends CrudServiceApi<EmpUser> {
*/ */
List<EmpUser> findUserListByOfficeCodes(EmpUser empUser); List<EmpUser> findUserListByOfficeCodes(EmpUser empUser);
/**
* 根据公司编码查询用户,仅返回基本信息
*/
List<EmpUser> findUserListByCompanyCodes(EmpUser empUser);
/** /**
* 根据角色编码查询用户,仅返回基本信息 * 根据角色编码查询用户,仅返回基本信息
*/ */

View File

@@ -115,6 +115,13 @@ public class EmpUserServiceSupport extends CrudService<EmpUserDao, EmpUser>
public List<EmpUser> findUserListByOfficeCodes(EmpUser empUser){ public List<EmpUser> findUserListByOfficeCodes(EmpUser empUser){
return dao.findUserListByOfficeCodes(empUser); return dao.findUserListByOfficeCodes(empUser);
} }
/**
* 根据公司编码查询用户,仅返回基本信息
*/
@Override
public List<EmpUser> findUserListByCompanyCodes(EmpUser empUser){
return dao.findUserListByCompanyCodes(empUser);
}
/** /**
* 根据角色编码查询用户,仅返回基本信息 * 根据角色编码查询用户,仅返回基本信息

View File

@@ -85,6 +85,27 @@
ORDER BY a.user_code ORDER BY a.user_code
</select> </select>
<!-- 根据公司编码查询用户,仅返回基本信息 -->
<select id="findUserListByCompanyCodes" resultType="EmpUser">
SELECT
<include refid="userColumns"/>
FROM ${_prefix}sys_user a
JOIN ${_prefix}sys_employee e ON e.emp_code = a.ref_code
JOIN ${_prefix}sys_company o ON o.company_code = e.company_code
WHERE a.status = #{STATUS_NORMAL}
AND a.user_type = #{USER_TYPE_EMPLOYEE}
<if test="global.useCorpModel">
AND a.corp_code = #{corpCode}
</if>
AND e.status = #{STATUS_NORMAL}
AND o.status = #{STATUS_NORMAL}
AND o.company_code IN
<foreach item="code" index="index" collection="codes" open="(" separator="," close=")">
#{code}
</foreach>
ORDER BY a.user_code
</select>
<!-- 根据角色编码查询用户,仅返回基本信息 --> <!-- 根据角色编码查询用户,仅返回基本信息 -->
<select id="findUserListByRoleCodes" resultType="EmpUser"> <select id="findUserListByRoleCodes" resultType="EmpUser">
SELECT SELECT