You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
|
<?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.youlai.boot.mini.mapper.MiniPointAccountMapper">
|
|
|
|
|
|
|
|
|
|
<!-- 积分账户VO映射 -->
|
|
|
|
|
<resultMap id="PointAccountVOMap" type="com.youlai.boot.mini.model.vo.PointAccountVO">
|
|
|
|
|
<id property="id" column="id" />
|
|
|
|
|
<result property="uuid" column="uuid" />
|
|
|
|
|
<result property="userId" column="user_id" />
|
|
|
|
|
<result property="nickname" column="nickname" />
|
|
|
|
|
<result property="mobile" column="mobile" />
|
|
|
|
|
<result property="avatar" column="avatar" />
|
|
|
|
|
<result property="points" column="points" />
|
|
|
|
|
<result property="createTime" column="create_time" />
|
|
|
|
|
<result property="updateTime" column="update_time" />
|
|
|
|
|
</resultMap>
|
|
|
|
|
|
|
|
|
|
<!-- 分页查询用户积分账户(关联用户表) -->
|
|
|
|
|
<select id="pageAccount" resultMap="PointAccountVOMap">
|
|
|
|
|
SELECT
|
|
|
|
|
a.id,
|
|
|
|
|
a.uuid,
|
|
|
|
|
a.user_id,
|
|
|
|
|
u.nickname,
|
|
|
|
|
u.mobile,
|
|
|
|
|
u.avatar,
|
|
|
|
|
a.points,
|
|
|
|
|
a.create_time,
|
|
|
|
|
a.update_time
|
|
|
|
|
FROM
|
|
|
|
|
mini_point_account a
|
|
|
|
|
LEFT JOIN sys_user u ON a.user_id = u.id
|
|
|
|
|
WHERE
|
|
|
|
|
a.is_deleted = 0
|
|
|
|
|
AND u.is_deleted = 0
|
|
|
|
|
<if test="query.userId != null">
|
|
|
|
|
AND a.user_id = #{query.userId}
|
|
|
|
|
</if>
|
|
|
|
|
<if test="query.keyword != null and query.keyword != ''">
|
|
|
|
|
AND (u.nickname LIKE CONCAT('%', #{query.keyword}, '%') OR u.mobile LIKE CONCAT('%', #{query.keyword}, '%'))
|
|
|
|
|
</if>
|
|
|
|
|
ORDER BY
|
|
|
|
|
a.create_time DESC
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
</mapper>
|