| | |
| | | |
| | | import com.dy.pipIrrGlobal.daoSe.SeClientCardMapper; |
| | | import com.dy.pipIrrGlobal.pojoSe.SeClientCard; |
| | | import com.dy.pipIrrGlobal.voSe.VoCardInfo; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.Optional; |
| | | |
| | | /** |
| | | * @author ZhuBaoMin |
| | |
| | | } |
| | | |
| | | /** |
| | | * 依据水卡地址获取水卡编号(主键) |
| | | * 依据水卡地址获取水卡编号(12月19日废弃) |
| | | * @param cardAddr |
| | | * @return |
| | | */ |
| | |
| | | } |
| | | |
| | | /** |
| | | * 根据水卡编号获取水卡表主键(12月19日添加后废弃) |
| | | * @param cardNum 16位水卡编号 |
| | | * @return 水卡表主键 |
| | | */ |
| | | public Long getCardIdByNum(String cardNum) { |
| | | return seClientCardMapper.getCardIdByNum(cardNum); |
| | | } |
| | | |
| | | /** |
| | | * 根据水卡编号获取水卡表主键及农户编号 |
| | | * @param cardNum |
| | | * @return |
| | | */ |
| | | public Map getCardIdAndClientNum(String cardNum) { |
| | | return seClientCardMapper.getCardIdAndClientNum(cardNum); |
| | | } |
| | | /** |
| | | * 根据水卡编号(主键)修改农户卡信息 |
| | | * @param po |
| | | * @return |
| | |
| | | public Integer UpdateClientCard(SeClientCard po) { |
| | | return seClientCardMapper.updateByPrimaryKeySelective(po); |
| | | } |
| | | |
| | | /** |
| | | * 根据农户主键获取水卡列表 |
| | | * @param clientId |
| | | * @return |
| | | */ |
| | | public List<VoCardInfo> getCardInfoByClientId(Long clientId){ |
| | | List<VoCardInfo> list = Optional.ofNullable(seClientCardMapper.getCardInfoByClientId(clientId)).orElse(new ArrayList<>()); |
| | | if(list.size() > 0) { |
| | | return list; |
| | | }else { |
| | | return new ArrayList<>(); |
| | | } |
| | | } |
| | | } |