|
@@ -0,0 +1,75 @@
|
|
|
|
+package com.jpsoft.bus.modules.bus.service.impl;
|
|
|
|
+
|
|
|
|
+import java.util.List;
|
|
|
|
+import java.util.Map;
|
|
|
|
+import java.util.UUID;
|
|
|
|
+import javax.annotation.Resource;
|
|
|
|
+import org.springframework.stereotype.Component;
|
|
|
|
+import org.springframework.transaction.annotation.Transactional;
|
|
|
|
+import com.jpsoft.bus.modules.bus.dao.DeviceCmdInfoDAO;
|
|
|
|
+import com.jpsoft.bus.modules.bus.entity.DeviceCmdInfo;
|
|
|
|
+import com.jpsoft.bus.modules.bus.service.DeviceCmdInfoService;
|
|
|
|
+import com.github.pagehelper.Page;
|
|
|
|
+import com.jpsoft.bus.modules.common.dto.Sort;
|
|
|
|
+import com.github.pagehelper.PageHelper;
|
|
|
|
+
|
|
|
|
+@Transactional
|
|
|
|
+@Component(value="deviceCmdInfoService")
|
|
|
|
+public class DeviceCmdInfoServiceImpl implements DeviceCmdInfoService {
|
|
|
|
+ @Resource(name="deviceCmdInfoDAO")
|
|
|
|
+ private DeviceCmdInfoDAO deviceCmdInfoDAO;
|
|
|
|
+
|
|
|
|
+ @Override
|
|
|
|
+ public DeviceCmdInfo get(String id) {
|
|
|
|
+ // TODO Auto-generated method stub
|
|
|
|
+ return deviceCmdInfoDAO.get(id);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @Override
|
|
|
|
+ public int insert(DeviceCmdInfo model) {
|
|
|
|
+ // TODO Auto-generated method stub
|
|
|
|
+ //model.setId(UUID.randomUUID().toString());
|
|
|
|
+
|
|
|
|
+ return deviceCmdInfoDAO.insert(model);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @Override
|
|
|
|
+ public int update(DeviceCmdInfo model) {
|
|
|
|
+ // TODO Auto-generated method stub
|
|
|
|
+ return deviceCmdInfoDAO.update(model);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @Override
|
|
|
|
+ public int delete(String id) {
|
|
|
|
+ // TODO Auto-generated method stub
|
|
|
|
+ return deviceCmdInfoDAO.delete(id);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @Override
|
|
|
|
+ public boolean exist(String id) {
|
|
|
|
+ // TODO Auto-generated method stub
|
|
|
|
+ int count = deviceCmdInfoDAO.exist(id);
|
|
|
|
+
|
|
|
|
+ return count > 0 ? true : false;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @Override
|
|
|
|
+ public List<DeviceCmdInfo> list() {
|
|
|
|
+ // TODO Auto-generated method stub
|
|
|
|
+ return deviceCmdInfoDAO.list();
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @Override
|
|
|
|
+ public Page<DeviceCmdInfo> pageSearch(Map<String, Object> searchParams, int pageNumber, int pageSize,boolean count,List<Sort> sortList) {
|
|
|
|
+ Page<DeviceCmdInfo> page = PageHelper.startPage(pageNumber,pageSize,count).doSelectPage(()->{
|
|
|
|
+ deviceCmdInfoDAO.search(searchParams,sortList);
|
|
|
|
+ });
|
|
|
|
+
|
|
|
|
+ return page;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @Override
|
|
|
|
+ public List<DeviceCmdInfo> findByLicensePlateNumber(String licensePlateNumber, int limit) {
|
|
|
|
+ return deviceCmdInfoDAO.findByLicensePlateNumber(licensePlateNumber,limit);
|
|
|
|
+ }
|
|
|
|
+}
|