增加根据用户编码查询岗位列表接口

This commit is contained in:
thinkgem
2024-03-22 14:43:02 +08:00
parent a58a2dcda2
commit 0eb09a0dbb
2 changed files with 19 additions and 1 deletions

View File

@@ -35,6 +35,7 @@ public class Post extends DataEntity<Post> {
private Integer postSort; // 岗位排序(升序)
private String empCode; // 根据用户查询岗位
private String userCode; // 根据用户编码查询
private String roleCodes; // 关联的角色编号
private String roleNames; // 关联的角色名称
@@ -110,6 +111,16 @@ public class Post extends DataEntity<Post> {
this.empCode = empCode;
}
@ApiModelProperty("根据用户编码查询")
public String getUserCode() {
return userCode;
}
public void setUserCode(String userCode) {
this.userCode = userCode;
}
@ApiModelProperty("岗位绑定角色编码")
public String getRoleCodes() {
return roleCodes;
}

View File

@@ -7,13 +7,20 @@
SELECT ${sqlMap.column.toSql()}
FROM ${sqlMap.table.toSql()}
<if test="empCode != null and empCode != ''">
JOIN ${_prefix}sys_employee_post b on a.post_code = b.post_code
JOIN ${_prefix}sys_employee_post b ON b.post_code = a.post_code
</if>
<if test="userCode != null and userCode != ''">
JOIN ${_prefix}sys_employee_post b2 on b2.post_code = a.post_code
JOIN ${_prefix}sys_user u on u.ref_code = b2.emp_code AND u.user_type = 'employee'
</if>
<where>
${sqlMap.where.toSql()}
<if test="empCode != null and empCode != ''">
AND b.emp_code = #{empCode}
</if>
<if test="userCode != null and userCode != ''">
AND u.user_code = #{userCode}
</if>
</where>
ORDER BY ${sqlMap.order.toSql()}
</select>