package com.dy.pipIrrRemote.monitor.p202404V201.cdA2; import com.dy.pipIrrGlobal.daoPr.PrIntakeVcMapper; import com.dy.pipIrrGlobal.daoPr.PrWaterPriceMapper; import com.dy.pipIrrGlobal.daoSe.SeVirtualCardMapper; import com.dy.pipIrrGlobal.pojoSe.SeVirtualCard; import com.dy.pipIrrGlobal.voSe.VoVirtualCard; import com.dy.pipIrrRemote.monitor.common.ComSv; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import java.util.Date; /** * @Author: liurunyu * @Date: 2025/5/15 09:21 * @Description */ @Slf4j @Service("cdA2Sv") public class CdSv extends ComSv { @Autowired protected SeVirtualCardMapper seVirtualCardDao ; @Autowired protected PrWaterPriceMapper prWaterPriceDao ; @Autowired protected PrIntakeVcMapper prIntakeVcDao ; public VoVirtualCard selectClientVtCardById(Long id){ return seVirtualCardDao.getVcById(id) ; } public Double selectWaterPrice(){ return prWaterPriceDao.getPrice() ; } /** * 根据取水口ID获取与之绑定虚拟卡ID * @param intakeId * @return */ public Long selectVcIdByIntakeId(Long intakeId) { return prIntakeVcDao.getVcIdByIntakeId(intakeId); } /** * 设置虚拟卡被占用 */ public void setVcUsed(Long id, Long intakeId){ SeVirtualCard po = new SeVirtualCard() ; po.setId(id); po.setIntakeId(intakeId); po.setInUse((byte)1); po.setOpenTime(new Date()); seVirtualCardDao.updateByPrimaryKeySelective(po); } }