Commit db4c2e68 by duanhq

获取商户列表新增服务商名,所有用户列表只显示普通用户和服务商 by duanht 2019/3/12

git-svn-id: svn://192.168.3.233/frms/code/car-service/trunk/car-service@18438 aeb6102e-e053-11e5-9fec-f9ebc45caf4b
1 parent 968924f9
...@@ -89,6 +89,11 @@ public class SysUser extends BaseModel implements Serializable{ ...@@ -89,6 +89,11 @@ public class SysUser extends BaseModel implements Serializable{
private Integer groupId; private Integer groupId;
/** /**
*服务商名称
*/
private String serviceName;
/**
*服务项信息 *服务项信息
*/ */
private List<SysUserServices> userService = new ArrayList<>(); private List<SysUserServices> userService = new ArrayList<>();
...@@ -327,5 +332,13 @@ public class SysUser extends BaseModel implements Serializable{ ...@@ -327,5 +332,13 @@ public class SysUser extends BaseModel implements Serializable{
public void setGroupId(Integer groupId) { public void setGroupId(Integer groupId) {
this.groupId = groupId; this.groupId = groupId;
} }
public String getServiceName() {
return serviceName;
}
public void setServiceName(String serviceName) {
this.serviceName = serviceName;
}
} }
...@@ -155,6 +155,12 @@ public class SysUserServiceImpl implements SysUserService { ...@@ -155,6 +155,12 @@ public class SysUserServiceImpl implements SysUserService {
SysOrganization sysOrganization = sysOrganizationMapper.selectByPrimaryKey(sysMerchant.getGroupId()); SysOrganization sysOrganization = sysOrganizationMapper.selectByPrimaryKey(sysMerchant.getGroupId());
sysMerchant.setOrgName(sysOrganization.getName()); sysMerchant.setOrgName(sysOrganization.getName());
} }
//设置服务商名
SysUser sysUser = sysUserMapper.selectByPrimaryKey(sysMerchant.getUserId());
if (sysUser != null){
sysMerchant.setServiceName(sysUser.getName());
}
} }
return sysMerchantList; return sysMerchantList;
} }
......
...@@ -269,7 +269,8 @@ ...@@ -269,7 +269,8 @@
<select id="getAllGroupByParentId" resultType="com.glsx.usercenter.pojo.menu.SysOrganization"> <select id="getAllGroupByParentId" resultType="com.glsx.usercenter.pojo.menu.SysOrganization">
SELECT SELECT
so.id id, so.id id,
so.name name so.name name,
so.org_type orgType
FROM FROM
sys_organization so sys_organization so
WHERE WHERE
......
...@@ -80,7 +80,7 @@ ...@@ -80,7 +80,7 @@
</sql> </sql>
<sql id="Base_Column_List"> <sql id="Base_Column_List">
id, username, name, org_id, phone_number, user_status, create_by, create_time, update_by, id, username, name, org_id, phone_number, user_status, create_by, create_time, update_by,
update_time, password, sex, remark, user_type,group_id update_time, password, sex, remark, user_type, group_id
</sql> </sql>
<select id="selectByExample" parameterType="com.glsx.usercenter.pojo.user.SysUserExample" resultMap="BaseResultMap"> <select id="selectByExample" parameterType="com.glsx.usercenter.pojo.user.SysUserExample" resultMap="BaseResultMap">
...@@ -619,7 +619,7 @@ ...@@ -619,7 +619,7 @@
</choose> </choose>
</otherwise> </otherwise>
</choose> </choose>
and u.user_type in (0,1)
<if test="ids != null"> <if test="ids != null">
and u.org_id in and u.org_id in
<foreach collection="ids" item="item" index="index" <foreach collection="ids" item="item" index="index"
...@@ -649,6 +649,7 @@ ...@@ -649,6 +649,7 @@
<bind name="merchantId" value="'%' + merchantId + '%'"/> <bind name="merchantId" value="'%' + merchantId + '%'"/>
</if> </if>
SELECT SELECT
DISTINCT
u.id, u.id,
u.username, u.username,
u.password, u.password,
...@@ -663,7 +664,8 @@ ...@@ -663,7 +664,8 @@
sdd.data_key serviceKey, sdd.data_key serviceKey,
sdd.data_value serviceItems, sdd.data_value serviceItems,
sm.merchant_status merchantStatus, sm.merchant_status merchantStatus,
u.org_id groupId u.org_id groupId,
srm.user_id userId
<choose> <choose>
<when test="userId != 0 and userId!=''"> <when test="userId != 0 and userId!=''">
FROM FROM
...@@ -673,6 +675,7 @@ ...@@ -673,6 +675,7 @@
LEFT JOIN sys_merchant sm ON sm.user_id = u.id LEFT JOIN sys_merchant sm ON sm.user_id = u.id
LEFT JOIN sys_user_services sms ON sm.user_id = sms.user_id LEFT JOIN sys_user_services sms ON sm.user_id = sms.user_id
LEFT JOIN sys_dict_data sdd ON sms.service_key = sdd.data_key LEFT JOIN sys_dict_data sdd ON sms.service_key = sdd.data_key
LEFT JOIN sys_resource_matching srm ON srm.merchant_id = u.id
WHERE suo.user_id = #{userId,jdbcType=INTEGER} WHERE suo.user_id = #{userId,jdbcType=INTEGER}
AND u.user_type = 2 AND u.user_type = 2
</when> </when>
...@@ -683,6 +686,7 @@ ...@@ -683,6 +686,7 @@
LEFT JOIN sys_merchant sm ON sm.user_id = u.id LEFT JOIN sys_merchant sm ON sm.user_id = u.id
LEFT JOIN sys_user_services sms ON sm.user_id = sms.user_id LEFT JOIN sys_user_services sms ON sm.user_id = sms.user_id
LEFT JOIN sys_dict_data sdd ON sms.service_key = sdd.data_key LEFT JOIN sys_dict_data sdd ON sms.service_key = sdd.data_key
LEFT JOIN sys_resource_matching srm ON srm.merchant_id = u.id
WHERE u.user_type = 2 WHERE u.user_type = 2
</otherwise> </otherwise>
</choose> </choose>
...@@ -913,10 +917,10 @@ ...@@ -913,10 +917,10 @@
<update id="deleteUserById" parameterType="com.glsx.usercenter.pojo.vo.UserQueryVo"> <update id="deleteUserById" parameterType="com.glsx.usercenter.pojo.vo.UserQueryVo">
update sys_user UPDATE sys_user
set user_status = 'sys_user_status_logout',update_by= #{name,jdbcType=VARCHAR},update_time= SET user_status = 'sys_user_status_logout', update_by = #{name,jdbcType=VARCHAR}, update_time =
#{time,jdbcType=TIMESTAMP} #{time,jdbcType=TIMESTAMP}
where id = #{userId,jdbcType=INTEGER} WHERE id = #{userId,jdbcType=INTEGER}
</update> </update>
<select id="getUserByIdAndName" resultType="com.glsx.usercenter.pojo.user.SysUser"> <select id="getUserByIdAndName" resultType="com.glsx.usercenter.pojo.user.SysUser">
...@@ -930,6 +934,7 @@ ...@@ -930,6 +934,7 @@
LEFT JOIN sys_user_org uo ON uo.org_id = u.org_id LEFT JOIN sys_user_org uo ON uo.org_id = u.org_id
LEFT JOIN sys_organization so ON uo.org_id = so.id LEFT JOIN sys_organization so ON uo.org_id = so.id
WHERE u.user_type = 1 WHERE u.user_type = 1
and u.user_status='sys_user_status_normal'
<if test="id != 0 and id!=''"> <if test="id != 0 and id!=''">
AND uo.user_id = #{id,jdbcType=INTEGER} AND uo.user_id = #{id,jdbcType=INTEGER}
</if> </if>
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!