36 lines
1.0 KiB
Java
36 lines
1.0 KiB
Java
package com.designhub.mapper;
|
|
|
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
|
import com.designhub.entity.BadgeDefinition;
|
|
import org.apache.ibatis.annotations.Mapper;
|
|
import org.apache.ibatis.annotations.Param;
|
|
import org.apache.ibatis.annotations.Select;
|
|
|
|
import java.util.List;
|
|
|
|
/**
|
|
* 徽章定义Mapper
|
|
*/
|
|
@Mapper
|
|
public interface BadgeDefinitionMapper extends BaseMapper<BadgeDefinition> {
|
|
|
|
/**
|
|
* 获取所有启用的徽章
|
|
*/
|
|
@Select("SELECT * FROM badge_definition WHERE enabled = 1 ORDER BY sort_order, id")
|
|
List<BadgeDefinition> selectAllEnabled();
|
|
|
|
/**
|
|
* 根据代码获取徽章
|
|
*/
|
|
@Select("SELECT * FROM badge_definition WHERE badge_code = #{badgeCode} AND enabled = 1")
|
|
BadgeDefinition selectByCode(@Param("badgeCode") String badgeCode);
|
|
|
|
/**
|
|
* 按分类获取徽章
|
|
*/
|
|
@Select("SELECT * FROM badge_definition WHERE category = #{category} AND enabled = 1 ORDER BY sort_order")
|
|
List<BadgeDefinition> selectByCategory(@Param("category") String category);
|
|
}
|
|
|