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 { /** * 获取所有启用的称号 */ @Select("SELECT * FROM title_definition WHERE enabled = 1 ORDER BY sort_order, id") List 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 selectByCategory(@Param("category") String category); }