package cn.hnthyy.thmz.mapper.his.zd;

import cn.hnthyy.thmz.entity.his.zd.ZdChequeType;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface ZdChequeTypeMapper {
    /**
     * 查询所有门诊可用的付款方式
     * @return
     */
    @Select("select rtrim(code) code,rtrim(name) name,mz_flag,zy_flag from zd_cheque_type where mz_flag =0 or mz_flag is null ")
    List<ZdChequeType> selectAllZdChequeTypeForMz();

    /**
     * 查询所有住院可用的付款方式
     * @return
     */
    @Select("select rtrim(code) code,rtrim(name) name,mz_flag,zy_flag from zd_cheque_type where zy_flag =0 or zy_flag is null")
    List<ZdChequeType> selectAllZdChequeTypeForZy();

    /**
     * 按照支付方式编码查询支付方式
     * @param code
     * @return
     */
    @Select("select rtrim(code) code,rtrim(name) name,mz_flag,zy_flag from zd_cheque_type where code =#{code}")
    ZdChequeType selectChequeTypeByCode(@Param("code") String code);
}
