Files
label_backend/src/main/java/com/label/mapper/SysConfigMapper.java

34 lines
1.8 KiB
Java
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

package com.label.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.label.entity.SysConfig;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import java.util.List;
/**
* sys_config 鐞?Mapper閵? *
* 濞夈劍鍓伴敍姝磞s_config 瀹告彃濮為崗?MybatisPlusConfig.IGNORED_TABLES閿涘奔绗夌挧鏉款樋缁夌喐鍩涙潻鍥ㄦ姢閸煉绱?
* 闂団偓閹靛濮╂导鐘插弳 companyId 鏉╂稖顢戞潻鍥ㄦ姢閵? */
@Mapper
public interface SysConfigMapper extends BaseMapper<SysConfig> {
/** 閺屻儴顕楅幐鍥х暰閸忣剙寰冮惃鍕帳缂冾噯绱欑粔鐔稿煕娑撴挸鐫橀敍灞肩喘閸忓牏楠囨姗堢礆 */
@Select("SELECT * FROM sys_config WHERE company_id = #{companyId} AND config_key = #{configKey}")
SysConfig selectByCompanyAndKey(@Param("companyId") Long companyId,
@Param("configKey") String configKey);
/** 閺屻儴顕楅崗銊ョ湰姒涙顓婚柊宥囩枂閿涘潏ompany_id IS NULL閿?*/
@Select("SELECT * FROM sys_config WHERE company_id IS NULL AND config_key = #{configKey}")
SysConfig selectGlobalByKey(@Param("configKey") String configKey);
/**
* 閺屻儴顕楅幐鍥х暰閸忣剙寰冮幍鈧張澶婂讲鐟欎線鍘ょ純顕嗙礄閸忣剙寰冩稉鎾崇潣 + 閸忋劌鐪妯款吇閿涘绱?
* 閹?company_id DESC NULLS LAST 閹烘帒绨敍鍫濆彆閸欓晲绗撶仦鐐扮喘閸忓牅绨崗銊ョ湰姒涙顓婚敍澶堚偓? */
@Select("SELECT * FROM sys_config WHERE company_id = #{companyId} OR company_id IS NULL " +
"ORDER BY company_id DESC NULLS LAST")
List<SysConfig> selectAllForCompany(@Param("companyId") Long companyId);
}