2021-07-19 18:38:42 +08:00
|
|
|
<?xml version="1.0" encoding="UTF-8" ?>
|
|
|
|
|
<!DOCTYPE mapper
|
|
|
|
|
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
|
|
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
|
|
|
|
<mapper namespace="com.xhpc.user.mapper.XhpcUserMapper">
|
|
|
|
|
|
2021-07-28 18:07:25 +08:00
|
|
|
<resultMap type="com.xhpc.system.api.domain.SysUser" id="XhpcUserResult">
|
2021-07-19 18:38:42 +08:00
|
|
|
<result column="user_id" property="userId"/>
|
|
|
|
|
<result column="dept_id" property="deptId"/>
|
|
|
|
|
<result column="user_name" property="userName"/>
|
2021-07-21 18:56:48 +08:00
|
|
|
<result column="user_type" property="userType"/>
|
2021-07-19 18:38:42 +08:00
|
|
|
<result column="nick_name" property="nickName"/>
|
|
|
|
|
<result column="email" property="email"/>
|
|
|
|
|
<result column="phonenumber" property="phonenumber"/>
|
|
|
|
|
<result column="operator_id" property="operatorId"/>
|
2021-07-20 15:55:12 +08:00
|
|
|
<result column="internet_user_id" property="internetUserId"/>
|
2021-07-19 18:38:42 +08:00
|
|
|
<result column="sex" property="sex"/>
|
|
|
|
|
<result column="avatar" property="avatar"/>
|
|
|
|
|
<result column="password" property="password"/>
|
|
|
|
|
<result column="data_power_type" property="dataPowerType"/>
|
|
|
|
|
<result column="status" property="status"/>
|
|
|
|
|
<result column="del_flag" property="delFlag"/>
|
|
|
|
|
<result column="login_ip" property="loginIp"/>
|
|
|
|
|
<result column="login_date" property="loginDate"/>
|
|
|
|
|
<result column="create_by" property="createBy"/>
|
|
|
|
|
<result column="create_time" property="createTime"/>
|
|
|
|
|
<result column="update_by" property="updateBy"/>
|
|
|
|
|
<result column="update_time" property="updateTime"/>
|
|
|
|
|
<result column="remark" property="remark"/>
|
|
|
|
|
</resultMap>
|
|
|
|
|
|
2021-07-28 18:07:25 +08:00
|
|
|
<update id="update" parameterType="com.xhpc.system.api.domain.SysUser">
|
2021-07-19 18:38:42 +08:00
|
|
|
UPDATE sys_user
|
|
|
|
|
<set>
|
|
|
|
|
<if test="null != deptId and '' != deptId">dept_id = #{deptId},</if>
|
|
|
|
|
<if test="null != userName and '' != userName">user_name = #{userName},</if>
|
|
|
|
|
<if test="null != nickName and '' != nickName">nick_name = #{nickName},</if>
|
|
|
|
|
<if test="null != userType and '' != userType">user_type = #{userType},</if>
|
|
|
|
|
<if test="null != email and '' != email">email = #{email},</if>
|
|
|
|
|
<if test="null != phonenumber and '' != phonenumber">phonenumber = #{phonenumber},</if>
|
|
|
|
|
<if test="null != operatorId and '' != operatorId">operator_id = #{operatorId},</if>
|
|
|
|
|
<if test="null != sex and '' != sex">sex = #{sex},</if>
|
|
|
|
|
<if test="null != avatar and '' != avatar">avatar = #{avatar},</if>
|
|
|
|
|
<if test="null != password and '' != password">password = #{password},</if>
|
|
|
|
|
<if test="null != dataPowerType and '' != dataPowerType">data_power_type = #{dataPowerType},</if>
|
2021-07-27 18:38:32 +08:00
|
|
|
<if test="null != status">status = #{status},</if>
|
2021-07-19 18:38:42 +08:00
|
|
|
<if test="null != delFlag and '' != delFlag">del_flag = #{delFlag},</if>
|
|
|
|
|
<if test="null != loginIp and '' != loginIp">login_ip = #{loginIp},</if>
|
|
|
|
|
<if test="null != loginDate and '' != loginDate">login_date = #{loginDate},</if>
|
|
|
|
|
<if test="null != createBy and '' != createBy">create_by = #{createBy},</if>
|
2021-07-22 16:02:30 +08:00
|
|
|
<if test="null != createTime ">create_time = #{createTime},</if>
|
2021-07-19 18:38:42 +08:00
|
|
|
<if test="null != updateBy and '' != updateBy">update_by = #{updateBy},</if>
|
2021-07-22 16:02:30 +08:00
|
|
|
<if test="null != updateTime ">update_time = #{updateTime},</if>
|
2021-07-19 18:38:42 +08:00
|
|
|
<if test="null != remark and '' != remark">remark = #{remark}</if>
|
|
|
|
|
</set>
|
|
|
|
|
WHERE user_id = #{userId}
|
|
|
|
|
</update>
|
|
|
|
|
|
|
|
|
|
<delete id="deleteByIds" parameterType="java.lang.Long">
|
|
|
|
|
delete from sys_user where user_id in
|
|
|
|
|
<foreach collection="array" item="userId" open="(" separator="," close=")">
|
|
|
|
|
#{userId}
|
|
|
|
|
</foreach>
|
|
|
|
|
</delete>
|
|
|
|
|
|
|
|
|
|
|
2021-07-21 18:56:48 +08:00
|
|
|
<select id="selectUserByUserId" parameterType="java.lang.Long" resultMap="XhpcUserResult">
|
2021-07-19 18:38:42 +08:00
|
|
|
select *
|
|
|
|
|
from sys_user
|
|
|
|
|
where user_id = #{userId}
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
<select id="selectPcUserList" parameterType="java.lang.String" resultType="java.util.Map">
|
|
|
|
|
select user_id userId,user_name userName,
|
|
|
|
|
nick_name nickName, email,
|
|
|
|
|
create_by createBy ,create_time createTime
|
|
|
|
|
from sys_user
|
2021-07-21 18:56:48 +08:00
|
|
|
WHERE del_flag = 0 and user_type = '00'
|
2021-07-19 18:38:42 +08:00
|
|
|
<if test="userName != null and userName != ''">
|
|
|
|
|
and user_name like concat(concat('%', #{userName}), '%')
|
|
|
|
|
</if>
|
|
|
|
|
<if test="nickName != null and nickName != ''">
|
|
|
|
|
and nick_name like concat(concat('%', #{nickName}), '%')
|
|
|
|
|
</if>
|
2021-07-20 15:55:12 +08:00
|
|
|
ORDER BY update_time DESC
|
2021-07-19 18:38:42 +08:00
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
<select id="pcInfo" parameterType="java.lang.Long" resultType="java.util.Map">
|
|
|
|
|
select su.user_id userId,su.user_name userName,
|
|
|
|
|
su.nick_name nickName, su.email,
|
|
|
|
|
su.create_by createBy ,su.create_time createTime,su.`status` ,
|
|
|
|
|
CASE WHEN su.`status` = 0 THEN '正常' else '禁用' end statusName,
|
|
|
|
|
sdd.dict_label sexName
|
|
|
|
|
from sys_user su
|
|
|
|
|
LEFT JOIN sys_dict_data sdd on sdd.`dict_type` = "sys_user_sex" and sdd.dict_code = su.sex
|
|
|
|
|
WHERE su.del_flag = 0 and user_id = #{userId}
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
<select id="selectOperatorUserList" parameterType="java.lang.String" resultType="java.util.Map">
|
|
|
|
|
select su.user_id userId,su.user_name userName,
|
|
|
|
|
su.nick_name nickName, su.email,
|
|
|
|
|
su.create_by createBy ,su.create_time createTime,
|
|
|
|
|
xo.`name` operatorName,su.`status` ,
|
|
|
|
|
CASE WHEN su.`status` = 0 THEN '正常' else '禁用' end statusName
|
|
|
|
|
from sys_user su
|
|
|
|
|
LEFT JOIN xhpc_operator xo on xo.operator_id = su.operator_id
|
2021-07-21 18:56:48 +08:00
|
|
|
WHERE su.del_flag = 0 and user_type = '03'
|
2021-07-19 18:38:42 +08:00
|
|
|
<if test="userName != null and userName != ''">
|
|
|
|
|
and user_name like concat(concat('%', #{userName}), '%')
|
|
|
|
|
</if>
|
|
|
|
|
<if test="nickName != null and nickName != ''">
|
|
|
|
|
and nick_name like concat(concat('%', #{nickName}), '%')
|
|
|
|
|
</if>
|
|
|
|
|
<if test="operatorId != null and operatorId != ''">
|
|
|
|
|
and operator_id = #{operatorId}
|
|
|
|
|
</if>
|
|
|
|
|
<if test="createBy != null and createBy != ''">
|
|
|
|
|
and create_by = #{createBy}
|
|
|
|
|
</if>
|
2021-07-20 15:55:12 +08:00
|
|
|
ORDER BY su.update_time DESC
|
2021-07-19 18:38:42 +08:00
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
<select id="operatorInfo" parameterType="java.lang.Long" resultType="java.util.Map">
|
|
|
|
|
select su.user_id userId,su.user_name userName,
|
2021-07-21 18:56:48 +08:00
|
|
|
su.nick_name nickName, su.email,su.sex,
|
|
|
|
|
su.create_by createBy ,su.create_time createTime,xo.operator_id operatorId,
|
2021-07-19 18:38:42 +08:00
|
|
|
xo.`name` operatorName,su.`status` ,
|
|
|
|
|
CASE WHEN su.`status` = 0 THEN '正常' else '禁用' end statusName,
|
|
|
|
|
sdd.dict_label sexName
|
|
|
|
|
from sys_user su
|
|
|
|
|
LEFT JOIN xhpc_operator xo on xo.operator_id = su.operator_id
|
|
|
|
|
LEFT JOIN sys_dict_data sdd on sdd.`dict_type` = "sys_user_sex" and sdd.dict_code = su.sex
|
|
|
|
|
WHERE su.del_flag = 0 and user_id = #{userId}
|
|
|
|
|
</select>
|
2021-07-26 18:02:59 +08:00
|
|
|
|
2021-07-28 18:07:25 +08:00
|
|
|
<select id="selectUserByUserName" parameterType="java.lang.String" resultType="com.xhpc.system.api.domain.SysUser">
|
|
|
|
|
select user_id userId,
|
|
|
|
|
dept_id deptid,
|
|
|
|
|
user_name userName,
|
|
|
|
|
nick_name nickName,
|
|
|
|
|
user_type userType,
|
|
|
|
|
email,
|
|
|
|
|
phonenumber,
|
|
|
|
|
operator_id operatorId,
|
|
|
|
|
internet_user_id internetUserId,
|
|
|
|
|
sex,
|
|
|
|
|
avatar,
|
|
|
|
|
password,
|
|
|
|
|
data_power_type dataPowerType,
|
|
|
|
|
status,
|
|
|
|
|
del_flag delFlag,
|
|
|
|
|
login_ip loginIp,
|
|
|
|
|
login_date loginDate,
|
|
|
|
|
create_by createBy,
|
|
|
|
|
create_time createTime,
|
|
|
|
|
update_by updateBy,
|
|
|
|
|
update_time updateTime,
|
|
|
|
|
remark
|
|
|
|
|
from sys_user
|
2021-07-26 18:02:59 +08:00
|
|
|
where user_name = #{userName}
|
|
|
|
|
</select>
|
2021-07-28 18:07:25 +08:00
|
|
|
</mapper>
|