提交 32e27b8c 作者: zhenjie

账号分配角色相关-列表添加角色字段

上级 b7decf1c
package com.mmc.iuav.user.model.vo; package com.mmc.iuav.user.model.vo;
import com.mmc.iuav.user.model.dto.RoleInfoDTO;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import lombok.Builder; import lombok.Builder;
...@@ -57,4 +58,6 @@ public class BackUserAccountVO implements Serializable { ...@@ -57,4 +58,6 @@ public class BackUserAccountVO implements Serializable {
private String address; private String address;
@ApiModelProperty(value = "单位信息") @ApiModelProperty(value = "单位信息")
private CompanyInfoVO companyInfoVO; private CompanyInfoVO companyInfoVO;
@ApiModelProperty(value = "角色信息")
private RoleInfoDTO roleInfoDTO;
} }
...@@ -34,6 +34,7 @@ public class BackUserAccountDO implements Serializable { ...@@ -34,6 +34,7 @@ public class BackUserAccountDO implements Serializable {
private Date updateTime; private Date updateTime;
private String remark; private String remark;
private String address; private String address;
private RoleInfoDO roleInfoDO;
public BackUserAccountDO(BUserAccountVO bUserAccountVO) { public BackUserAccountDO(BUserAccountVO bUserAccountVO) {
this.id = bUserAccountVO.getId(); this.id = bUserAccountVO.getId();
...@@ -48,8 +49,10 @@ public class BackUserAccountDO implements Serializable { ...@@ -48,8 +49,10 @@ public class BackUserAccountDO implements Serializable {
this.address = bUserAccountVO.getAddress(); this.address = bUserAccountVO.getAddress();
} }
public BackUserAccountVO buildBackUserAccountVO(){ public BackUserAccountVO buildBackUserAccountVO() {
return BackUserAccountVO.builder().id(this.id).uid(this.id).accountNo(this.accountNo).phoneNum(this.phoneNum).userName(this.userName).userSex(this.userSex).email(this.email) return BackUserAccountVO.builder().id(this.id).uid(this.id).accountNo(this.accountNo).phoneNum(this.phoneNum)
.accountStatus(this.accountStatus).remark(this.remark).address(this.address).createTime(this.createTime).build(); .userName(this.userName).userSex(this.userSex).email(this.email).accountStatus(this.accountStatus)
.remark(this.remark).address(this.address).createTime(this.createTime)
.roleInfoDTO(this.roleInfoDO == null ? null : this.roleInfoDO.buildRoleInfoDTO()).build();
} }
} }
...@@ -19,6 +19,11 @@ ...@@ -19,6 +19,11 @@
<result property="deleted" column="is_deleted"/> <result property="deleted" column="is_deleted"/>
<result property="createTime" column="createTime"/> <result property="createTime" column="createTime"/>
<result property="updateTime" column="update_time"/> <result property="updateTime" column="update_time"/>
<association property="roleInfoDO" javaType="com.mmc.iuav.user.entity.RoleInfoDO">
<id property="id" column="ri_id"/>
<result property="roleNo" column="role_no"/>
<result property="roleName" column="role_name"/>
</association>
</resultMap> </resultMap>
<insert id="insertBackUserAccount" parameterType="com.mmc.iuav.user.entity.BackUserAccountDO" keyProperty="id" <insert id="insertBackUserAccount" parameterType="com.mmc.iuav.user.entity.BackUserAccountDO" keyProperty="id"
...@@ -107,7 +112,7 @@ ...@@ -107,7 +112,7 @@
<select id="countListBackUserAccount" resultType="java.lang.Integer" <select id="countListBackUserAccount" resultType="java.lang.Integer"
parameterType="com.mmc.iuav.user.model.qo.BUserAccountQO"> parameterType="com.mmc.iuav.user.model.qo.BUserAccountQO">
select count(*) from back_user_account bua select count(*) from back_user_account bua
left join user_role_rel urr on urr.user_account_id=bua.id left join user_role_rel urr on urr.back_user_account_id = bua.id
where bua.is_deleted = 0 where bua.is_deleted = 0
<if test=" keyword != null and keyword != '' "> <if test=" keyword != null and keyword != '' ">
and ( bua.account_no like CONCAT("%",#{keyword},"%") or and ( bua.account_no like CONCAT("%",#{keyword},"%") or
...@@ -146,10 +151,14 @@ ...@@ -146,10 +151,14 @@
bua.address, bua.address,
bua.remark, bua.remark,
bua.create_time, bua.create_time,
bua.update_time bua.update_time,
ri.id as ri_id,
ri.role_name,
ri.role_no
FROM FROM
back_user_account bua back_user_account bua
left join user_role_rel urr on urr.user_account_id=bua.id left join user_role_rel urr on urr.back_user_account_id = bua.id
left join role_info ri on ri.id = urr.role_id
WHERE WHERE
bua.is_deleted = 0 bua.is_deleted = 0
<if test=" keyword != null and keyword != '' "> <if test=" keyword != null and keyword != '' ">
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论