Files
wms-admin/wms-module-system/src/main/resources/mapper/UserMapper.xml

56 lines
1.6 KiB
XML
Raw Normal View History

2026-02-27 10:16:46 +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" >
2026-02-27 10:50:07 +08:00
<mapper namespace="top.wms.admin.system.mapper.UserMapper">
2026-02-27 10:16:46 +08:00
<sql id="selectUser">
SELECT
t1.id,
t1.create_user,
t1.create_time,
t1.update_user,
t1.update_time,
t1.username,
t1.nickname,
t1.password,
t1.gender,
t1.email,
t1.phone,
t1.avatar,
t1.description,
t1.status,
t1.is_system,
t1.pwd_reset_time,
t1.dept_id,
t2.name AS deptName
FROM sys_user AS t1
LEFT JOIN sys_dept AS t2 ON t2.id = t1.dept_id
</sql>
2026-02-27 10:50:07 +08:00
<select id="selectUserPage" resultType="top.wms.admin.system.model.resp.user.UserDetailResp">
2026-02-27 10:16:46 +08:00
<include refid="selectUser" />
${ew.customSqlSegment}
</select>
2026-02-27 10:50:07 +08:00
<select id="selectUserList" resultType="top.wms.admin.system.model.resp.user.UserDetailResp">
2026-02-27 10:16:46 +08:00
<include refid="selectUser" />
${ew.customSqlSegment}
</select>
<select id="selectCountByEmail" resultType="java.lang.Long">
SELECT count(*)
FROM sys_user
WHERE email = #{email}
<if test="id != null">
AND id != #{id}
</if>
</select>
<select id="selectCountByPhone" resultType="java.lang.Long">
SELECT count(*)
FROM sys_user
WHERE phone = #{phone}
<if test="id != null">
AND id != #{id}
</if>
</select>
</mapper>