package com.zteits.bill.dao.impl; import com.zteits.bill.dao.TVipAreaCardCustInfoRelDao; import com.zteits.bill.domain.TVipAreaCardCustInfoRel; import com.zteits.bill.domain.TVipAreaCardCustInfoRelExample; import com.zteits.bill.domain.TVipCardCustInfo; import com.zteits.bill.mapper.TVipAreaCardCustInfoRelMapper; import com.zteits.bill.mapper.smapper.TVipAreaCardCustInfoRelSMapper; import com.zteits.clouds.api.apibase.constants.DataStatusEnum; import com.zteits.clouds.api.dto.bill.param.DeleteAreaCardByCustCardNoReq; import com.zteits.clouds.api.dto.bill.vipcard.param.QueryVipCardPlNoListRequest; import com.zteits.clouds.api.dto.bill.vipcard.param.VipCardInfoReq; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; import java.util.List; @Component public class TVipAreaCardCustInfoRelDaoImpl implements TVipAreaCardCustInfoRelDao { @Autowired private TVipAreaCardCustInfoRelMapper tVipAreaCardCustInfoRelMapper; @Autowired private TVipAreaCardCustInfoRelSMapper tVipAreaCardCustInfoRelSMapper; @Override public int saveTVipAreaCardCustInfoRel(TVipAreaCardCustInfoRel tVipAreaCardCustInfoRel) { return tVipAreaCardCustInfoRelMapper.insertSelective(tVipAreaCardCustInfoRel); } @Override public int bathSaveTVipAreaCardCustInfoRel(List tVipAreaCardCustInfoRels) { return tVipAreaCardCustInfoRelSMapper.bathSaveTVipAreaCardCustInfoRel(tVipAreaCardCustInfoRels); } @Override public int updateByExampleSelective(TVipAreaCardCustInfoRel record, TVipAreaCardCustInfoRelExample example) { return tVipAreaCardCustInfoRelMapper.updateByExampleSelective(record,example); } @Override public int updateByPrimaryKeySelective(TVipAreaCardCustInfoRel record) { return tVipAreaCardCustInfoRelMapper.updateByPrimaryKeySelective(record); } @Override public List selectByExample(TVipAreaCardCustInfoRelExample example) { return tVipAreaCardCustInfoRelMapper.selectByExample(example); } @Override public TVipAreaCardCustInfoRel queryByPrimaryKey(Long id) { return tVipAreaCardCustInfoRelMapper.selectByPrimaryKey(id); } @Override public List queryTVipAreaCardCustInfoRel(List custCardNos) { TVipAreaCardCustInfoRelExample example = new TVipAreaCardCustInfoRelExample(); example.createCriteria().andDataStateEqualTo(DataStatusEnum.DATA_STATUS_VALID.value()) .andCustCardNoIn(custCardNos); List list = tVipAreaCardCustInfoRelMapper.selectByExample(example); return list; } @Override public int batchDeleteTVipAreaCardCustInfoRelByPrimaryKey(List ids, String opId, String opName) { TVipAreaCardCustInfoRel record = new TVipAreaCardCustInfoRel(); record.setDataState(DataStatusEnum.DATA_STATUS_NO_VALID.value()); TVipAreaCardCustInfoRelExample example = new TVipAreaCardCustInfoRelExample(); example.createCriteria().andIdIn(ids); return tVipAreaCardCustInfoRelMapper.updateByExampleSelective(record,example); } @Override public List queryHotParkListForVipCard(QueryVipCardPlNoListRequest request) { return tVipAreaCardCustInfoRelSMapper.queryHotParkListForVipCard(request); } @Override public int updateAreaCardPushState(DeleteAreaCardByCustCardNoReq request) { TVipAreaCardCustInfoRel record = new TVipAreaCardCustInfoRel(); record.setPushState(0); TVipAreaCardCustInfoRelExample example = new TVipAreaCardCustInfoRelExample(); example.createCriteria().andCustCardNoEqualTo(request.getCustCardNo()) .andDataStateEqualTo(DataStatusEnum.DATA_STATUS_VALID.value()) .andPushStateEqualTo(1); return tVipAreaCardCustInfoRelMapper.updateByExampleSelective(record,example); } @Override public Integer queryParkAreaCardCountByPlNo(String plNo) { return tVipAreaCardCustInfoRelSMapper.queryParkAreaCardCountByPlNo(plNo); } /** * 根据停车场编号与车牌号码查询当前有效的会员车信息 * * @param request * @return */ @Override public TVipCardCustInfo queryCardCustInfoByParkcodeAndCarnumber(VipCardInfoReq request) { return tVipAreaCardCustInfoRelMapper.queryCardCustInfoByParkcodeAndCarnumber(request); } /*@Override public PageInfo queryTVipAreaCardCustInfoRelForPage(TVipAreaCardCustInfoRelRequest request) { PageHelper.startPage(request.getBaseRequest().getPageNum(), request.getBaseRequest().getPageSize()); //TODO 编写smapper实现 *//*List list = tVipAreaCardCustInfoRelSMapper.queryTVipAreaCardCustInfoRel(request); if (CollectionUtils.isNotEmpty(list)) { return new PageInfo(list); }*//* return new PageInfo(new ArrayList()); }*/ }