|
|
|
@ -25,6 +25,8 @@
|
|
|
|
|
<result property="remark" column="remark" />
|
|
|
|
|
<result property="stationCode" column="station_code" />
|
|
|
|
|
<result property="stationName" column="station_name" />
|
|
|
|
|
<result property="teamCode" column="team_code" />
|
|
|
|
|
<result property="teamName" column="team_name" />
|
|
|
|
|
<association property="dept" column="dept_id" javaType="SysDept" resultMap="deptResult" />
|
|
|
|
|
<collection property="roles" javaType="java.util.List" resultMap="RoleResult" />
|
|
|
|
|
</resultMap>
|
|
|
|
@ -49,21 +51,73 @@
|
|
|
|
|
</resultMap>
|
|
|
|
|
|
|
|
|
|
<sql id="selectUserVo">
|
|
|
|
|
select u.user_id, u.dept_id, u.user_name, u.nick_name, u.email, u.avatar, u.phonenumber, u.password, u.sex, u.status, u.del_flag, u.login_ip, u.login_date, u.create_by, u.create_time, u.remark,
|
|
|
|
|
d.dept_id, d.parent_id, d.ancestors, d.dept_name, d.order_num, d.leader, d.status as dept_status,
|
|
|
|
|
r.role_id, r.role_name, r.role_key, r.role_sort, r.data_scope, r.status as role_status, u.station_code ,pl.PRODUCT_LINE_NAME station_name
|
|
|
|
|
select u.user_id,
|
|
|
|
|
u.dept_id,
|
|
|
|
|
u.user_name,
|
|
|
|
|
u.nick_name,
|
|
|
|
|
u.email,
|
|
|
|
|
u.avatar,
|
|
|
|
|
u.phonenumber,
|
|
|
|
|
u.password,
|
|
|
|
|
u.sex,
|
|
|
|
|
u.status,
|
|
|
|
|
u.del_flag,
|
|
|
|
|
u.login_ip,
|
|
|
|
|
u.login_date,
|
|
|
|
|
u.create_by,
|
|
|
|
|
u.create_time,
|
|
|
|
|
u.remark,
|
|
|
|
|
d.dept_id,
|
|
|
|
|
d.parent_id,
|
|
|
|
|
d.ancestors,
|
|
|
|
|
d.dept_name,
|
|
|
|
|
d.order_num,
|
|
|
|
|
d.leader,
|
|
|
|
|
d.status as dept_status,
|
|
|
|
|
r.role_id,
|
|
|
|
|
r.role_name,
|
|
|
|
|
r.role_key,
|
|
|
|
|
r.role_sort,
|
|
|
|
|
r.data_scope,
|
|
|
|
|
r.status as role_status,
|
|
|
|
|
u.station_code,
|
|
|
|
|
u.team_code,
|
|
|
|
|
tm.team_name,
|
|
|
|
|
pl.PRODUCT_LINE_NAME station_name
|
|
|
|
|
from sys_user u
|
|
|
|
|
left join sys_dept d on u.dept_id = d.dept_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
|
|
|
|
|
left join BASE_PRODUCTLINE pl on pl.PRODUCT_LINE_CODE = u.station_code
|
|
|
|
|
left join BASE_PRODUCTLINE pl on pl.PRODUCT_LINE_CODE = u.station_code
|
|
|
|
|
left join BASE_TEAMMEMBERS tm on tm.TEAM_CODE = u.TEAM_CODE
|
|
|
|
|
</sql>
|
|
|
|
|
|
|
|
|
|
<select id="selectUserList" parameterType="SysUser" resultMap="SysUserResult">
|
|
|
|
|
select u.user_id, u.dept_id, u.nick_name, u.user_name, u.email, u.avatar, u.phonenumber, u.sex, u.status, u.del_flag, u.login_ip,
|
|
|
|
|
u.login_date, u.create_by, u.create_time, u.remark, d.dept_name, d.leader, u.station_code ,pl.PRODUCT_LINE_NAME station_name from sys_user u
|
|
|
|
|
select u.user_id,
|
|
|
|
|
u.dept_id,
|
|
|
|
|
u.nick_name,
|
|
|
|
|
u.user_name,
|
|
|
|
|
u.email,
|
|
|
|
|
u.avatar,
|
|
|
|
|
u.phonenumber,
|
|
|
|
|
u.sex,
|
|
|
|
|
u.status,
|
|
|
|
|
u.del_flag,
|
|
|
|
|
u.login_ip,
|
|
|
|
|
u.login_date,
|
|
|
|
|
u.create_by,
|
|
|
|
|
u.create_time,
|
|
|
|
|
u.remark,
|
|
|
|
|
d.dept_name,
|
|
|
|
|
d.leader,
|
|
|
|
|
u.station_code,
|
|
|
|
|
u.team_code,
|
|
|
|
|
tm.team_name,
|
|
|
|
|
pl.PRODUCT_LINE_NAME station_name
|
|
|
|
|
from sys_user u
|
|
|
|
|
left join sys_dept d on u.dept_id = d.dept_id
|
|
|
|
|
left join BASE_PRODUCTLINE pl on pl.PRODUCT_LINE_CODE = u.station_code
|
|
|
|
|
left join BASE_PRODUCTLINE pl on pl.PRODUCT_LINE_CODE = u.station_code
|
|
|
|
|
left join BASE_TEAMMEMBERS tm on tm.TEAM_CODE = u.TEAM_CODE
|
|
|
|
|
where u.del_flag = '0'
|
|
|
|
|
<if test="userId != null and userId != 0">
|
|
|
|
|
AND u.user_id = #{userId}
|
|
|
|
@ -165,6 +219,8 @@
|
|
|
|
|
<if test="createBy != null and createBy != ''">create_by,</if>
|
|
|
|
|
<if test="remark != null and remark != ''">remark,</if>
|
|
|
|
|
<if test="stationCode != null and stationCode != ''">station_code,</if>
|
|
|
|
|
<if test="teamCode != null and teamCode != ''">team_code,</if>
|
|
|
|
|
<if test="teamName != null and teamName != ''">team_name,</if>
|
|
|
|
|
create_time
|
|
|
|
|
)values(
|
|
|
|
|
<if test="userId != null and userId != ''">#{userId},</if>
|
|
|
|
@ -180,6 +236,8 @@
|
|
|
|
|
<if test="createBy != null and createBy != ''">#{createBy},</if>
|
|
|
|
|
<if test="remark != null and remark != ''">#{remark},</if>
|
|
|
|
|
<if test="stationCode != null and stationCode != ''">#{stationCode},</if>
|
|
|
|
|
<if test="teamCode != null and teamCode != ''">#{teamCode},</if>
|
|
|
|
|
<if test="teamName != null and teamName != ''">#{teamName},</if>
|
|
|
|
|
sysdate
|
|
|
|
|
)
|
|
|
|
|
</insert>
|
|
|
|
@ -201,6 +259,8 @@
|
|
|
|
|
<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
|
|
|
|
|
<if test="remark != null">remark = #{remark},</if>
|
|
|
|
|
<if test="stationCode != null and stationCode != ''">station_code = #{stationCode},</if>
|
|
|
|
|
<if test="teamCode != null and teamCode != ''">team_code = #{teamCode},</if>
|
|
|
|
|
<if test="teamName != null and teamName != ''">team_name = #{teamName},</if>
|
|
|
|
|
update_time = sysdate
|
|
|
|
|
</set>
|
|
|
|
|
where user_id = #{userId}
|
|
|
|
|