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.TitleDefinition;
|
|
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 TitleDefinitionMapper extends BaseMapper<TitleDefinition> {
|
|
|
|
/**
|
|
* 获取所有启用的称号
|
|
*/
|
|
@Select("SELECT * FROM title_definition WHERE enabled = 1 ORDER BY sort_order, id")
|
|
List<TitleDefinition> selectAllEnabled();
|
|
|
|
/**
|
|
* 根据代码获取称号
|
|
*/
|
|
@Select("SELECT * FROM title_definition WHERE title_code = #{titleCode} AND enabled = 1")
|
|
TitleDefinition selectByCode(@Param("titleCode") String titleCode);
|
|
|
|
/**
|
|
* 按分类获取称号
|
|
*/
|
|
@Select("SELECT * FROM title_definition WHERE category = #{category} AND enabled = 1 ORDER BY sort_order")
|
|
List<TitleDefinition> selectByCategory(@Param("category") String category);
|
|
}
|
|
|