ParkingLotCredentialsDaoImpl.java 1.67 KB
package com.zteits.park.dao.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import com.zteits.clouds.api.apibase.constants.DataStatusEnum;
import com.zteits.park.dao.ParkingLotCredentialsDao;
import com.zteits.park.domain.ParkingLotCredentials;
import com.zteits.park.domain.ParkingLotCredentialsExample;
import com.zteits.park.mapper.ParkingLotCredentialsMapper;
@Component
public class ParkingLotCredentialsDaoImpl implements ParkingLotCredentialsDao {
	@Autowired
	private ParkingLotCredentialsMapper parkingLotCredentialsMapper;
	
	@Override
	public int deleteByPrimaryKeys(List<Long> plIds) {
		ParkingLotCredentialsExample example = new ParkingLotCredentialsExample();
		ParkingLotCredentials record = new ParkingLotCredentials();
		record.setDataStatus(DataStatusEnum.DATA_STATUS_NO_VALID.value());
		example.createCriteria().andPlIdIn(plIds).andDataStatusEqualTo(DataStatusEnum.DATA_STATUS_VALID.value());
		return parkingLotCredentialsMapper.updateByExampleSelective(record , example);
	}

	@Override
	public int insertSelective(ParkingLotCredentials record) {
		return parkingLotCredentialsMapper.insertSelective(record);
	}

	@Override
	public ParkingLotCredentials selectByPrimaryKey(Long plId) {
		return parkingLotCredentialsMapper.selectByPrimaryKey(plId);
	}

	@Override
	public int updateByPrimaryKeySelective(ParkingLotCredentials record) {
		return parkingLotCredentialsMapper.updateByPrimaryKeySelective(record);
	}

	@Override
	public List<ParkingLotCredentials> queryParkingLotCredentials(ParkingLotCredentialsExample record) {
		return parkingLotCredentialsMapper.selectByExample(record);
	}

}