package com.jeequan.jeepay.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.jeequan.jeepay.db.entity.MchQrcDeviceRela;
import com.jeequan.jeepay.service.mapper.MchQrcDeviceRelaMapper;
import org.springframework.stereotype.Service;

/**
 * <p>
 * 商户码牌、设备关联表 服务实现类
 * </p>
 *
 * @author [mybatis plus generator]
 * @since 2022-05-26
 */
@Service
public class MchQrcDeviceRelaService extends ServiceImpl<MchQrcDeviceRelaMapper, MchQrcDeviceRela> {

    public boolean removeByDeviceId(Long deviceId) {
        return baseMapper.delete(MchQrcDeviceRela.gw().eq(MchQrcDeviceRela::getDeviceId, deviceId)) >= 0;
    }

    public boolean removeByQrcId(Long qrcId) {
        return baseMapper.delete(MchQrcDeviceRela.gw().eq(MchQrcDeviceRela::getQrcId, qrcId)) >= 0;
    }


}
