package com.pcloud.book.riddle.dao.impl;

import com.pcloud.book.riddle.dao.RiddleCouponDao;
import com.pcloud.book.riddle.dto.RiddleCouponDTO;
import com.pcloud.book.riddle.entity.RiddleCoupon;
import com.pcloud.common.core.dao.BaseDaoImpl;

import org.springframework.stereotype.Component;

/**
 * @描述：自定义优惠券
 * @作者：zhuyajie
 * @创建时间：10:24 2019/11/7
 * @版本：1.0
 */
@Component("riddleCouponDao")
public class RiddleCouponDaoImpl extends BaseDaoImpl<RiddleCoupon> implements RiddleCouponDao {


    @Override
    public RiddleCouponDTO getByAdviser(Long adviserId) {
        return getSessionTemplate().selectOne(getStatement("getByAdviser"), adviserId);
    }

    @Override
    public void deleteByAdviser(Long adviserId) {
        getSessionTemplate().delete(getStatement("deleteByAdviser"), adviserId);
    }
}
