package com.yc.ship.module.trade.dal.mysql.order;



import com.yc.ship.framework.mybatis.core.mapper.BaseMapperX;
import com.yc.ship.framework.mybatis.core.query.LambdaQueryWrapperX;
import com.yc.ship.module.trade.dal.dataobject.order.TradeCheckDetailDO;
import org.apache.ibatis.annotations.Mapper;

/**
 * 子票核销记录 Mapper
 *
 * @author 管理员
 */
@Mapper
public interface TradeCheckDetailMapper extends BaseMapperX<TradeCheckDetailDO> {

    default Long getCheckDetailByVoucherAndChannel( Long detailBaseId,Long channelId){

        return selectCount(new LambdaQueryWrapperX<TradeCheckDetailDO>()
                .eq(TradeCheckDetailDO::getDetailBaseId,detailBaseId)
                .eq(TradeCheckDetailDO::getChannelId,channelId)
        );
    }
}
