package com.erp.print.repository;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.erp.print.entity.PrintConfig;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

@Mapper
public interface PrintConfigRepository extends BaseMapper<PrintConfig> {

    @Select("SELECT * FROM print_config WHERE deleted = 0 AND config_key = #{configKey}")
    PrintConfig selectByConfigKey(@Param("configKey") String configKey);

    @Select("SELECT * FROM print_config WHERE deleted = 0 AND config_type = #{configType} AND relation_id = #{relationId}")
    PrintConfig selectByTypeAndRelation(@Param("configType") String configType, @Param("relationId") Long relationId);
}
