Commit 961bf223 authored by zhangyanduan's avatar zhangyanduan

Merge branch 'import' of http://gitlab.91isoft.com:90/wangcong/entrance_api- into import

parents 1f6156e4 225c1615
...@@ -2,6 +2,7 @@ package org.rcisoft.sys.doordeviceinfo.controller; ...@@ -2,6 +2,7 @@ package org.rcisoft.sys.doordeviceinfo.controller;
/*固定导入*/ /*固定导入*/
import io.swagger.annotations.ApiImplicitParam; import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams; import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
...@@ -20,6 +21,7 @@ import org.rcisoft.core.controller.CyPaginationController; ...@@ -20,6 +21,7 @@ import org.rcisoft.core.controller.CyPaginationController;
import org.rcisoft.core.util.CyUserUtil; import org.rcisoft.core.util.CyUserUtil;
import org.rcisoft.core.model.CyGridModel; import org.rcisoft.core.model.CyGridModel;
import org.rcisoft.core.exception.CyServiceException; import org.rcisoft.core.exception.CyServiceException;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import javax.validation.Valid; import javax.validation.Valid;
...@@ -30,8 +32,8 @@ import org.rcisoft.sys.doordeviceinfo.service.DoorDeviceInfoService; ...@@ -30,8 +32,8 @@ import org.rcisoft.sys.doordeviceinfo.service.DoorDeviceInfoService;
import java.util.List; import java.util.List;
/** /**
* Created by cy on 2022年12月23日 下午2:04:50. * Created by cy on 2022年12月23日 下午2:04:50.
*/ */
@RestController @RestController
@RequestMapping("/doordeviceinfo") @RequestMapping("/doordeviceinfo")
public class DoorDeviceInfoController extends CyPaginationController<DoorDeviceInfo> { public class DoorDeviceInfoController extends CyPaginationController<DoorDeviceInfo> {
...@@ -42,69 +44,70 @@ public class DoorDeviceInfoController extends CyPaginationController<DoorDeviceI ...@@ -42,69 +44,70 @@ public class DoorDeviceInfoController extends CyPaginationController<DoorDeviceI
//@PreAuthorize("@cyPerm.hasPerm('sys:rDeviceInfo:add')") //@PreAuthorize("@cyPerm.hasPerm('sys:rDeviceInfo:add')")
@CyOpeLogAnno(title = "system-门磁设备记录表管理-新增门磁设备记录表", businessType = CyLogTypeEnum.INSERT) @CyOpeLogAnno(title = "system-门磁设备记录表管理-新增门磁设备记录表", businessType = CyLogTypeEnum.INSERT)
@ApiOperation(value="添加门磁设备记录表", notes="添加门磁设备记录表") @ApiOperation(value = "添加门磁设备记录表", notes = "添加门磁设备记录表")
@PostMapping(value = "/add") @PostMapping(value = "/add")
public CyResult add(@Valid DoorDeviceInfo doorDeviceInfo, BindingResult bindingResult) { public CyResult add(@Valid DoorDeviceInfo doorDeviceInfo, BindingResult bindingResult) {
CyPersistModel data = doorDeviceInfoServiceImpl.persist(doorDeviceInfo); CyPersistModel data = doorDeviceInfoServiceImpl.persist(doorDeviceInfo);
return CyResultGenUtil.builder(data, return CyResultGenUtil.builder(data,
CyMessCons.MESSAGE_ALERT_SUCCESS, CyMessCons.MESSAGE_ALERT_SUCCESS,
CyMessCons.MESSAGE_ALERT_ERROR, CyMessCons.MESSAGE_ALERT_ERROR,
doorDeviceInfo); doorDeviceInfo);
} }
//@PreAuthorize("@cyPerm.hasPerm('sys:rDeviceInfo:delete')") //@PreAuthorize("@cyPerm.hasPerm('sys:rDeviceInfo:delete')")
@CyOpeLogAnno(title = "system-门磁设备记录表管理-删除门磁设备记录表", businessType = CyLogTypeEnum.DELETE) @CyOpeLogAnno(title = "system-门磁设备记录表管理-删除门磁设备记录表", businessType = CyLogTypeEnum.DELETE)
@ApiOperation(value="删除门磁设备记录表", notes="删除门磁设备记录表") @ApiOperation(value = "删除门磁设备记录表", notes = "删除门磁设备记录表")
@ApiImplicitParams({@ApiImplicitParam(name = "businessId", value = "businessId", required = true, dataType = "varchar")}) @ApiImplicitParams({@ApiImplicitParam(name = "businessId", value = "businessId", required = true, dataType = "varchar")})
@DeleteMapping("/delete/{businessId:\\w+}") @DeleteMapping("/delete/{businessId:\\w+}")
public CyResult delete(@PathVariable int businessId,DoorDeviceInfo doorDeviceInfo) { public CyResult delete(@PathVariable int businessId, DoorDeviceInfo doorDeviceInfo) {
doorDeviceInfo.setBusinessId(businessId); doorDeviceInfo.setBusinessId(businessId);
CyPersistModel data = doorDeviceInfoServiceImpl.remove(doorDeviceInfo); CyPersistModel data = doorDeviceInfoServiceImpl.remove(doorDeviceInfo);
return CyResultGenUtil.builder(data, return CyResultGenUtil.builder(data,
CyMessCons.MESSAGE_ALERT_SUCCESS, CyMessCons.MESSAGE_ALERT_SUCCESS,
CyMessCons.MESSAGE_ALERT_ERROR, CyMessCons.MESSAGE_ALERT_ERROR,
businessId); businessId);
} }
//@PreAuthorize("@cyPerm.hasPerm('sys:rDeviceInfo:update')") //@PreAuthorize("@cyPerm.hasPerm('sys:rDeviceInfo:update')")
@CyOpeLogAnno(title = "system-门磁设备记录表管理-修改门磁设备记录表", businessType = CyLogTypeEnum.UPDATE) @CyOpeLogAnno(title = "system-门磁设备记录表管理-修改门磁设备记录表", businessType = CyLogTypeEnum.UPDATE)
@ApiOperation(value="修改门磁设备记录表", notes="修改门磁设备记录表") @ApiOperation(value = "修改门磁设备记录表", notes = "修改门磁设备记录表")
@ApiImplicitParams({@ApiImplicitParam(name = "businessId", value = "businessId", required = false, dataType = "varchar")}) @ApiImplicitParams({@ApiImplicitParam(name = "businessId", value = "businessId", required = false, dataType = "varchar")})
@PutMapping("/update/{businessId:\\w+}") @PutMapping("/update")
public CyResult update(@PathVariable int businessId, @Valid DoorDeviceInfo doorDeviceInfo, BindingResult bindingResult) { public CyResult update(@RequestBody DoorDeviceInfo doorDeviceInfo, BindingResult bindingResult) {
doorDeviceInfo.setBusinessId(businessId); // doorDeviceInfo.setBusinessId(businessId);
CyPersistModel data = doorDeviceInfoServiceImpl.merge(doorDeviceInfo); CyPersistModel data = doorDeviceInfoServiceImpl.merge(doorDeviceInfo);
return CyResultGenUtil.builder(data, return CyResultGenUtil.builder(data,
CyMessCons.MESSAGE_ALERT_SUCCESS, CyMessCons.MESSAGE_ALERT_SUCCESS,
CyMessCons.MESSAGE_ALERT_ERROR, CyMessCons.MESSAGE_ALERT_ERROR,
doorDeviceInfo); doorDeviceInfo);
} }
//@PreAuthorize("@cyPerm.hasPerm('sys:rDeviceInfo:query')") //@PreAuthorize("@cyPerm.hasPerm('sys:rDeviceInfo:query')")
@CyOpeLogAnno(title = "system-门磁设备记录表管理-查询门磁设备记录表", businessType = CyLogTypeEnum.QUERY) @CyOpeLogAnno(title = "system-门磁设备记录表管理-查询门磁设备记录表", businessType = CyLogTypeEnum.QUERY)
@ApiOperation(value="查询单一门磁设备记录表", notes="查询单一门磁设备记录表") @ApiOperation(value = "查询单一门磁设备记录表", notes = "查询单一门磁设备记录表")
@ApiImplicitParams({@ApiImplicitParam(name = "businessId", value = "businessId", required = true, dataType = "varchar")}) @ApiImplicitParams({@ApiImplicitParam(name = "businessId", value = "businessId", required = true, dataType = "varchar")})
@GetMapping("/detail/{businessId:\\w+}") @GetMapping("/detail/{businessId:\\w+}")
public CyResult detail(@PathVariable int businessId) { public CyResult detail(@PathVariable int businessId) {
return CyResultGenUtil.builder(new CyPersistModel(1), return CyResultGenUtil.builder(new CyPersistModel(1),
CyMessCons.MESSAGE_ALERT_SUCCESS, CyMessCons.MESSAGE_ALERT_SUCCESS,
CyMessCons.MESSAGE_ALERT_ERROR, CyMessCons.MESSAGE_ALERT_ERROR,
doorDeviceInfoServiceImpl.findById(businessId)); doorDeviceInfoServiceImpl.findById(businessId));
} }
//@PreAuthorize("@cyPerm.hasPerm('sys:rDeviceInfo:list')") //@PreAuthorize("@cyPerm.hasPerm('sys:rDeviceInfo:list')")
@CyOpeLogAnno(title = "system-门磁设备记录表管理-查询门磁设备记录表", businessType = CyLogTypeEnum.QUERY) @CyOpeLogAnno(title = "system-门磁设备记录表管理-查询门磁设备记录表", businessType = CyLogTypeEnum.QUERY)
@ApiOperation(value="查询门磁设备记录表集合", notes="查询门磁设备记录表集合") @ApiOperation(value = "查询门磁设备记录表集合", notes = "查询门磁设备记录表集合")
@GetMapping(value = "/queryDoorDeviceInfos") @GetMapping(value = "/queryDoorDeviceInfos")
public CyResult queryDoorDeviceInfos(DoorDeviceInfo doorDeviceInfo) { public CyResult queryDoorDeviceInfos(DoorDeviceInfo doorDeviceInfo) {
return CyResultGenUtil.builder(new CyPersistModel(1), return CyResultGenUtil.builder(new CyPersistModel(1),
CyMessCons.MESSAGE_ALERT_SUCCESS, CyMessCons.MESSAGE_ALERT_SUCCESS,
CyMessCons.MESSAGE_ALERT_ERROR, CyMessCons.MESSAGE_ALERT_ERROR,
doorDeviceInfoServiceImpl.findAll(doorDeviceInfo)); doorDeviceInfoServiceImpl.findAll(doorDeviceInfo));
} }
//@PreAuthorize("@cyPerm.hasPerm('sys:rDeviceInfo:list')") //@PreAuthorize("@cyPerm.hasPerm('sys:rDeviceInfo:list')")
@CyOpeLogAnno(title = "system-门磁设备记录表管理-查询门磁设备记录表", businessType = CyLogTypeEnum.QUERY) @CyOpeLogAnno(title = "system-门磁设备记录表管理-查询门磁设备记录表", businessType = CyLogTypeEnum.QUERY)
@ApiOperation(value="分页查询门磁设备记录表集合", notes="分页查询门磁设备记录表集合") @ApiOperation(value = "分页查询门磁设备记录表集合", notes = "分页查询门磁设备记录表集合")
@GetMapping(value = "/queryDoorDeviceInfoByPagination") @GetMapping(value = "/queryDoorDeviceInfoByPagination")
public CyGridModel listByPagination(DoorDeviceInfo doorDeviceInfo) { public CyGridModel listByPagination(DoorDeviceInfo doorDeviceInfo) {
doorDeviceInfoServiceImpl.findAllByPagination(getPaginationUtility(), doorDeviceInfo); doorDeviceInfoServiceImpl.findAllByPagination(getPaginationUtility(), doorDeviceInfo);
...@@ -114,18 +117,24 @@ public class DoorDeviceInfoController extends CyPaginationController<DoorDeviceI ...@@ -114,18 +117,24 @@ public class DoorDeviceInfoController extends CyPaginationController<DoorDeviceI
@CyOpeLogAnno(title = "system-门磁设备记录表管理-查询门磁设备记录表", businessType = CyLogTypeEnum.EXPORT) @CyOpeLogAnno(title = "system-门磁设备记录表管理-查询门磁设备记录表", businessType = CyLogTypeEnum.EXPORT)
@ApiOperation(value = "导出门磁设备记录表信息", notes = "导出门磁设备记录表信息") @ApiOperation(value = "导出门磁设备记录表信息", notes = "导出门磁设备记录表信息")
@GetMapping(value = "/export") @GetMapping(value = "/export")
public CyResult outDoorDeviceInfo(HttpServletResponse response,DoorDeviceInfo doorDeviceInfo,@PathVariable @RequestParam(defaultValue = "0") String excelId) { public CyResult outDoorDeviceInfo(HttpServletResponse response, DoorDeviceInfo doorDeviceInfo, @PathVariable @RequestParam(defaultValue = "0") String excelId) {
String excelName=""; String excelName = "";
switch(excelId){ switch (excelId) {
case "0": excelName="门磁设备记录表信息.xls";break; case "0":
case "1": excelName="门磁设备记录表信息.xlsx";break; excelName = "门磁设备记录表信息.xls";
case "2": excelName="门磁设备记录表信息.csv";break; break;
case "1":
excelName = "门磁设备记录表信息.xlsx";
break;
case "2":
excelName = "门磁设备记录表信息.csv";
break;
} }
List<DoorDeviceInfo> doorDeviceInfoList = doorDeviceInfoServiceImpl.export(doorDeviceInfo); List<DoorDeviceInfo> doorDeviceInfoList = doorDeviceInfoServiceImpl.export(doorDeviceInfo);
CyEpExcelUtil.exportExcel(doorDeviceInfoList, "门磁设备记录表信息", "门磁设备记录表信息", DoorDeviceInfo.class, excelName, response); CyEpExcelUtil.exportExcel(doorDeviceInfoList, "门磁设备记录表信息", "门磁设备记录表信息", DoorDeviceInfo.class, excelName, response);
return CyResultGenUtil.builder(new CyPersistModel(1), return CyResultGenUtil.builder(new CyPersistModel(1),
CyMessCons.MESSAGE_ALERT_SUCCESS, CyMessCons.MESSAGE_ALERT_SUCCESS,
CyMessCons.MESSAGE_ALERT_ERROR, CyMessCons.MESSAGE_ALERT_ERROR,
doorDeviceInfoList); doorDeviceInfoList);
} }
} }
package org.rcisoft.sys.doordeviceinfo.dao; package org.rcisoft.sys.doordeviceinfo.dao;
import org.apache.ibatis.annotations.Mapper;
import org.rcisoft.core.mapper.CyBaseMapper; import org.rcisoft.core.mapper.CyBaseMapper;
import org.rcisoft.sys.doordeviceinfo.entity.DoorDeviceInfo; import org.rcisoft.sys.doordeviceinfo.entity.DoorDeviceInfo;
import org.apache.ibatis.annotations.ResultMap; import org.apache.ibatis.annotations.ResultMap;
...@@ -12,18 +13,21 @@ import com.baomidou.mybatisplus.core.metadata.IPage; ...@@ -12,18 +13,21 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import java.util.List; import java.util.List;
/** /**
* Created with cy on 2022年12月23日 下午2:04:50. * Created with cy on 2022年12月23日 下午2:04:50.
*/ */
@Mapper
public interface DoorDeviceInfoRepository extends CyBaseMapper<DoorDeviceInfo> { public interface DoorDeviceInfoRepository extends CyBaseMapper<DoorDeviceInfo> {
List<DoorDeviceInfo> queryDoorDeviceInfos(@Param("entity") DoorDeviceInfo doorDeviceInfo); List<DoorDeviceInfo> queryDoorDeviceInfos(@Param("entity") DoorDeviceInfo doorDeviceInfo);
/** /**
* 分页查询 doorDeviceInfo * 分页查询 doorDeviceInfo
* */
*/ IPage<DoorDeviceInfo> queryDoorDeviceInfosPaged(CyPageInfo cyPageInfo, @Param("entity") DoorDeviceInfo doorDeviceInfo);
IPage<DoorDeviceInfo> queryDoorDeviceInfosPaged(CyPageInfo cyPageInfo,@Param("entity") DoorDeviceInfo doorDeviceInfo);
DoorDeviceInfo queryDoorDeviceInfosById(Integer business_id);
public int updateDoorDeviceInfos(@Param("entity") DoorDeviceInfo doorDeviceInfo);
} }
...@@ -2,48 +2,88 @@ package org.rcisoft.sys.doordeviceinfo.entity; ...@@ -2,48 +2,88 @@ package org.rcisoft.sys.doordeviceinfo.entity;
import cn.afterturn.easypoi.excel.annotation.Excel; import cn.afterturn.easypoi.excel.annotation.Excel;
import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.*; import lombok.*;
import org.rcisoft.core.entity.CyIdIncreEntity; import org.rcisoft.core.entity.CyIdIncreEntity;
import org.rcisoft.core.entity.CyIdNotDataEntity; import org.rcisoft.core.entity.CyIdNotDataEntity;
import org.springframework.data.annotation.Transient;
/** /**
* Created with cy on 2022年12月23日 下午2:04:50. * Created with cy on 2022年12月23日 下午2:04:50.
*/ */
@Data @Data
@TableName("door_device_info") @TableName("door_device_info")
public class DoorDeviceInfo extends CyIdIncreEntity<DoorDeviceInfo> { public class DoorDeviceInfo extends CyIdIncreEntity<DoorDeviceInfo> {
//id
private Integer id;
/** //设备所在地址中文
private String deviceAddressLabel;
//排序
@Transient
private String px;
@Transient
//标记异常(0 异常 1非异常)
private String abnormal;
@Transient
/**
* @desc 设备上报数据类型
* open:开门
* close:关门
* warn:警告
* up:设备上线
* down:设备下线
* @column data_type
* @default
*/
private String dataType;
/**
* 开始时间
*/
@Transient
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
private String beginTime;
//结束时间
@Transient
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
private String endTime;
/**
* @desc 设备imei码 * @desc 设备imei码
* @column device_imei * @column device_imei
* @default * @default
*/ */
private String deviceImei; private String deviceImei;
/** /**
* @desc 设备名称 * @desc 设备名称
* @column device_name * @column device_name
* @default * @default
*/ */
private String deviceName; private String deviceName;
/** /**
* @desc 设备所在地址 * @desc 设备所在地址
* @column device_address * @column device_address
* @default * @default
*/ */
private String deviceAddress; private String deviceAddress;
/** /**
* @desc 设备所在区域 * @desc 设备所在区域
* @column device_area * @column device_area
* @default * @default
*/ */
private String deviceArea; private String deviceArea;
/** /**
* @desc 设备所在点位 * @desc 设备所在点位
* @column device_point * @column device_point
* @default * @default
*/ */
private String devicePoint; private String devicePoint;
} }
...@@ -22,94 +22,105 @@ import org.springframework.transaction.annotation.Transactional; ...@@ -22,94 +22,105 @@ import org.springframework.transaction.annotation.Transactional;
import org.rcisoft.core.model.CyPageInfo; import org.rcisoft.core.model.CyPageInfo;
import java.util.List; import java.util.List;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
/** /**
* Created by cy on 2022年12月23日 下午2:04:50. * Created by cy on 2022年12月23日 下午2:04:50.
*/ */
@Service @Service
@Transactional(readOnly = true,propagation = Propagation.NOT_SUPPORTED) @Transactional(readOnly = true, propagation = Propagation.NOT_SUPPORTED)
@Slf4j @Slf4j
public class DoorDeviceInfoServiceImpl extends ServiceImpl<DoorDeviceInfoRepository,DoorDeviceInfo> implements DoorDeviceInfoService { public class DoorDeviceInfoServiceImpl extends ServiceImpl<DoorDeviceInfoRepository, DoorDeviceInfo> implements DoorDeviceInfoService {
@Autowired
DoorDeviceInfoRepository doorDeviceInfoRepository;
/** /**
* 保存 门磁设备记录表 * 保存 门磁设备记录表
* @param doorDeviceInfo *
* @return * @param doorDeviceInfo
*/ * @return
@Transactional(propagation = Propagation.REQUIRED,isolation = Isolation.DEFAULT) */
@Transactional(propagation = Propagation.REQUIRED, isolation = Isolation.DEFAULT)
@Override @Override
public CyPersistModel persist(DoorDeviceInfo doorDeviceInfo){ public CyPersistModel persist(DoorDeviceInfo doorDeviceInfo) {
//增加操作 //增加操作
int line = baseMapper.insert(doorDeviceInfo); int line = baseMapper.insert(doorDeviceInfo);
log.debug(CyUserUtil.getAuthenUsername()+"新增了ID为"+ log.debug(CyUserUtil.getAuthenUsername() + "新增了ID为" +
doorDeviceInfo.getBusinessId()+"的门磁设备记录表信息"); doorDeviceInfo.getBusinessId() + "的门磁设备记录表信息");
return new CyPersistModel(line); return new CyPersistModel(line);
} }
/** /**
* 删除 门磁设备记录表 * 删除 门磁设备记录表
* @param doorDeviceInfo *
* @return * @param doorDeviceInfo
*/ * @return
@Transactional(propagation = Propagation.REQUIRED,isolation = Isolation.DEFAULT) */
@Transactional(propagation = Propagation.REQUIRED, isolation = Isolation.DEFAULT)
@Override @Override
public CyPersistModel remove(DoorDeviceInfo doorDeviceInfo){ public CyPersistModel remove(DoorDeviceInfo doorDeviceInfo) {
int line = baseMapper.realDelete(doorDeviceInfo); int line = baseMapper.realDelete(doorDeviceInfo);
log.debug(CyUserUtil.getAuthenUsername()+"删除了ID为"+ log.debug(CyUserUtil.getAuthenUsername() + "删除了ID为" +
doorDeviceInfo.getBusinessId()+"的门磁设备记录表信息"); doorDeviceInfo.getBusinessId() + "的门磁设备记录表信息");
return new CyPersistModel(line); return new CyPersistModel(line);
} }
/** /**
* 修改 门磁设备记录表 * 修改 门磁设备记录表
* @param doorDeviceInfo *
* @return * @param doorDeviceInfo
*/ * @return
@Transactional(propagation = Propagation.REQUIRED,isolation = Isolation.DEFAULT) */
@Transactional(propagation = Propagation.REQUIRED, isolation = Isolation.DEFAULT)
@Override @Override
public CyPersistModel merge(DoorDeviceInfo doorDeviceInfo){ public CyPersistModel merge(DoorDeviceInfo doorDeviceInfo) {
int line = baseMapper.updateById(doorDeviceInfo); int line = doorDeviceInfoRepository.updateDoorDeviceInfos(doorDeviceInfo);
log.debug(CyUserUtil.getAuthenUsername()+"修改了ID为"+ doorDeviceInfo.getBusinessId()+"的门磁设备记录表信息"); log.debug(CyUserUtil.getAuthenUsername() + "修改了ID为" + doorDeviceInfo.getBusinessId() + "的门磁设备记录表信息");
return new CyPersistModel(line); return new CyPersistModel(line);
} }
/** /**
* 根据id查询 门磁设备记录表 * 根据id查询 门磁设备记录表
* @param id *
* @return * @param id
*/ * @return
*/
@Override @Override
public DoorDeviceInfo findById(int id){ public DoorDeviceInfo findById(int id) {
return baseMapper.selectById(id); return doorDeviceInfoRepository.queryDoorDeviceInfosById(id);
} }
/** /**
* 分页查询 门磁设备记录表 * 分页查询 门磁设备记录表
* @param doorDeviceInfo *
* @return * @param doorDeviceInfo
*/ * @return
*/
@Override @Override
public IPage<DoorDeviceInfo> findAllByPagination(CyPageInfo<DoorDeviceInfo> paginationUtility, public IPage<DoorDeviceInfo> findAllByPagination(CyPageInfo<DoorDeviceInfo> paginationUtility,
DoorDeviceInfo doorDeviceInfo){ DoorDeviceInfo doorDeviceInfo) {
return baseMapper.queryDoorDeviceInfosPaged(paginationUtility,doorDeviceInfo); return baseMapper.queryDoorDeviceInfosPaged(paginationUtility, doorDeviceInfo);
} }
/** /**
* 查询list 门磁设备记录表 * 查询list 门磁设备记录表
* @param doorDeviceInfo *
* @return * @param doorDeviceInfo
*/ * @return
*/
@Override @Override
public List<DoorDeviceInfo> findAll(DoorDeviceInfo doorDeviceInfo){ public List<DoorDeviceInfo> findAll(DoorDeviceInfo doorDeviceInfo) {
return baseMapper.queryDoorDeviceInfos(doorDeviceInfo); return baseMapper.queryDoorDeviceInfos(doorDeviceInfo);
} }
/** /**
* 导出门磁设备记录表 * 导出门磁设备记录表
* @return *
*/ * @return
*/
@Override @Override
public List<DoorDeviceInfo> export(DoorDeviceInfo doorDeviceInfo) { public List<DoorDeviceInfo> export(DoorDeviceInfo doorDeviceInfo) {
List<DoorDeviceInfo> doorDeviceInfoList = baseMapper.queryDoorDeviceInfos(doorDeviceInfo); List<DoorDeviceInfo> doorDeviceInfoList = baseMapper.queryDoorDeviceInfos(doorDeviceInfo);
...@@ -124,12 +135,12 @@ public class DoorDeviceInfoServiceImpl extends ServiceImpl<DoorDeviceInfoReposit ...@@ -124,12 +135,12 @@ public class DoorDeviceInfoServiceImpl extends ServiceImpl<DoorDeviceInfoReposit
@Override @Override
public DoorDeviceInfo getDeviceInfoByIMEICode(String deviceImei) { public DoorDeviceInfo getDeviceInfoByIMEICode(String deviceImei) {
QueryWrapper<DoorDeviceInfo> queryWrapper = new QueryWrapper<>(); QueryWrapper<DoorDeviceInfo> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("device_imei",deviceImei); queryWrapper.eq("device_imei", deviceImei);
queryWrapper.eq("del_flag","0"); queryWrapper.eq("del_flag", "0");
List<DoorDeviceInfo> doorDeviceInfos = baseMapper.selectList(queryWrapper); List<DoorDeviceInfo> doorDeviceInfos = baseMapper.selectList(queryWrapper);
if(doorDeviceInfos!=null && !doorDeviceInfos.isEmpty()){ if (doorDeviceInfos != null && !doorDeviceInfos.isEmpty()) {
return doorDeviceInfos.get(0); return doorDeviceInfos.get(0);
}else{ } else {
return null; return null;
} }
} }
......
...@@ -166,7 +166,7 @@ public class VisitInfomationServiceImpl extends ServiceImpl<VisitInfomationRepos ...@@ -166,7 +166,7 @@ public class VisitInfomationServiceImpl extends ServiceImpl<VisitInfomationRepos
sysUserList.get(0).setName(u.getUserName()); sysUserList.get(0).setName(u.getUserName());
sysUserRepositorys.updateSysUser(sysUserList.get(0)); sysUserRepositorys.updateSysUser(sysUserList.get(0));
} }
u.setPersonId(sysUserList.get(0).getPersonId()); u.setPersonId(UUID.randomUUID().toString());
u.setUserId(sysUserList.get(0).getBusinessId()); u.setUserId(sysUserList.get(0).getBusinessId());
} }
} }
......
...@@ -15,12 +15,57 @@ ...@@ -15,12 +15,57 @@
<!--<cache type="${corePackag!}.util.RedisCache"/>--> <!--<cache type="${corePackag!}.util.RedisCache"/>-->
<select id="queryDoorDeviceInfos" resultMap="BaseResultMap"> <select id="queryDoorDeviceInfos" resultMap="BaseResultMap">
select * from door_device_info select *
where 1=1 from door_device_info
where 1 = 1
</select> </select>
<select id="queryDoorDeviceInfosPaged" resultMap="BaseResultMap"> <select id="queryDoorDeviceInfosPaged" resultMap="BaseResultMap">
select * from door_device_info SELECT drd.business_id AS id,ddi.*,drd.*
where 1=1 FROM door_device_info ddi
LEFT JOIN door_report_data drd ON ddi.business_id = drd.device_id
LEFT JOIN sys_dict_data sdd ON ddi.device_address = sdd.dict_value
WHERE ddi.del_flag = 0
<if test="entity.flag !=null and entity.flag != '' ">
and ddi.flag = #{entity.flag}
</if>
<if test="entity.beginTime != null and entity.beginTime !='' "><!-- 开始时间检索 -->
and date_format(ddi.create_date,'%Y-%m-%d') &gt;= date_format(#{entity.beginTime},'%Y-%m-%d')
</if>
<if test="entity.endTime != null and entity.endTime !='' "><!-- 结束时间检索 -->
and date_format(ddi.create_date,'%Y-%m-%d') &lt;= date_format(#{entity.endTime},'%Y-%m-%d')
</if>
<if test="entity.deviceAddress !=null and entity.deviceAddress != '' ">
and ddi.device_address = #{entity.deviceAddress}
</if>
<if test="entity.dataType !=null and entity.dataType != '' ">
and ddi.data_type = #{entity.dataType}
</if>
<if test="entity.abnormal !=null and entity.abnormal != '' ">
and ddi.abnormal = #{entity.abnormal}
</if>
<if test="entity.px == '1'.toString() "><!-- 排序-->
order BY ddi.create_date desc
</if>
<if test="entity.px == '2'.toString() "><!-- 排序-->
ORDER BY sdd.dict_sort desc
</if>
</select> </select>
<select id="queryDoorDeviceInfosById" resultMap="BaseResultMap">
SELECT drd.business_id AS id, ddi.*, drd.*
FROM door_device_info ddi
LEFT JOIN door_report_data drd ON ddi.business_id = drd.device_id
WHERE ddi.del_flag = 0
AND drd.business_id = #{id}
</select>
<update id="updateDoorDeviceInfos" parameterType="org.rcisoft.sys.doordeviceinfo.entity.DoorDeviceInfo">
update door_report_data
<trim prefix="SET" suffixOverrides=",">
<if test="entity.abnormal != null">abnormal = #{entity.abnormal},</if>
</trim>
where business_id = #{entity.businessId}
</update>
</mapper> </mapper>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment