feat: 新增前台业务数据访问层Mapper

- 新增HrtUserMapper前台用户数据访问接口
- 新增HrtHeritageMapper非遗项目数据访问接口
- 新增HrtInheritorMapper传承人数据访问接口
- 新增HrtNewsMapper新闻资讯数据访问接口
- 新增HrtEventMapper活动数据访问接口
- 新增HrtCommentMapper评论数据访问接口
- 新增HrtFavoriteMapper收藏数据访问接口
- 新增HrtLikeMapper点赞数据访问接口
- 新增HrtViewHistoryMapper浏览历史数据访问接口
- 新增HrtEventRegistrationMapper活动报名数据访问接口
- 所有Mapper继承BaseMapper,支持CRUD基础操作
This commit is contained in:
Leo 2025-10-13 20:35:58 +08:00
parent d082e2f830
commit 7bf017b03f
10 changed files with 174 additions and 0 deletions

View File

@ -0,0 +1,14 @@
package org.leocoder.heritage.mybatisplus.mapper.portal;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.leocoder.heritage.domain.pojo.portal.HrtComment;
/**
* @author Leocoder
* @description [评论Mapper接口]
*/
@Mapper
public interface HrtCommentMapper extends BaseMapper<HrtComment> {
}

View File

@ -0,0 +1,14 @@
package org.leocoder.heritage.mybatisplus.mapper.portal;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.leocoder.heritage.domain.pojo.portal.HrtEvent;
/**
* @author Leocoder
* @description [活动Mapper接口]
*/
@Mapper
public interface HrtEventMapper extends BaseMapper<HrtEvent> {
}

View File

@ -0,0 +1,14 @@
package org.leocoder.heritage.mybatisplus.mapper.portal;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.leocoder.heritage.domain.pojo.portal.HrtEventRegistration;
/**
* @author Leocoder
* @description [活动报名Mapper接口]
*/
@Mapper
public interface HrtEventRegistrationMapper extends BaseMapper<HrtEventRegistration> {
}

View File

@ -0,0 +1,31 @@
package org.leocoder.heritage.mybatisplus.mapper.portal;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import org.leocoder.heritage.domain.pojo.portal.HrtFavorite;
/**
* @author Leocoder
* @description [收藏Mapper接口]
*/
@Mapper
public interface HrtFavoriteMapper extends BaseMapper<HrtFavorite> {
/**
* @description [查询逻辑删除的收藏记录绕过@TableLogic过滤]
* @author Leocoder
*/
@Select("SELECT * FROM hrt_favorite WHERE user_id = #{userId} AND target_type = #{targetType} AND target_id = #{targetId} AND del_flag = 0 LIMIT 1")
HrtFavorite selectDeletedOne(@Param("userId") Long userId, @Param("targetType") String targetType, @Param("targetId") Long targetId);
/**
* @description [恢复逻辑删除的收藏记录绕过@TableLogic过滤]
* @author Leocoder
*/
@Update("UPDATE hrt_favorite SET del_flag = 1 WHERE id = #{id} AND del_flag = 0")
int restoreDeleted(@Param("id") Long id);
}

View File

@ -0,0 +1,14 @@
package org.leocoder.heritage.mybatisplus.mapper.portal;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.leocoder.heritage.domain.pojo.portal.HrtHeritage;
/**
* @author Leocoder
* @description [非遗项目Mapper接口]
*/
@Mapper
public interface HrtHeritageMapper extends BaseMapper<HrtHeritage> {
}

View File

@ -0,0 +1,14 @@
package org.leocoder.heritage.mybatisplus.mapper.portal;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.leocoder.heritage.domain.pojo.portal.HrtInheritor;
/**
* @author Leocoder
* @description [传承人Mapper接口]
*/
@Mapper
public interface HrtInheritorMapper extends BaseMapper<HrtInheritor> {
}

View File

@ -0,0 +1,31 @@
package org.leocoder.heritage.mybatisplus.mapper.portal;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import org.leocoder.heritage.domain.pojo.portal.HrtLike;
/**
* @author Leocoder
* @description [点赞Mapper接口]
*/
@Mapper
public interface HrtLikeMapper extends BaseMapper<HrtLike> {
/**
* @description [查询逻辑删除的点赞记录绕过@TableLogic过滤]
* @author Leocoder
*/
@Select("SELECT * FROM hrt_like WHERE user_id = #{userId} AND target_type = #{targetType} AND target_id = #{targetId} AND del_flag = 0 LIMIT 1")
HrtLike selectDeletedOne(@Param("userId") Long userId, @Param("targetType") String targetType, @Param("targetId") Long targetId);
/**
* @description [恢复逻辑删除的点赞记录绕过@TableLogic过滤]
* @author Leocoder
*/
@Update("UPDATE hrt_like SET del_flag = 1 WHERE id = #{id} AND del_flag = 0")
int restoreDeleted(@Param("id") Long id);
}

View File

@ -0,0 +1,14 @@
package org.leocoder.heritage.mybatisplus.mapper.portal;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.leocoder.heritage.domain.pojo.portal.HrtNews;
/**
* @author Leocoder
* @description [新闻资讯Mapper接口]
*/
@Mapper
public interface HrtNewsMapper extends BaseMapper<HrtNews> {
}

View File

@ -0,0 +1,14 @@
package org.leocoder.heritage.mybatisplus.mapper.portal;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.leocoder.heritage.domain.pojo.portal.HrtUser;
/**
* @author Leocoder
* @description [前台用户Mapper接口]
*/
@Mapper
public interface HrtUserMapper extends BaseMapper<HrtUser> {
}

View File

@ -0,0 +1,14 @@
package org.leocoder.heritage.mybatisplus.mapper.portal;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.leocoder.heritage.domain.pojo.portal.HrtViewHistory;
/**
* @author Leocoder
* @description [浏览历史Mapper接口]
*/
@Mapper
public interface HrtViewHistoryMapper extends BaseMapper<HrtViewHistory> {
}