|
@@ -27,12 +27,15 @@
|
|
|
<result property="updateBy" column="update_by" />
|
|
|
<result property="updateTime" column="update_time" />
|
|
|
<result property="remark" column="remark" />
|
|
|
+ <result property="usageId" column="usage_id" />
|
|
|
+ <result property="usageCode" column="usage_code" />
|
|
|
<result property="isLeader" column="is_leader"/>
|
|
|
<result property="isPartTime" column="is_part_time"/>
|
|
|
<result property="isDispatcher" column="is_dispatcher"/>
|
|
|
<result property="isFormman" column="is_formman"/>
|
|
|
<result property="isYardman" column="is_yardman"/>
|
|
|
<result property="isEdit" column="is_edit"/>
|
|
|
+ <association property="deptName" column="usage_id" select="getDeptName"></association>
|
|
|
<collection property="roles" javaType="java.util.List" resultMap="RoleResult" />
|
|
|
</resultMap>
|
|
|
|
|
@@ -46,13 +49,16 @@
|
|
|
</resultMap>
|
|
|
|
|
|
<sql id="selectUserTenantVo">
|
|
|
- SELECT u.user_id, u.tenant_id, IFNULL(t.org_name, '超级管理员') AS tenant_name, u.user_type,u.user_name, u.nick_name, u.email,u.contract_company_name, u.contract_company_id, u.avatar, u.phone_number, u.password, u.sex, u.status, u.del_flag, u.login_ip, u.login_date, u.create_by, u.create_time, u.remark,
|
|
|
+ SELECT u.user_id, u.tenant_id, IFNULL(t.org_name, '超级管理员') AS tenant_name, u.user_type,u.user_name, u.nick_name, u.email,u.contract_company_name, u.contract_company_id, u.avatar, u.phone_number, u.password, u.sex, u.status, u.del_flag, u.login_ip, u.login_date, u.create_by, u.create_time, u.remark,u.usage_id,u.usage_code,
|
|
|
r.role_id, r.role_name, r.role_key, r.role_sort, r.data_scope, r.status as role_status
|
|
|
FROM sys_user u
|
|
|
LEFT JOIN biz_tenant t ON t.id = u.tenant_id
|
|
|
LEFT JOIN sys_user_role ur ON u.user_id = ur.user_id
|
|
|
LEFT JOIN sys_role r ON r.role_id = ur.role_id
|
|
|
</sql>
|
|
|
+ <select id="getDeptName" resultType="String">
|
|
|
+ select dept_name deptName from sys_dept where dept_id = #{usage_id}
|
|
|
+ </select>
|
|
|
<select id="getListByDeptId" parameterType="java.util.List" resultMap="SysUserResult">
|
|
|
SELECT u.*,
|
|
|
-- 用于前端控制是否进入编辑状态
|
|
@@ -104,6 +110,8 @@
|
|
|
u.login_date,
|
|
|
u.create_by,
|
|
|
u.create_time,
|
|
|
+ u.usage_id,
|
|
|
+ u.usage_code,
|
|
|
u.remark FROM sys_user u left join sys_dept_user d on u.user_id = d.user_id
|
|
|
WHERE u.del_flag = '0' and d.deleted = 0
|
|
|
<if test="userId != null and userId != 0">
|
|
@@ -160,7 +168,9 @@
|
|
|
u.login_date,
|
|
|
u.create_by,
|
|
|
u.create_time,
|
|
|
- u.remark
|
|
|
+ u.remark,
|
|
|
+ u.usage_id,
|
|
|
+ u.usage_code
|
|
|
FROM sys_user u
|
|
|
WHERE u.del_flag = '0' AND u.user_type='02'
|
|
|
<if test="userId != null and userId != 0">
|
|
@@ -261,7 +271,7 @@
|
|
|
<select id="checkEmailUnique" parameterType="String" resultMap="SysUserResult">
|
|
|
SELECT user_id, email FROM sys_user WHERE email = #{email} AND del_flag = '0' limit 1
|
|
|
</select>
|
|
|
- <select id="listByLikeNickNameOrUserName" resultType="cn.ezhizao.project.system.domain.SysUser">
|
|
|
+ <select id="listByLikeNickNameOrUserName" resultMap="SysUserResult">
|
|
|
SELECT * FROM sys_user
|
|
|
<trim prefix=" WHERE" suffix="" suffixOverrides="AND">
|
|
|
del_flag = '0'
|
|
@@ -287,6 +297,8 @@
|
|
|
<if test="userType != null and userType != ''">user_type,</if>
|
|
|
<if test="contractCompanyName != null and contractCompanyName != ''">contract_company_name,</if>
|
|
|
<if test="contractCompanyId != null and contractCompanyId != ''">contract_company_id,</if>
|
|
|
+ <if test="usageId != null and usageId != 0">usage_id,</if>
|
|
|
+ <if test="usageCode != null and usageCode != ''">usage_code,</if>
|
|
|
create_time
|
|
|
)VALUES(
|
|
|
<if test="userId != null and userId != ''">#{userId},</if>
|
|
@@ -304,6 +316,8 @@
|
|
|
<if test="userType != null and userType != ''">#{userType},</if>
|
|
|
<if test="contractCompanyName != null and contractCompanyName != ''">#{contractCompanyName},</if>
|
|
|
<if test="contractCompanyId != null and contractCompanyId != ''">#{contractCompanyId},</if>
|
|
|
+ <if test="usageId != null and usageId != 0">#{usageId},</if>
|
|
|
+ <if test="usageCode != null and usageCode != 0">#{usageCode},</if>
|
|
|
sysdate()
|
|
|
)
|
|
|
</insert>
|
|
@@ -326,6 +340,8 @@
|
|
|
<if test="remark != null">remark = #{remark},</if>
|
|
|
<if test="contractCompanyName != null and contractCompanyName != ''">contract_company_name = #{contractCompanyName},</if>
|
|
|
<if test="contractCompanyId != null and contractCompanyId != ''">contract_company_id = #{contractCompanyId},</if>
|
|
|
+ <if test="usageId != null and usageId != 0">usage_id = #{usageId},</if>
|
|
|
+ <if test="usageCode != null and usageCode != 0">usage_code = #{usageCode},</if>
|
|
|
update_time = sysdate()
|
|
|
</set>
|
|
|
WHERE user_id = #{userId}
|