serv-初始mapper
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
package org.xyzh.usercenter.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.xyzh.common.dto.usercenter.TbAchievement;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @description 成就数据访问层
|
||||
* @filename AchievementMapper.java
|
||||
* @author system
|
||||
* @copyright xyzh
|
||||
* @since 2025-10-15
|
||||
*/
|
||||
@Mapper
|
||||
public interface AchievementMapper extends BaseMapper<TbAchievement> {
|
||||
|
||||
/**
|
||||
* @description 查询成就列表
|
||||
* @param filter 过滤条件
|
||||
* @return List<TbAchievement> 成就列表
|
||||
* @author system
|
||||
* @since 2025-10-15
|
||||
*/
|
||||
List<TbAchievement> selectAchievements(TbAchievement filter);
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
package org.xyzh.usercenter.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.xyzh.common.dto.usercenter.TbPointsRecord;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @description 积分记录数据访问层
|
||||
* @filename PointsRecordMapper.java
|
||||
* @author system
|
||||
* @copyright xyzh
|
||||
* @since 2025-10-15
|
||||
*/
|
||||
@Mapper
|
||||
public interface PointsRecordMapper extends BaseMapper<TbPointsRecord> {
|
||||
|
||||
/**
|
||||
* @description 查询积分记录列表
|
||||
* @param filter 过滤条件
|
||||
* @return List<TbPointsRecord> 积分记录列表
|
||||
* @author system
|
||||
* @since 2025-10-15
|
||||
*/
|
||||
List<TbPointsRecord> selectPointsRecords(TbPointsRecord filter);
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
package org.xyzh.usercenter.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.xyzh.common.dto.usercenter.TbUserAchievement;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @description 用户成就数据访问层
|
||||
* @filename UserAchievementMapper.java
|
||||
* @author system
|
||||
* @copyright xyzh
|
||||
* @since 2025-10-15
|
||||
*/
|
||||
@Mapper
|
||||
public interface UserAchievementMapper extends BaseMapper<TbUserAchievement> {
|
||||
|
||||
/**
|
||||
* @description 查询用户成就列表
|
||||
* @param filter 过滤条件
|
||||
* @return List<TbUserAchievement> 用户成就列表
|
||||
* @author system
|
||||
* @since 2025-10-15
|
||||
*/
|
||||
List<TbUserAchievement> selectUserAchievements(TbUserAchievement filter);
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
package org.xyzh.usercenter.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.xyzh.common.dto.usercenter.TbUserBrowseRecord;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @description 用户浏览记录数据访问层
|
||||
* @filename UserBrowseRecordMapper.java
|
||||
* @author system
|
||||
* @copyright xyzh
|
||||
* @since 2025-10-15
|
||||
*/
|
||||
@Mapper
|
||||
public interface UserBrowseRecordMapper extends BaseMapper<TbUserBrowseRecord> {
|
||||
|
||||
/**
|
||||
* @description 查询用户浏览记录列表
|
||||
* @param filter 过滤条件
|
||||
* @return List<TbUserBrowseRecord> 用户浏览记录列表
|
||||
* @author system
|
||||
* @since 2025-10-15
|
||||
*/
|
||||
List<TbUserBrowseRecord> selectUserBrowseRecords(TbUserBrowseRecord filter);
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
package org.xyzh.usercenter.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.xyzh.common.dto.usercenter.TbUserCollection;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @description 用户收藏数据访问层
|
||||
* @filename UserCollectionMapper.java
|
||||
* @author system
|
||||
* @copyright xyzh
|
||||
* @since 2025-10-15
|
||||
*/
|
||||
@Mapper
|
||||
public interface UserCollectionMapper extends BaseMapper<TbUserCollection> {
|
||||
|
||||
/**
|
||||
* @description 查询用户收藏列表
|
||||
* @param filter 过滤条件
|
||||
* @return List<TbUserCollection> 用户收藏列表
|
||||
* @author system
|
||||
* @since 2025-10-15
|
||||
*/
|
||||
List<TbUserCollection> selectUserCollections(TbUserCollection filter);
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
package org.xyzh.usercenter.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.xyzh.common.dto.usercenter.TbUserPoints;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @description 用户积分数据访问层
|
||||
* @filename UserPointsMapper.java
|
||||
* @author system
|
||||
* @copyright xyzh
|
||||
* @since 2025-10-15
|
||||
*/
|
||||
@Mapper
|
||||
public interface UserPointsMapper extends BaseMapper<TbUserPoints> {
|
||||
|
||||
/**
|
||||
* @description 查询用户积分列表
|
||||
* @param filter 过滤条件
|
||||
* @return List<TbUserPoints> 用户积分列表
|
||||
* @author system
|
||||
* @since 2025-10-15
|
||||
*/
|
||||
List<TbUserPoints> selectUserPoints(TbUserPoints filter);
|
||||
}
|
||||
@@ -0,0 +1,64 @@
|
||||
<?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="org.xyzh.usercenter.mapper.AchievementMapper">
|
||||
|
||||
<!-- 基础结果映射 -->
|
||||
<resultMap id="BaseResultMap" type="org.xyzh.common.dto.usercenter.TbAchievement">
|
||||
<id column="id" property="id" jdbcType="VARCHAR"/>
|
||||
<result column="achievement_id" property="achievementID" jdbcType="VARCHAR"/>
|
||||
<result column="name" property="name" jdbcType="VARCHAR"/>
|
||||
<result column="description" property="description" jdbcType="VARCHAR"/>
|
||||
<result column="icon" property="icon" jdbcType="VARCHAR"/>
|
||||
<result column="type" property="type" jdbcType="INTEGER"/>
|
||||
<result column="level" property="level" jdbcType="INTEGER"/>
|
||||
<result column="condition_type" property="conditionType" jdbcType="INTEGER"/>
|
||||
<result column="condition_value" property="conditionValue" jdbcType="INTEGER"/>
|
||||
<result column="points" property="points" jdbcType="INTEGER"/>
|
||||
<result column="order_num" property="orderNum" jdbcType="INTEGER"/>
|
||||
<result column="creator" property="creator" jdbcType="VARCHAR"/>
|
||||
<result column="updater" property="updater" jdbcType="VARCHAR"/>
|
||||
<result column="create_time" property="createTime" jdbcType="TIMESTAMP"/>
|
||||
<result column="update_time" property="updateTime" jdbcType="TIMESTAMP"/>
|
||||
<result column="delete_time" property="deleteTime" jdbcType="TIMESTAMP"/>
|
||||
<result column="deleted" property="deleted" jdbcType="BOOLEAN"/>
|
||||
</resultMap>
|
||||
|
||||
<!-- 基础字段 -->
|
||||
<sql id="Base_Column_List">
|
||||
id, achievement_id, name, description, icon, type, level, condition_type,
|
||||
condition_value, points, order_num, creator, updater, create_time,
|
||||
update_time, delete_time, deleted
|
||||
</sql>
|
||||
|
||||
<!-- 通用条件 -->
|
||||
<sql id="Where_Clause">
|
||||
<where>
|
||||
deleted = 0
|
||||
<if test="achievementID != null and achievementID != ''">
|
||||
AND achievement_id = #{achievementID}
|
||||
</if>
|
||||
<if test="name != null and name != ''">
|
||||
AND name LIKE CONCAT('%', #{name}, '%')
|
||||
</if>
|
||||
<if test="type != null">
|
||||
AND type = #{type}
|
||||
</if>
|
||||
<if test="level != null">
|
||||
AND level = #{level}
|
||||
</if>
|
||||
<if test="conditionType != null">
|
||||
AND condition_type = #{conditionType}
|
||||
</if>
|
||||
</where>
|
||||
</sql>
|
||||
|
||||
<!-- selectAchievements -->
|
||||
<select id="selectAchievements" resultMap="BaseResultMap">
|
||||
SELECT
|
||||
<include refid="Base_Column_List"/>
|
||||
FROM tb_achievement
|
||||
<include refid="Where_Clause"/>
|
||||
ORDER BY order_num ASC, create_time ASC
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,49 @@
|
||||
<?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="org.xyzh.usercenter.mapper.PointsRecordMapper">
|
||||
|
||||
<!-- 基础结果映射 -->
|
||||
<resultMap id="BaseResultMap" type="org.xyzh.common.dto.usercenter.TbPointsRecord">
|
||||
<id column="id" property="id" jdbcType="VARCHAR"/>
|
||||
<result column="user_id" property="userID" jdbcType="VARCHAR"/>
|
||||
<result column="points" property="points" jdbcType="INTEGER"/>
|
||||
<result column="type" property="type" jdbcType="INTEGER"/>
|
||||
<result column="source_type" property="sourceType" jdbcType="INTEGER"/>
|
||||
<result column="source_id" property="sourceID" jdbcType="VARCHAR"/>
|
||||
<result column="description" property="description" jdbcType="VARCHAR"/>
|
||||
<result column="create_time" property="createTime" jdbcType="TIMESTAMP"/>
|
||||
</resultMap>
|
||||
|
||||
<!-- 基础字段 -->
|
||||
<sql id="Base_Column_List">
|
||||
id, user_id, points, type, source_type, source_id, description, create_time
|
||||
</sql>
|
||||
|
||||
<!-- 通用条件 -->
|
||||
<sql id="Where_Clause">
|
||||
<where>
|
||||
<if test="userID != null and userID != ''">
|
||||
AND user_id = #{userID}
|
||||
</if>
|
||||
<if test="type != null">
|
||||
AND type = #{type}
|
||||
</if>
|
||||
<if test="sourceType != null">
|
||||
AND source_type = #{sourceType}
|
||||
</if>
|
||||
<if test="sourceID != null and sourceID != ''">
|
||||
AND source_id = #{sourceID}
|
||||
</if>
|
||||
</where>
|
||||
</sql>
|
||||
|
||||
<!-- selectPointsRecords -->
|
||||
<select id="selectPointsRecords" resultMap="BaseResultMap">
|
||||
SELECT
|
||||
<include refid="Base_Column_List"/>
|
||||
FROM tb_points_record
|
||||
<include refid="Where_Clause"/>
|
||||
ORDER BY create_time DESC
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,39 @@
|
||||
<?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="org.xyzh.usercenter.mapper.UserAchievementMapper">
|
||||
|
||||
<!-- 基础结果映射 -->
|
||||
<resultMap id="BaseResultMap" type="org.xyzh.common.dto.usercenter.TbUserAchievement">
|
||||
<id column="id" property="id" jdbcType="VARCHAR"/>
|
||||
<result column="user_id" property="userID" jdbcType="VARCHAR"/>
|
||||
<result column="achievement_id" property="achievementID" jdbcType="VARCHAR"/>
|
||||
<result column="obtain_time" property="obtainTime" jdbcType="TIMESTAMP"/>
|
||||
</resultMap>
|
||||
|
||||
<!-- 基础字段 -->
|
||||
<sql id="Base_Column_List">
|
||||
id, user_id, achievement_id, obtain_time
|
||||
</sql>
|
||||
|
||||
<!-- 通用条件 -->
|
||||
<sql id="Where_Clause">
|
||||
<where>
|
||||
<if test="userID != null and userID != ''">
|
||||
AND user_id = #{userID}
|
||||
</if>
|
||||
<if test="achievementID != null and achievementID != ''">
|
||||
AND achievement_id = #{achievementID}
|
||||
</if>
|
||||
</where>
|
||||
</sql>
|
||||
|
||||
<!-- selectUserAchievements -->
|
||||
<select id="selectUserAchievements" resultMap="BaseResultMap">
|
||||
SELECT
|
||||
<include refid="Base_Column_List"/>
|
||||
FROM tb_user_achievement
|
||||
<include refid="Where_Clause"/>
|
||||
ORDER BY obtain_time DESC
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,47 @@
|
||||
<?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="org.xyzh.usercenter.mapper.UserBrowseRecordMapper">
|
||||
|
||||
<!-- 基础结果映射 -->
|
||||
<resultMap id="BaseResultMap" type="org.xyzh.common.dto.usercenter.TbUserBrowseRecord">
|
||||
<id column="id" property="id" jdbcType="VARCHAR"/>
|
||||
<result column="user_id" property="userID" jdbcType="VARCHAR"/>
|
||||
<result column="browse_type" property="browseType" jdbcType="INTEGER"/>
|
||||
<result column="browse_id" property="browseID" jdbcType="VARCHAR"/>
|
||||
<result column="browse_time" property="browseTime" jdbcType="TIMESTAMP"/>
|
||||
<result column="ip_address" property="ipAddress" jdbcType="VARCHAR"/>
|
||||
</resultMap>
|
||||
|
||||
<!-- 基础字段 -->
|
||||
<sql id="Base_Column_List">
|
||||
id, user_id, browse_type, browse_id, browse_time, ip_address
|
||||
</sql>
|
||||
|
||||
<!-- 通用条件 -->
|
||||
<sql id="Where_Clause">
|
||||
<where>
|
||||
<if test="userID != null and userID != ''">
|
||||
AND user_id = #{userID}
|
||||
</if>
|
||||
<if test="browseType != null">
|
||||
AND browse_type = #{browseType}
|
||||
</if>
|
||||
<if test="browseID != null and browseID != ''">
|
||||
AND browse_id = #{browseID}
|
||||
</if>
|
||||
<if test="ipAddress != null and ipAddress != ''">
|
||||
AND ip_address = #{ipAddress}
|
||||
</if>
|
||||
</where>
|
||||
</sql>
|
||||
|
||||
<!-- selectUserBrowseRecords -->
|
||||
<select id="selectUserBrowseRecords" resultMap="BaseResultMap">
|
||||
SELECT
|
||||
<include refid="Base_Column_List"/>
|
||||
FROM tb_user_browse_record
|
||||
<include refid="Where_Clause"/>
|
||||
ORDER BY browse_time DESC
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,43 @@
|
||||
<?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="org.xyzh.usercenter.mapper.UserCollectionMapper">
|
||||
|
||||
<!-- 基础结果映射 -->
|
||||
<resultMap id="BaseResultMap" type="org.xyzh.common.dto.usercenter.TbUserCollection">
|
||||
<id column="id" property="id" jdbcType="VARCHAR"/>
|
||||
<result column="user_id" property="userID" jdbcType="VARCHAR"/>
|
||||
<result column="collection_type" property="collectionType" jdbcType="INTEGER"/>
|
||||
<result column="collection_id" property="collectionID" jdbcType="VARCHAR"/>
|
||||
<result column="create_time" property="createTime" jdbcType="TIMESTAMP"/>
|
||||
</resultMap>
|
||||
|
||||
<!-- 基础字段 -->
|
||||
<sql id="Base_Column_List">
|
||||
id, user_id, collection_type, collection_id, create_time
|
||||
</sql>
|
||||
|
||||
<!-- 通用条件 -->
|
||||
<sql id="Where_Clause">
|
||||
<where>
|
||||
<if test="userID != null and userID != ''">
|
||||
AND user_id = #{userID}
|
||||
</if>
|
||||
<if test="collectionType != null">
|
||||
AND collection_type = #{collectionType}
|
||||
</if>
|
||||
<if test="collectionID != null and collectionID != ''">
|
||||
AND collection_id = #{collectionID}
|
||||
</if>
|
||||
</where>
|
||||
</sql>
|
||||
|
||||
<!-- selectUserCollections -->
|
||||
<select id="selectUserCollections" resultMap="BaseResultMap">
|
||||
SELECT
|
||||
<include refid="Base_Column_List"/>
|
||||
FROM tb_user_collection
|
||||
<include refid="Where_Clause"/>
|
||||
ORDER BY create_time DESC
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,42 @@
|
||||
<?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="org.xyzh.usercenter.mapper.UserPointsMapper">
|
||||
|
||||
<!-- 基础结果映射 -->
|
||||
<resultMap id="BaseResultMap" type="org.xyzh.common.dto.usercenter.TbUserPoints">
|
||||
<id column="id" property="id" jdbcType="VARCHAR"/>
|
||||
<result column="user_id" property="userID" jdbcType="VARCHAR"/>
|
||||
<result column="total_points" property="totalPoints" jdbcType="INTEGER"/>
|
||||
<result column="current_points" property="currentPoints" jdbcType="INTEGER"/>
|
||||
<result column="level" property="level" jdbcType="INTEGER"/>
|
||||
<result column="create_time" property="createTime" jdbcType="TIMESTAMP"/>
|
||||
<result column="update_time" property="updateTime" jdbcType="TIMESTAMP"/>
|
||||
</resultMap>
|
||||
|
||||
<!-- 基础字段 -->
|
||||
<sql id="Base_Column_List">
|
||||
id, user_id, total_points, current_points, level, create_time, update_time
|
||||
</sql>
|
||||
|
||||
<!-- 通用条件 -->
|
||||
<sql id="Where_Clause">
|
||||
<where>
|
||||
<if test="userID != null and userID != ''">
|
||||
AND user_id = #{userID}
|
||||
</if>
|
||||
<if test="level != null">
|
||||
AND level = #{level}
|
||||
</if>
|
||||
</where>
|
||||
</sql>
|
||||
|
||||
<!-- selectUserPoints -->
|
||||
<select id="selectUserPoints" resultMap="BaseResultMap">
|
||||
SELECT
|
||||
<include refid="Base_Column_List"/>
|
||||
FROM tb_user_points
|
||||
<include refid="Where_Clause"/>
|
||||
ORDER BY level DESC, current_points DESC
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
Reference in New Issue
Block a user