package com.neusoft.smart.pos.device.persistent.repository;

import com.neusoft.smart.pos.device.persistent.domain.DeviceAuthLicence;
import com.neusoft.smart.pos.device.persistent.domain.DeviceAuthLicenceExample;
import com.neusoft.smart.pos.device.persistent.mapper.DeviceAuthLicenceMapper;
import lombok.val;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

@Component
public class DeviceAuthLicenceRepository {
	
	@Autowired
	private DeviceAuthLicenceMapper deviceAuthLicenceMapper;
	
	public DeviceAuthLicence queryDeviceAuthLicenceBySn(String sn) {
		DeviceAuthLicenceExample example = new DeviceAuthLicenceExample();
		example.createCriteria().andSerialNoEqualTo(sn);
		val deviceAuthLicenceList = deviceAuthLicenceMapper.selectByExample(example);
		return deviceAuthLicenceList.size()>0?deviceAuthLicenceList.get(0):null;
	}
	
}
