2024-03-22 19:22:45 +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.atguigu.spzx.manger.mapper.SysUserMapper">
|
2024-03-22 21:05:56 +08:00
|
|
|
<!-- 用于select查询公用抽取的列 -->
|
|
|
|
<sql id="columns">
|
|
|
|
id,username userName ,password,name,phone,avatar,description,status,create_time,update_time,is_deleted
|
|
|
|
</sql>
|
2024-03-23 22:53:37 +08:00
|
|
|
|
|
|
|
<sql id="findPageWhere">
|
|
|
|
<where>
|
|
|
|
<if test="keyword != null and keyword != ''">
|
|
|
|
and username like CONCAT('%',#{keyword},'%')
|
|
|
|
</if>
|
|
|
|
<if test="createTimeBegin != null and createTimeBegin != ''">
|
|
|
|
and create_time >= #{createTimeBegin}
|
|
|
|
</if>
|
|
|
|
<if test="createTimeEnd != null and createTimeEnd != ''">
|
|
|
|
and create_time <= #{createTimeEnd}
|
|
|
|
</if>
|
|
|
|
and is_deleted = 0
|
|
|
|
</where>
|
|
|
|
</sql>
|
|
|
|
|
2024-03-22 21:05:56 +08:00
|
|
|
<!-- 根据username查询用户信息 -->
|
|
|
|
<select id="selectByUsername" resultType="com.atguigu.spzx.model.entity.system.SysUser">
|
|
|
|
select
|
|
|
|
<include refid="columns"/>
|
|
|
|
from sys_user
|
|
|
|
where username = #{username};
|
|
|
|
</select>
|
2024-03-23 22:53:37 +08:00
|
|
|
|
|
|
|
<!-- 查询用户 -->
|
|
|
|
<select id="findByPage" resultType="com.atguigu.spzx.model.entity.system.SysUser">
|
|
|
|
select
|
|
|
|
<include refid="columns"/>
|
|
|
|
from sys_user
|
|
|
|
<include refid="findPageWhere"/>
|
|
|
|
order by id desc
|
|
|
|
</select>
|
2024-03-22 19:22:45 +08:00
|
|
|
</mapper>
|