package thyyxxk.webserver.dao.his.outpatient;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import thyyxxk.webserver.entity.login.UserInfo;
import thyyxxk.webserver.entity.outpatient.coupon.ZdCoupon;

import java.util.List;

@Mapper
public interface CouponManageDao extends BaseMapper<ZdCoupon> {

    @Select("select * from t_zd_coupons ${statement} order by create_time")
    List<ZdCoupon> selectAllCoupons(String statement);

    @Select("select code,rtrim(name) as name, " +
            "deptName=(select rtrim(d.name) from zd_unit_code d where d.code=a.dept_code) " +
            "from a_employee_mi a where code_rs=#{codeRs} and isnull(del_flag,'0')!='1' ")
    UserInfo selectSalesman(String codeRs);
}
