40 lines
1.5 KiB
XML
40 lines
1.5 KiB
XML
|
<?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.spring.step2.mapper.UserMapper">
|
||
|
|
||
|
<!-- 通用查询映射结果 -->
|
||
|
<resultMap id="BaseResultMap" type="com.spring.step2.domain.entity.UserEntity">
|
||
|
<id column="id" property="id"/>
|
||
|
<id column="username" property="username"/>
|
||
|
<id column="password" property="password"/>
|
||
|
<id column="email" property="email"/>
|
||
|
<id column="create_time" property="createTime"/>
|
||
|
<id column="update_time" property="updateTime"/>
|
||
|
<id column="create_user" property="createUser"/>
|
||
|
<id column="update_user" property="updateUser"/>
|
||
|
<id column="is_deleted" property="isDeleted"/>
|
||
|
</resultMap>
|
||
|
|
||
|
<!-- 通用查询结果列 -->
|
||
|
<sql id="Base_Column_List">
|
||
|
id,username,password,email,create_time,update_time,create_user,update_user,is_deleted
|
||
|
</sql>
|
||
|
|
||
|
<!-- 分页查询用户内容 -->
|
||
|
<select id="selectListByPage" resultType="com.spring.step2.domain.vo.UserVo">
|
||
|
select
|
||
|
<include refid="Base_Column_List"/>
|
||
|
from t_user
|
||
|
<where>
|
||
|
is_deleted = 0
|
||
|
<if test="dto.username != null and dto.username != ''">
|
||
|
and username like CONCAT('%',#{dto.username},'%')
|
||
|
</if>
|
||
|
<if test="dto.email != null and dto.email != ''">
|
||
|
and email like CONCAT('%',#{dto.email},'%')
|
||
|
</if>
|
||
|
</where>
|
||
|
</select>
|
||
|
|
||
|
</mapper>
|