refactor(executor/people): 加 executorList 兜底, SQL 硬编码 unit_type='executor' (跟 sponsor 同模式)

- mapper BizPersonMapper.xml 新增 selectExecutorList, SQL 内硬编码 unit_type + parent_user_id=当前主账号
- controller 加 GET /business/person/executorList
- service / mapper 接口同步声明 selectExecutorList
- 前端 api/business/person.js 加 listExecutorPerson
- executor/People.vue 改调 listExecutorPerson, 删 bizList + unitType 参数

效果: executor 端人员列表也走专属接口, 前端传 unitType 绕不开 SQL 兜底
This commit is contained in:
郭庆泰
2026-08-18 01:42:05 +08:00
parent ce9de7c880
commit 50c2678ec6
7 changed files with 57 additions and 5 deletions
@@ -79,6 +79,19 @@ public class BizPersonController extends BaseController
List<BizPerson> list = bizPersonService.selectSponsorList(bizPerson);
return getDataTable(list);
}
/**
* executor 端专属人员列表 (同 sponsor: SQL 硬编码 unit_type='executor' + parent_user_id=当前主账号, 前端绕不开)
*/
@GetMapping("/executorList")
public TableDataInfo executorList(BizPerson bizPerson)
{
Long mainUid = getUserId();
bizPerson.getParams().put("executorOwnerUid", mainUid);
startPage();
List<BizPerson> list = bizPersonService.selectExecutorList(bizPerson);
return getDataTable(list);
}
@GetMapping("/{personId}")
public AjaxResult getInfo(@PathVariable("personId") String personId)
{
@@ -11,6 +11,8 @@ public interface BizPersonMapper
List<BizPerson> selectList(BizPerson entity);
/** sponsor 专属: 通过 sys_user.parent_user_id 过滤主账号归属, INNER JOIN 自然排除游离 person */
List<BizPerson> selectSponsorList(BizPerson entity);
/** executor 专属: 同 sponsor, SQL 硬编码 unit_type='executor' (前端绕不开) */
List<BizPerson> selectExecutorList(BizPerson entity);
int insert(BizPerson entity);
int updateByPrimaryKey(BizPerson entity);
int deleteByPrimaryKey(String personId);
@@ -17,6 +17,8 @@ public interface IBizPersonService
List<BizPerson> selectList(BizPerson entity);
/** sponsor 专属: 走 BizPersonMapper.selectSponsorList, 用 sys_user.parent_user_id 做归属过滤 */
List<BizPerson> selectSponsorList(BizPerson entity);
/** executor 专属: 同 sponsor, SQL 硬编码 unit_type='executor' (前端绕不开) */
List<BizPerson> selectExecutorList(BizPerson entity);
SysUser insert(BizPerson entity, Long mainUserId);
int updateByPrimaryKey(BizPerson entity);
int deleteByPrimaryKey(String personId);
@@ -35,6 +35,10 @@ public class BizPersonServiceImpl implements IBizPersonService
public List<BizPerson> selectSponsorList(BizPerson entity)
{ return bizPersonMapper.selectSponsorList(entity); }
@Override
public List<BizPerson> selectExecutorList(BizPerson entity)
{ return bizPersonMapper.selectExecutorList(entity); }
/**
* sponsor 端新建人员 = 同时创建 sys_user 子账号 (account_type='SUB', parent_user_id=主账号 user_id)
* 返回新 SysUser 含 username + 明文 password (前端 toast 显示后即丢)
@@ -161,4 +161,22 @@
</where>
order by p.person_id desc
</select>
<!-- executor 专属: 同 sponsor, SQL 硬编码 unit_type='executor' + parent_user_id=当前主账号 (前端绕不开) -->
<select id="selectExecutorList" resultMap="BizPersonResult" parameterType="BizPerson">
<include refid="selectFieldsWithAccount"/>
<where>
u.del_flag = '0'
and p.unit_type = 'executor'
and u.parent_user_id = #{params.executorOwnerUid}
<if test="name != null and name != ''"> and p.name = #{name}</if>
<if test="phone != null and phone != ''"> and p.phone = #{phone}</if>
<if test="orgId != null"> and p.org_id = #{orgId}</if>
<if test="department != null and department != ''"> and p.department = #{department}</if>
<if test="position != null and position != ''"> and p.position = #{position}</if>
<if test="role != null and role != ''"> and p.role = #{role}</if>
<if test="status != null and status != ''"> and u.status = #{status}</if>
</where>
order by p.person_id desc
</select>
</mapper>