Browse Source

Merge remote-tracking branch 'origin/develop' into develop

tags/v1.2.0^2
chenjiandong 1 year ago
parent
commit
276d344756
42 changed files with 1713 additions and 0 deletions
  1. +42
    -0
      tuoheng-admin/src/main/java/com/tuoheng/admin/controller/CameraController.java
  2. +32
    -0
      tuoheng-admin/src/main/java/com/tuoheng/admin/controller/GoodsController.java
  3. +41
    -0
      tuoheng-admin/src/main/java/com/tuoheng/admin/controller/WarehouseController.java
  4. +42
    -0
      tuoheng-admin/src/main/java/com/tuoheng/admin/controller/WarningController.java
  5. +32
    -0
      tuoheng-admin/src/main/java/com/tuoheng/admin/controller/WarningRecordController.java
  6. +65
    -0
      tuoheng-admin/src/main/java/com/tuoheng/admin/entity/domain/Camera.java
  7. +56
    -0
      tuoheng-admin/src/main/java/com/tuoheng/admin/entity/domain/Goods.java
  8. +51
    -0
      tuoheng-admin/src/main/java/com/tuoheng/admin/entity/domain/Warehouse.java
  9. +66
    -0
      tuoheng-admin/src/main/java/com/tuoheng/admin/entity/domain/Warning.java
  10. +47
    -0
      tuoheng-admin/src/main/java/com/tuoheng/admin/entity/domain/WarningRecord.java
  11. +21
    -0
      tuoheng-admin/src/main/java/com/tuoheng/admin/entity/request/camera/QueryCameraListRequest.java
  12. +21
    -0
      tuoheng-admin/src/main/java/com/tuoheng/admin/entity/request/goods/QueryGoodsListRequest.java
  13. +21
    -0
      tuoheng-admin/src/main/java/com/tuoheng/admin/entity/request/warehouse/QueryWarehousePageListRequest.java
  14. +21
    -0
      tuoheng-admin/src/main/java/com/tuoheng/admin/entity/request/warning/QueryWarningListRequest.java
  15. +21
    -0
      tuoheng-admin/src/main/java/com/tuoheng/admin/entity/request/warningrecord/QueryWarningRecordListRequest.java
  16. +25
    -0
      tuoheng-admin/src/main/java/com/tuoheng/admin/enums/MarkEnum.java
  17. +33
    -0
      tuoheng-admin/src/main/java/com/tuoheng/admin/mapper/CameraMapper.java
  18. +34
    -0
      tuoheng-admin/src/main/java/com/tuoheng/admin/mapper/GoodsMapper.java
  19. +36
    -0
      tuoheng-admin/src/main/java/com/tuoheng/admin/mapper/WarehouseMapper.java
  20. +32
    -0
      tuoheng-admin/src/main/java/com/tuoheng/admin/mapper/WarningMapper.java
  21. +33
    -0
      tuoheng-admin/src/main/java/com/tuoheng/admin/mapper/WarningRecordMapper.java
  22. +44
    -0
      tuoheng-admin/src/main/java/com/tuoheng/admin/service/camera/CameraServiceImpl.java
  23. +30
    -0
      tuoheng-admin/src/main/java/com/tuoheng/admin/service/camera/ICameraService.java
  24. +54
    -0
      tuoheng-admin/src/main/java/com/tuoheng/admin/service/camera/query/QueryCameraByIdService.java
  25. +59
    -0
      tuoheng-admin/src/main/java/com/tuoheng/admin/service/camera/query/QueryCameraListService.java
  26. +44
    -0
      tuoheng-admin/src/main/java/com/tuoheng/admin/service/goods/GoodsServiceImpl.java
  27. +32
    -0
      tuoheng-admin/src/main/java/com/tuoheng/admin/service/goods/IGoodsService.java
  28. +64
    -0
      tuoheng-admin/src/main/java/com/tuoheng/admin/service/goods/query/QueryGoodsListService.java
  29. +31
    -0
      tuoheng-admin/src/main/java/com/tuoheng/admin/service/warehouse/IWarehouseService.java
  30. +44
    -0
      tuoheng-admin/src/main/java/com/tuoheng/admin/service/warehouse/WarehouseServiceImpl.java
  31. +67
    -0
      tuoheng-admin/src/main/java/com/tuoheng/admin/service/warehouse/query/QueryWarehousePageListService.java
  32. +31
    -0
      tuoheng-admin/src/main/java/com/tuoheng/admin/service/warning/IWarningService.java
  33. +44
    -0
      tuoheng-admin/src/main/java/com/tuoheng/admin/service/warning/WarningServiceImpl.java
  34. +63
    -0
      tuoheng-admin/src/main/java/com/tuoheng/admin/service/warning/query/QueryWarningListService.java
  35. +31
    -0
      tuoheng-admin/src/main/java/com/tuoheng/admin/service/warningrecord/IWarningRecordService.java
  36. +38
    -0
      tuoheng-admin/src/main/java/com/tuoheng/admin/service/warningrecord/WarningRecordServiceImpl.java
  37. +65
    -0
      tuoheng-admin/src/main/java/com/tuoheng/admin/service/warningrecord/query/QueryWarningRecordListService.java
  38. +42
    -0
      tuoheng-admin/src/main/resources/mapper/CameraMapper.xml
  39. +40
    -0
      tuoheng-admin/src/main/resources/mapper/GoodsMapper.xml
  40. +39
    -0
      tuoheng-admin/src/main/resources/mapper/WarehouseMapper.xml
  41. +41
    -0
      tuoheng-admin/src/main/resources/mapper/WarningMapper.xml
  42. +38
    -0
      tuoheng-admin/src/main/resources/mapper/WarningRecordMapper.xml

+ 42
- 0
tuoheng-admin/src/main/java/com/tuoheng/admin/controller/CameraController.java View File

package com.tuoheng.admin.controller;

import com.tuoheng.admin.entity.request.camera.QueryCameraListRequest;
import com.tuoheng.admin.service.camera.ICameraService;
import com.tuoheng.common.utils.JsonResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
* @desc: 摄像头
* @team: tuoheng
* @author: wanjing
* @date: 2023-02-06
*/
@RestController
@RequestMapping("/camera")
public class CameraController {

@Autowired
private ICameraService cameraService;

/**
* 查询摄像头列表
*/
@GetMapping("/list")
public JsonResult getList(QueryCameraListRequest request) {
return cameraService.getList(request);
}

/**
* 获取摄像头详细信息
*/
@GetMapping(value = "/{id}")
public JsonResult getOneById(@PathVariable("id") Integer id) {
return cameraService.getOneById(id);
}


}

+ 32
- 0
tuoheng-admin/src/main/java/com/tuoheng/admin/controller/GoodsController.java View File

package com.tuoheng.admin.controller;

import com.tuoheng.admin.entity.request.goods.QueryGoodsListRequest;
import com.tuoheng.admin.service.goods.IGoodsService;
import com.tuoheng.common.utils.JsonResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
* @desc: 物资
* @team: tuoheng
* @author: wanjing
* @date: 2023-02-06
*/
@RestController
@RequestMapping("/goods")
public class GoodsController {

@Autowired
private IGoodsService goodsService;

/**
* 查询物资列表
*/
@GetMapping("/list")
public JsonResult getList(QueryGoodsListRequest request) {
return goodsService.getList(request);
}

}

+ 41
- 0
tuoheng-admin/src/main/java/com/tuoheng/admin/controller/WarehouseController.java View File

package com.tuoheng.admin.controller;

import com.tuoheng.admin.entity.request.warehouse.QueryWarehousePageListRequest;
import com.tuoheng.admin.service.warehouse.IWarehouseService;
import com.tuoheng.common.utils.JsonResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
* @desc: 仓库
* @team: tuoheng
* @author: wanjing
* @date: 2023-02-06
*/
@RestController
@RequestMapping("/warehouse")
public class WarehouseController {

@Autowired
private IWarehouseService warehouseService;

/**
* 查询仓库列表
*/
@GetMapping("/page/list")
public JsonResult getPagelist(QueryWarehousePageListRequest request) {
return warehouseService.getPagelist(request);
}

/**
* 获取仓库详细信息
*/
@GetMapping(value = "/{id}")
public JsonResult getOneById(@PathVariable("id") Integer id) {
return warehouseService.getOneById(id);
}

}

+ 42
- 0
tuoheng-admin/src/main/java/com/tuoheng/admin/controller/WarningController.java View File

package com.tuoheng.admin.controller;

import com.tuoheng.admin.entity.request.warning.QueryWarningListRequest;
import com.tuoheng.admin.service.warning.IWarningService;
import com.tuoheng.common.utils.JsonResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
* @desc: 预警
* @team: tuoheng
* @author: wanjing
* @date: 2023-02-06
*/
@RestController
@RequestMapping("/warning")
public class WarningController {

@Autowired
private IWarningService warningService;

/**
* 查询预警列表
*/
@GetMapping("/list")
public JsonResult list(QueryWarningListRequest request) {
return warningService.getList(request);
}

/**
* 获取预警详细信息
*/
@GetMapping(value = "/{id}")
public JsonResult getOneById(@PathVariable("id") Integer id) {
return warningService.getOneById(id);
}


}

+ 32
- 0
tuoheng-admin/src/main/java/com/tuoheng/admin/controller/WarningRecordController.java View File

package com.tuoheng.admin.controller;

import com.tuoheng.admin.entity.request.warningrecord.QueryWarningRecordListRequest;
import com.tuoheng.admin.service.warningrecord.IWarningRecordService;
import com.tuoheng.common.utils.JsonResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
* @desc: 预警记录
* @team: tuoheng
* @author: wanjing
* @date: 2023-02-06
*/
@RestController
@RequestMapping("/warning/record")
public class WarningRecordController {

@Autowired
private IWarningRecordService warningRecordService;

/**
* 查询预警记录列表
*/
@GetMapping("/list")
public JsonResult list(QueryWarningRecordListRequest request) {
return warningRecordService.getList(request);
}

}

+ 65
- 0
tuoheng-admin/src/main/java/com/tuoheng/admin/entity/domain/Camera.java View File

package com.tuoheng.admin.entity.domain;
import com.baomidou.mybatisplus.annotation.TableName;
import com.tuoheng.common.common.BaseEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import java.io.Serializable;
/**
* 摄像头对象 th_camera
*
* @author wanjing
* @team tuoheng
* @date 2023-02-06
*/
@Data
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@TableName("th_camera")
public class Camera extends BaseEntity implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 租户ID
*/
private Integer tenantId;
/**
* 摄像头名称
*/
private String cameraName;
/**
* 设备类型 1枪机 2球机
*/
private String cameraType;
/**
* 经度
*/
private String longitude;
/**
* 纬度
*/
private String latitude;
/**
* 位置名称
*/
private String location;
/**
* flv地址
*/
private String flvUrl;
/**
* 备注
*/
private String remark;
}

+ 56
- 0
tuoheng-admin/src/main/java/com/tuoheng/admin/entity/domain/Goods.java View File

package com.tuoheng.admin.entity.domain;
import com.baomidou.mybatisplus.annotation.TableName;
import com.tuoheng.common.common.BaseEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import java.io.Serializable;
/**
* 物资对象 th_goods
*
* @author wanjing
* @team tuoheng
* @date 2023-02-06
*/
@Data
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@TableName("th_goods")
public class Goods extends BaseEntity implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 租户ID
*/
private Integer tenantId;
/**
* 仓库ID
*/
private Integer warehouseId;
/**
* 物资名称
*/
private String goodsName;
/**
* 物资类型 1个人防护装备 2搜救装备 3医疗及防疫设备及常用应急药品 4应急照明设备 5灭火处置设备
*/
private String goodsType;
/**
* 物资库存
*/
private String goodsStock;
/**
* 物资作用
*/
private String goodsAction;
}

+ 51
- 0
tuoheng-admin/src/main/java/com/tuoheng/admin/entity/domain/Warehouse.java View File

package com.tuoheng.admin.entity.domain;
import com.baomidou.mybatisplus.annotation.TableName;
import com.tuoheng.common.common.BaseEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import java.io.Serializable;
/**
* 仓库对象 th_warehouse
*
* @author wanjing
* @team tuoheng
* @date 2023-02-06
*/
@Data
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@TableName("th_warehouse")
public class Warehouse extends BaseEntity implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 租户ID
*/
private Integer tenantId;
/**
* 仓库名称
*/
private String warehouseName;
/**
* 经度
*/
private String longitude;
/**
* 纬度
*/
private String latitude;
/**
* 位置名称
*/
private String location;
}

+ 66
- 0
tuoheng-admin/src/main/java/com/tuoheng/admin/entity/domain/Warning.java View File

package com.tuoheng.admin.entity.domain;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.tuoheng.common.common.BaseEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import org.springframework.format.annotation.DateTimeFormat;
import java.io.Serializable;
import java.util.Date;
/**
* 预警对象 th_warning
*
* @author wanjing
* @team tuoheng
* @date 2023-02-06
*/
@Data
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@TableName("th_warning")
public class Warning extends BaseEntity implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 租户ID
*/
private Integer tenantId;
/**
* 发现方式 1监控摄像 2无人机巡检 3人工巡检
*/
private String discoveryWay;
/**
* 火灾位置名称
*/
private String location;
/**
* 预警状态 1待确认 2确认 3忽略
*/
private String status;
/**
* 问题ID
*/
private Integer questionId;
/**
* 处理人
*/
private Integer checkUser;
/**
* 处理时间
*/
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
private Date checkTime;
}

+ 47
- 0
tuoheng-admin/src/main/java/com/tuoheng/admin/entity/domain/WarningRecord.java View File

package com.tuoheng.admin.entity.domain;
import com.baomidou.mybatisplus.annotation.TableName;
import com.tuoheng.common.common.BaseEntity;
import io.swagger.models.auth.In;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import java.io.Serializable;
/**
* 预警记录对象 th_warning_record
*
* @author wanjing
* @team tuoheng
* @date 2023-02-06
*/
@Data
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@TableName("th_warning_record")
public class WarningRecord extends BaseEntity implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 租户ID
*/
private Integer tenantId;
/**
* 预警ID
*/
private Integer warningId;
/**
* 记录名称
*/
private String name;
/**
* 任务ID
*/
private Integer missionId;
}

+ 21
- 0
tuoheng-admin/src/main/java/com/tuoheng/admin/entity/request/camera/QueryCameraListRequest.java View File

package com.tuoheng.admin.entity.request.camera;

import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.io.Serializable;

/**
* 查询摄像头列表任务请求实体
*
* @author: qiujinyang
*/
@Data
public class QueryCameraListRequest implements Serializable {

private static final long serialVersionUID = 1L;

@ApiModelProperty(value = "租户Id", hidden = true)
private Integer tenantId;

}

+ 21
- 0
tuoheng-admin/src/main/java/com/tuoheng/admin/entity/request/goods/QueryGoodsListRequest.java View File

package com.tuoheng.admin.entity.request.goods;

import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.io.Serializable;

/**
* 查询摄像头列表请求实体
*
* @author: qiujinyang
*/
@Data
public class QueryGoodsListRequest implements Serializable {

private static final long serialVersionUID = 1L;

@ApiModelProperty(value = "租户Id", hidden = true)
private Integer tenantId;

}

+ 21
- 0
tuoheng-admin/src/main/java/com/tuoheng/admin/entity/request/warehouse/QueryWarehousePageListRequest.java View File

package com.tuoheng.admin.entity.request.warehouse;

import com.tuoheng.common.common.BaseQuery;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.io.Serializable;

/**
* 查询仓库列表请求实体
* @author: qiujinyang
*/
@Data
public class QueryWarehousePageListRequest extends BaseQuery implements Serializable {

private static final long serialVersionUID = 1L;

@ApiModelProperty(value = "租户Id",hidden = true)
private Integer tenantId;

}

+ 21
- 0
tuoheng-admin/src/main/java/com/tuoheng/admin/entity/request/warning/QueryWarningListRequest.java View File

package com.tuoheng.admin.entity.request.warning;

import com.tuoheng.common.common.BaseQuery;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.io.Serializable;

/**
* 查询预警列表请求实体
* @author: qiujinyang
*/
@Data
public class QueryWarningListRequest implements Serializable {

private static final long serialVersionUID = 1L;

@ApiModelProperty(value = "租户Id",hidden = true)
private Integer tenantId;

}

+ 21
- 0
tuoheng-admin/src/main/java/com/tuoheng/admin/entity/request/warningrecord/QueryWarningRecordListRequest.java View File

package com.tuoheng.admin.entity.request.warningrecord;

import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.io.Serializable;

/**
* 查询预警记录列表请求实体
*
* @author: qiujinyang
*/
@Data
public class QueryWarningRecordListRequest implements Serializable {

private static final long serialVersionUID = 1L;

@ApiModelProperty(value = "租户Id", hidden = true)
private Integer tenantId;

}

+ 25
- 0
tuoheng-admin/src/main/java/com/tuoheng/admin/enums/MarkEnum.java View File

package com.tuoheng.admin.enums;

import lombok.Getter;

/**
* 逻辑删除标记类型
* @author chenyukun
*/

public enum MarkEnum {
VALID(1,"有效"),

NOTVALID(0,"失效");

MarkEnum(int code, String description){
this.code = code;
this.description = description;
}

@Getter
private int code;

@Getter
private String description;
}

+ 33
- 0
tuoheng-admin/src/main/java/com/tuoheng/admin/mapper/CameraMapper.java View File

package com.tuoheng.admin.mapper;

import com.tuoheng.admin.entity.domain.Camera;
import com.tuoheng.admin.entity.request.camera.QueryCameraListRequest;

import java.util.List;

/**
* 摄像头Mapper接口
*
* @author wanjing
* @team tuoheng
* @date 2023-02-06
*/
public interface CameraMapper {

/**
* 查询摄像头列表
*
* @param request 摄像头
* @return 摄像头集合
*/
List<Camera> selectList(QueryCameraListRequest request);

/**
* 查询摄像头
*
* @param id 摄像头主键
* @return 摄像头
*/
Camera selectOneById(String id);

}

+ 34
- 0
tuoheng-admin/src/main/java/com/tuoheng/admin/mapper/GoodsMapper.java View File

package com.tuoheng.admin.mapper;

import java.util.List;

import com.tuoheng.admin.entity.domain.Goods;
import com.tuoheng.admin.entity.request.goods.QueryGoodsListRequest;

/**
* 物资Mapper接口
*
* @team tuoheng
* @author wanjing
* @date 2023-02-06
*/
public interface GoodsMapper {

/**
* 查询物资列表
*
* @param request 物资
* @return 物资集合
*/
List<Goods> getList(QueryGoodsListRequest request);

/**
* 查询物资
*
* @param id 物资主键
* @return 物资
*/
Goods getOneById(Integer id);


}

+ 36
- 0
tuoheng-admin/src/main/java/com/tuoheng/admin/mapper/WarehouseMapper.java View File

package com.tuoheng.admin.mapper;

import java.util.List;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.tuoheng.admin.entity.domain.Warehouse;
import com.tuoheng.admin.entity.request.warehouse.QueryWarehousePageListRequest;
import org.apache.ibatis.annotations.Param;

/**
* 仓库Mapper接口
*
* @team tuoheng
* @author wanjing
* @date 2023-02-06
*/
public interface WarehouseMapper extends BaseMapper<Warehouse> {

/**
* 查询仓库分页列表
*
* @param request 仓库
* @return 仓库集合
*/
Page<Warehouse> selectPageList(@Param("page") IPage page, @Param("request") QueryWarehousePageListRequest request);

/**
* 查询仓库
*
* @param id 仓库主键
* @return 仓库
*/
Warehouse getOneById(Integer id);
}

+ 32
- 0
tuoheng-admin/src/main/java/com/tuoheng/admin/mapper/WarningMapper.java View File

package com.tuoheng.admin.mapper;

import com.tuoheng.admin.entity.domain.Warning;
import com.tuoheng.admin.entity.request.warning.QueryWarningListRequest;

import java.util.List;

/**
* 预警Mapper接口
*
* @team tuoheng
* @author wanjing
* @date 2023-02-06
*/
public interface WarningMapper {

/**
* 查询预警列表
*
* @param thWarning 预警
* @return 预警集合
*/
List<Warning> getList(QueryWarningListRequest thWarning);

/**
* 查询预警
*
* @param id 预警主键
* @return 预警
*/
Warning getOneById(Integer id);
}

+ 33
- 0
tuoheng-admin/src/main/java/com/tuoheng/admin/mapper/WarningRecordMapper.java View File

package com.tuoheng.admin.mapper;

import com.tuoheng.admin.entity.domain.WarningRecord;
import com.tuoheng.admin.entity.request.warningrecord.QueryWarningRecordListRequest;

import java.util.List;

/**
* 预警记录Mapper接口
*
* @team tuoheng
* @author wanjing
* @date 2023-02-06
*/
public interface WarningRecordMapper {

/**
* 查询预警记录列表
*
* @param request 预警记录
* @return 预警记录集合
*/
List<WarningRecord> getList(QueryWarningRecordListRequest request);

/**
* 查询预警记录
*
* @param id 预警记录主键
* @return 预警记录
*/
WarningRecord getOneById(Integer id);

}

+ 44
- 0
tuoheng-admin/src/main/java/com/tuoheng/admin/service/camera/CameraServiceImpl.java View File

package com.tuoheng.admin.service.camera;
import com.tuoheng.admin.entity.request.camera.QueryCameraListRequest;
import com.tuoheng.admin.service.camera.query.QueryCameraListService;
import com.tuoheng.common.utils.JsonResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
/**
* 摄像头Service业务层处理
*
* @team tuoheng
* @author wanjing
* @date 2023-02-06
*/
@Service
public class CameraServiceImpl implements ICameraService {
@Autowired
private QueryCameraListService queryCameraListService;
/**
* 查询摄像头列表
*
* @param request 摄像头
* @return 摄像头
*/
@Override
public JsonResult getList(QueryCameraListRequest request) {
return queryCameraListService.getList(request);
}
/**
* 查询摄像头
*
* @param id 摄像头主键
* @return 摄像头
*/
@Override
public JsonResult getOneById(Integer id) {
return null;
}
}

+ 30
- 0
tuoheng-admin/src/main/java/com/tuoheng/admin/service/camera/ICameraService.java View File

package com.tuoheng.admin.service.camera;
import com.tuoheng.admin.entity.request.camera.QueryCameraListRequest;
import com.tuoheng.common.utils.JsonResult;
/**
* 摄像头Service接口
*
* @team tuoheng
* @author wanjing
* @date 2023-02-06
*/
public interface ICameraService {
/**
* 查询摄像头列表
*
* @param request 查询摄像头列表实体
* @return 摄像头集合
*/
JsonResult getList(QueryCameraListRequest request);
/**
* 查询摄像头
*
* @param id 摄像头主键
* @return 摄像头
*/
JsonResult getOneById(Integer id);
}

+ 54
- 0
tuoheng-admin/src/main/java/com/tuoheng/admin/service/camera/query/QueryCameraByIdService.java View File

package com.tuoheng.admin.service.camera.query;

import com.tuoheng.admin.mapper.CameraMapper;
import com.tuoheng.common.utils.JsonResult;
import com.tuoheng.common.utils.StringUtils;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
* 根据Id查询摄像头业务层处理
*
* @author wanjing
* @team tuoheng
* @date 2022-11-22
*/
@Slf4j
@Service
public class QueryCameraByIdService {

@Autowired
private CameraMapper cameraMapper;

public JsonResult getOneById(String id) {
// log.info("进入根据Id查询摄像头业务");

return JsonResult.success();
}

/**
* 检查参数
*
* @param tenantId
* @param id
* @return
*/
private JsonResult check(String tenantId, String id) {
// 判断部门id是否为空
if (StringUtils.isEmpty(id)) {
return JsonResult.error(500, "id为空");
}
//
// // 判断部门是否存在
// Dept dept = deptMapper.selectOne(new LambdaQueryWrapper<Dept>()
// .eq(Dept::getTenantId, tenantId)
// .eq(Dept::getId, queryInspectionRequest.getDeptId())
// .eq(Dept::getMark, 1));
// if (null == dept) {
// return JsonResult.error(QueryInspectionPageListCodeEnum.DEPT_IS_NOT_EXIST.getCode(), QueryInspectionPageListCodeEnum.DEPT_IS_NOT_EXIST.getMsg());
// }
return JsonResult.success();
}

}

+ 59
- 0
tuoheng-admin/src/main/java/com/tuoheng/admin/service/camera/query/QueryCameraListService.java View File

package com.tuoheng.admin.service.camera.query;

import cn.hutool.core.collection.CollectionUtil;
import com.tuoheng.admin.entity.domain.Camera;
import com.tuoheng.admin.entity.request.camera.QueryCameraListRequest;
import com.tuoheng.admin.mapper.CameraMapper;
import com.tuoheng.common.utils.JsonResult;
import com.tuoheng.system.entity.User;
import com.tuoheng.system.utils.ShiroUtils;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
* 查询监控列表业务层处理
*
* @author wanjing
* @team tuoheng
* @date 2022-11-22
*/
@Slf4j
@Service
public class QueryCameraListService {

@Autowired
private CameraMapper cameraMapper;

public JsonResult getList(QueryCameraListRequest request) {
// log.info("进入查询监控列表业务");
User user = ShiroUtils.getUserInfo();
Integer tenantId = user.getTenantId();
request.setTenantId(tenantId);

JsonResult result = this.check(tenantId, request);
if (0 != result.getCode()) {
log.info("进入查询监控列表业务:校验失败:{}", result.getMsg());
return result;
}
List<Camera> cameraList = cameraMapper.selectList(request);
if (CollectionUtil.isEmpty(cameraList)) {
log.info("监控列表数据为空");
}
return JsonResult.success(cameraList);
}

/**
* 检查参数
*
* @param tenantId
* @param request
* @return
*/
private JsonResult check(Integer tenantId, QueryCameraListRequest request) {
return JsonResult.success();
}

}

+ 44
- 0
tuoheng-admin/src/main/java/com/tuoheng/admin/service/goods/GoodsServiceImpl.java View File

package com.tuoheng.admin.service.goods;
import com.tuoheng.admin.entity.request.goods.QueryGoodsListRequest;
import com.tuoheng.admin.service.goods.query.QueryGoodsListService;
import com.tuoheng.common.utils.JsonResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
/**
* 物资Service业务层处理
*
* @author wanjing
* @team tuoheng
* @date 2023-02-06
*/
@Service
public class GoodsServiceImpl implements IGoodsService {
@Autowired
private QueryGoodsListService queryGoodsListService;
/**
* 查询物资列表
*
* @param request 查询物资列表实体
* @return 摄像头集合
*/
@Override
public JsonResult getList(QueryGoodsListRequest request) {
return queryGoodsListService.getList(request);
}
/**
* 查询物资
*
* @param id 物资主键
* @return 物资
*/
@Override
public JsonResult getOnesById(String id) {
return null;
}
}

+ 32
- 0
tuoheng-admin/src/main/java/com/tuoheng/admin/service/goods/IGoodsService.java View File

package com.tuoheng.admin.service.goods;
import com.tuoheng.admin.entity.request.camera.QueryCameraListRequest;
import com.tuoheng.admin.entity.request.goods.QueryGoodsListRequest;
import com.tuoheng.common.utils.JsonResult;
/**
* 物资Service接口
*
* @author wanjing
* @team tuoheng
* @date 2023-02-06
*/
public interface IGoodsService {
/**
* 查询物资列表
*
* @param request 查询物资列表实体
* @return 摄像头集合
*/
JsonResult getList(QueryGoodsListRequest request);
/**
* 查询物资
*
* @param id 物资主键
* @return 物资
*/
JsonResult getOnesById(String id);
}

+ 64
- 0
tuoheng-admin/src/main/java/com/tuoheng/admin/service/goods/query/QueryGoodsListService.java View File

package com.tuoheng.admin.service.goods.query;

import cn.hutool.core.collection.CollectionUtil;
import com.tuoheng.admin.entity.domain.Camera;
import com.tuoheng.admin.entity.domain.Goods;
import com.tuoheng.admin.entity.request.camera.QueryCameraListRequest;
import com.tuoheng.admin.entity.request.goods.QueryGoodsListRequest;
import com.tuoheng.admin.mapper.CameraMapper;
import com.tuoheng.admin.mapper.GoodsMapper;
import com.tuoheng.common.utils.JsonResult;
import com.tuoheng.system.entity.User;
import com.tuoheng.system.utils.ShiroUtils;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
* 查询物质表业务层处理
*
* @author wanjing
* @team tuoheng
* @date 2022-11-22
*/
@Slf4j
@Service
public class QueryGoodsListService {

@Autowired
private GoodsMapper goodsMapper;

public JsonResult getList(QueryGoodsListRequest request) {
// log.info("进入查询物质列表业务");

User user = ShiroUtils.getUserInfo();
Integer tenantId = user.getTenantId();
request.setTenantId(tenantId);

JsonResult result = this.check(tenantId, request);
if (0 != result.getCode()) {
log.info("进入查询物质列表业务:校验失败:{}", result.getMsg());
return result;
}
List<Goods> cameraList = goodsMapper.getList(request);
if (CollectionUtil.isEmpty(cameraList)) {
log.info("物质列表数据为空");
}
return JsonResult.success(cameraList);
}

/**
* 检查参数
*
* @param tenantId
* @param request
* @return
*/
private JsonResult check(Integer tenantId, QueryGoodsListRequest request) {

return JsonResult.success();
}

}

+ 31
- 0
tuoheng-admin/src/main/java/com/tuoheng/admin/service/warehouse/IWarehouseService.java View File

package com.tuoheng.admin.service.warehouse;
import com.tuoheng.admin.entity.request.warehouse.QueryWarehousePageListRequest;
import com.tuoheng.common.utils.JsonResult;
/**
* 仓库Service接口
*
* @author wanjing
* @team tuoheng
* @date 2023-02-06
*/
public interface IWarehouseService {
/**
* 查询仓库列表
*
* @param request 仓库
* @return 仓库集合
*/
JsonResult getPagelist(QueryWarehousePageListRequest request);
/**
* 查询仓库
*
* @param id 仓库主键
* @return 仓库
*/
JsonResult getOneById(Integer id);
}

+ 44
- 0
tuoheng-admin/src/main/java/com/tuoheng/admin/service/warehouse/WarehouseServiceImpl.java View File

package com.tuoheng.admin.service.warehouse;
import com.tuoheng.admin.entity.request.warehouse.QueryWarehousePageListRequest;
import com.tuoheng.admin.service.warehouse.query.QueryWarehousePageListService;
import com.tuoheng.common.utils.JsonResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
/**
* 仓库Service业务层处理
*
* @author wanjing
* @team tuoheng
* @date 2023-02-06
*/
@Service
public class WarehouseServiceImpl implements IWarehouseService {
@Autowired
private QueryWarehousePageListService queryWarehousePageListService;
/**
* 查询仓库列表
*
* @param request 仓库
* @return 仓库
*/
@Override
public JsonResult getPagelist(QueryWarehousePageListRequest request) {
return queryWarehousePageListService.getPageList(request);
}
/**
* 查询仓库
*
* @param id 仓库主键
* @return 仓库
*/
@Override
public JsonResult getOneById(Integer id) {
return null;
}
}

+ 67
- 0
tuoheng-admin/src/main/java/com/tuoheng/admin/service/warehouse/query/QueryWarehousePageListService.java View File

package com.tuoheng.admin.service.warehouse.query;

import cn.hutool.core.collection.CollectionUtil;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.tuoheng.admin.entity.domain.Warehouse;
import com.tuoheng.admin.entity.domain.Warning;
import com.tuoheng.admin.entity.request.warehouse.QueryWarehousePageListRequest;
import com.tuoheng.admin.entity.request.warning.QueryWarningListRequest;
import com.tuoheng.admin.mapper.WarehouseMapper;
import com.tuoheng.common.utils.JsonResult;
import com.tuoheng.system.entity.User;
import com.tuoheng.system.utils.ShiroUtils;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
* 查询仓库分页业务层处理
*
* @author wanjing
* @team tuoheng
* @date 2022-11-22
*/
@Slf4j
@Service
public class QueryWarehousePageListService {

@Autowired
private WarehouseMapper warehouseMapper;

public JsonResult getPageList(QueryWarehousePageListRequest request) {
// log.info("进入查询仓库分页列表业务");
User user = ShiroUtils.getUserInfo();
Integer tenantId = user.getTenantId();
request.setTenantId(tenantId);

JsonResult result = this.check(tenantId, request);
if (0 != result.getCode()) {
log.info("进入查询仓库分页列表业务:校验失败:{}", result.getMsg());
return result;
}
// 设置分页参数
IPage<Warehouse> page = new Page<>(request.getPage(), request.getLimit());
// 查询结果
IPage<Warehouse> pageData = warehouseMapper.selectPageList(page, request);
if (CollectionUtil.isEmpty(pageData.getRecords())) {
log.info("仓库分页列表数据为空");
}
return JsonResult.success(pageData);
}

/**
* 检查参数
*
* @param tenantId
* @param request
* @return
*/
private JsonResult check(Integer tenantId, QueryWarehousePageListRequest request) {

return JsonResult.success();
}

}

+ 31
- 0
tuoheng-admin/src/main/java/com/tuoheng/admin/service/warning/IWarningService.java View File

package com.tuoheng.admin.service.warning;
import com.tuoheng.admin.entity.request.warning.QueryWarningListRequest;
import com.tuoheng.common.utils.JsonResult;
/**
* 预警Service接口
*
* @author wanjing
* @team tuoheng
* @date 2023-02-06
*/
public interface IWarningService {
/**
* 查询预警列表
*
* @param request 预警
* @return 预警集合
*/
JsonResult getList(QueryWarningListRequest request);
/**
* 查询预警
*
* @param id 预警主键
* @return 预警
*/
JsonResult getOneById(Integer id);
}

+ 44
- 0
tuoheng-admin/src/main/java/com/tuoheng/admin/service/warning/WarningServiceImpl.java View File

package com.tuoheng.admin.service.warning;
import com.tuoheng.admin.entity.request.warning.QueryWarningListRequest;
import com.tuoheng.admin.service.warning.query.QueryWarningListService;
import com.tuoheng.common.utils.JsonResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
/**
* 预警Service业务层处理
*
* @author wanjing
* @team tuoheng
* @date 2023-02-06
*/
@Service
public class WarningServiceImpl implements IWarningService {
@Autowired
private QueryWarningListService queryWarningListService;
/**
* 查询预警列表
*
* @param request 预警
* @return 预警
*/
@Override
public JsonResult getList(QueryWarningListRequest request) {
return queryWarningListService.getList(request);
}
/**
* 查询预警
*
* @param id 预警主键
* @return 预警
*/
@Override
public JsonResult getOneById(Integer id) {
return null;
}
}

+ 63
- 0
tuoheng-admin/src/main/java/com/tuoheng/admin/service/warning/query/QueryWarningListService.java View File

package com.tuoheng.admin.service.warning.query;

import cn.hutool.core.collection.CollectionUtil;
import com.tuoheng.admin.entity.domain.Goods;
import com.tuoheng.admin.entity.domain.Warning;
import com.tuoheng.admin.entity.request.goods.QueryGoodsListRequest;
import com.tuoheng.admin.entity.request.warning.QueryWarningListRequest;
import com.tuoheng.admin.mapper.GoodsMapper;
import com.tuoheng.admin.mapper.WarningMapper;
import com.tuoheng.common.utils.JsonResult;
import com.tuoheng.system.entity.User;
import com.tuoheng.system.utils.ShiroUtils;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
* 查询预警业务层处理
*
* @author wanjing
* @team tuoheng
* @date 2022-11-22
*/
@Slf4j
@Service
public class QueryWarningListService {

@Autowired
private WarningMapper warningMapper;

public JsonResult getList(QueryWarningListRequest request) {
// log.info("进入查询预警列表业务");
User user = ShiroUtils.getUserInfo();
Integer tenantId = user.getTenantId();
request.setTenantId(tenantId);

JsonResult result = this.check(tenantId, request);
if (0 != result.getCode()) {
log.info("进入查询预警列表业务:校验失败:{}", result.getMsg());
return result;
}
List<Warning> warningList = warningMapper.getList(request);
if (CollectionUtil.isEmpty(warningList)) {
log.info("预警列表数据为空");
}
return JsonResult.success(warningList);
}

/**
* 检查参数
*
* @param tenantId
* @param request
* @return
*/
private JsonResult check(Integer tenantId, QueryWarningListRequest request) {

return JsonResult.success();
}

}

+ 31
- 0
tuoheng-admin/src/main/java/com/tuoheng/admin/service/warningrecord/IWarningRecordService.java View File

package com.tuoheng.admin.service.warningrecord;
import com.tuoheng.admin.entity.request.warningrecord.QueryWarningRecordListRequest;
import com.tuoheng.common.utils.JsonResult;
/**
* 预警记录Service接口
*
* @author wanjing
* @team tuoheng
* @date 2023-02-06
*/
public interface IWarningRecordService {
/**
* 查询预警记录列表
*
* @param request 预警记录
* @return 预警记录集合
*/
JsonResult getList(QueryWarningRecordListRequest request);
/**
* 查询预警记录
*
* @param id 预警记录主键
* @return 预警记录
*/
JsonResult getOneById(String id);
}

+ 38
- 0
tuoheng-admin/src/main/java/com/tuoheng/admin/service/warningrecord/WarningRecordServiceImpl.java View File

package com.tuoheng.admin.service.warningrecord;
import com.tuoheng.admin.entity.request.warningrecord.QueryWarningRecordListRequest;
import com.tuoheng.common.utils.JsonResult;
import org.springframework.stereotype.Service;
/**
* 预警记录Service业务层处理
*
* @author wanjing
* @team tuoheng
* @date 2023-02-06
*/
@Service
public class WarningRecordServiceImpl implements IWarningRecordService {
/**
* 查询预警记录列表
*
* @param request 预警记录
* @return 预警记录
*/
@Override
public JsonResult getList(QueryWarningRecordListRequest request) {
return null;
}
/**
* 查询预警记录
*
* @param id 预警记录主键
* @return 预警记录
*/
@Override
public JsonResult getOneById(String id) {
return null;
}
}

+ 65
- 0
tuoheng-admin/src/main/java/com/tuoheng/admin/service/warningrecord/query/QueryWarningRecordListService.java View File

package com.tuoheng.admin.service.warningrecord.query;

import cn.hutool.core.collection.CollectionUtil;
import com.tuoheng.admin.entity.domain.Warning;
import com.tuoheng.admin.entity.domain.WarningRecord;
import com.tuoheng.admin.entity.request.warning.QueryWarningListRequest;
import com.tuoheng.admin.entity.request.warningrecord.QueryWarningRecordListRequest;
import com.tuoheng.admin.mapper.WarningMapper;
import com.tuoheng.admin.mapper.WarningRecordMapper;
import com.tuoheng.common.utils.JsonResult;
import com.tuoheng.system.entity.User;
import com.tuoheng.system.utils.ShiroUtils;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
* 查询预警记录业务层处理
*
* @author wanjing
* @team tuoheng
* @date 2022-11-22
*/
@Slf4j
@Service
public class QueryWarningRecordListService {

@Autowired
private WarningRecordMapper warningRecordMapper;

public JsonResult getList(QueryWarningRecordListRequest request) {
// log.info("进入查询预警记录列表业务");

User user = ShiroUtils.getUserInfo();
Integer userId = user.getId();
Integer tenantId = user.getTenantId();
request.setTenantId(tenantId);

JsonResult result = this.check(tenantId, request);
if (0 != result.getCode()) {
log.info("进入查询预警记录列表业务:校验失败:{}", result.getMsg());
return result;
}
List<WarningRecord> warningRecordList = warningRecordMapper.getList(request);
if (CollectionUtil.isEmpty(warningRecordList)) {
log.info("预警记录列表数据为空");
}
return JsonResult.success(warningRecordList);
}

/**
* 检查参数
*
* @param tenantId
* @param request
* @return
*/
private JsonResult check(Integer tenantId, QueryWarningRecordListRequest request) {

return JsonResult.success();
}

}

+ 42
- 0
tuoheng-admin/src/main/resources/mapper/CameraMapper.xml View File

<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.tuoheng.admin.mapper.CameraMapper">
<resultMap type="com.tuoheng.admin.entity.domain.Camera" id="CameraResult">
<result property="id" column="id" />
<result property="tenantId" column="tenant_id" />
<result property="cameraName" column="camera_name" />
<result property="cameraType" column="camera_type" />
<result property="longitude" column="longitude" />
<result property="latitude" column="latitude" />
<result property="location" column="location" />
<result property="flvUrl" column="flv_url" />
<result property="remark" column="remark" />
<result property="createUser" column="create_user" />
<result property="createTime" column="create_time" />
<result property="updateUser" column="update_user" />
<result property="updateTime" column="update_time" />
<result property="mark" column="mark" />
</resultMap>

<sql id="selectCameraVo">
select id, tenant_id, camera_name, camera_type, longitude, latitude, location, flv_url, remark, create_user, create_time, update_user, update_time, mark from th_camera
</sql>

<select id="selectList" parameterType="com.tuoheng.admin.entity.request.camera.QueryCameraListRequest" resultMap="CameraResult">
<include refid="selectCameraVo"/>
<where>
<if test="1 == 1"> and mark = 1 </if>
<if test="tenantId != null "> and tenant_id = #{tenantId}</if>
</where>
order by create_time desc
</select>
<select id="selectOneById" parameterType="Integer" resultMap="CameraResult">
<include refid="selectCameraVo"/>
where mark = 1 and id = #{id}
</select>

</mapper>

+ 40
- 0
tuoheng-admin/src/main/resources/mapper/GoodsMapper.xml View File

<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.tuoheng.admin.mapper.GoodsMapper">
<resultMap type="com.tuoheng.admin.entity.domain.Goods" id="GoodsResult">
<result property="id" column="id" />
<result property="tenantId" column="tenant_id" />
<result property="warehouseId" column="warehouse_id" />
<result property="goodsName" column="goods_name" />
<result property="goodsType" column="goods_type" />
<result property="goodsStock" column="goods_stock" />
<result property="goodsAction" column="goods_action" />
<result property="createUser" column="create_user" />
<result property="createTime" column="create_time" />
<result property="updateUser" column="update_user" />
<result property="updateTime" column="update_time" />
<result property="mark" column="mark" />
</resultMap>
<sql id="selectGoodsVo">
select id, tenant_id, warehouse_id, goods_name, goods_type, goods_stock, goods_action, create_user, create_time, update_user, update_time, mark from th_goods
</sql>
<select id="getList" parameterType="com.tuoheng.admin.entity.request.goods.QueryGoodsListRequest" resultMap="GoodsResult">
<include refid="selectGoodsVo"/>
<where>
<if test="1 == 1"> and mark = 1 </if>
<if test="tenantId != null "> and tenant_id = #{tenantId}</if>
</where>
order by create_time desc
</select>
<select id="getOneById" parameterType="Integer" resultMap="GoodsResult">
<include refid="selectGoodsVo"/>
where mark = 1 and id = #{id}
</select>
</mapper>

+ 39
- 0
tuoheng-admin/src/main/resources/mapper/WarehouseMapper.xml View File

<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.tuoheng.admin.mapper.WarehouseMapper">
<resultMap type="com.tuoheng.admin.entity.domain.Warehouse" id="WarehouseResult">
<result property="id" column="id" />
<result property="tenantId" column="tenant_id" />
<result property="warehouseName" column="warehouse_name" />
<result property="longitude" column="longitude" />
<result property="latitude" column="latitude" />
<result property="location" column="location" />
<result property="createUser" column="create_user" />
<result property="createTime" column="create_time" />
<result property="updateUser" column="update_user" />
<result property="updateTime" column="update_time" />
<result property="mark" column="mark" />
</resultMap>
<sql id="selectWarehouseVo">
select id, tenant_id, warehouse_name, longitude, latitude, location, create_user, create_time, update_user, update_time, mark from th_warehouse
</sql>
<select id="selectPageList" parameterType="com.tuoheng.admin.entity.request.warehouse.QueryWarehousePageListRequest" resultMap="WarehouseResult">
<include refid="selectWarehouseVo"/>
<where>
<if test="1 == 1"> and mark = 1 </if>
<if test="request.tenantId != null and request.tenantId != 0"> and tenant_id = #{request.tenantId}</if>
</where>
order by create_time desc
</select>
<select id="getOneById" parameterType="Integer" resultMap="WarehouseResult">
<include refid="selectWarehouseVo"/>
where mark = 1 and id = #{id}
</select>
</mapper>

+ 41
- 0
tuoheng-admin/src/main/resources/mapper/WarningMapper.xml View File

<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.tuoheng.admin.mapper.WarningMapper">
<resultMap type="com.tuoheng.admin.entity.domain.Warning" id="WarningResult">
<result property="id" column="id" />
<result property="tenantId" column="tenant_id" />
<result property="discoveryWay" column="discovery_way" />
<result property="location" column="location" />
<result property="status" column="status" />
<result property="questionId" column="question_id" />
<result property="createUser" column="create_user" />
<result property="createTime" column="create_time" />
<result property="updateUser" column="update_user" />
<result property="updateTime" column="update_time" />
<result property="checkUser" column="check_user" />
<result property="checkTime" column="check_time" />
<result property="mark" column="mark" />
</resultMap>
<sql id="selectWarningVo">
select id, tenant_id, discovery_way, location, status, question_id, create_user, create_time, update_user, update_time, check_user, check_time, mark from th_warning
</sql>
<select id="getList" parameterType="com.tuoheng.admin.entity.request.warning.QueryWarningListRequest" resultMap="WarningResult">
<include refid="selectWarningVo"/>
<where>
<if test="1 == 1"> and mark = 1 </if>
<if test="tenantId != null "> and tenant_id = #{tenantId}</if>
</where>
order by create_time desc
</select>
<select id="getOneById" parameterType="Integer" resultMap="WarningResult">
<include refid="selectWarningVo"/>
where mark = 1 and id = #{id}
</select>
</mapper>

+ 38
- 0
tuoheng-admin/src/main/resources/mapper/WarningRecordMapper.xml View File

<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.tuoheng.admin.mapper.WarningRecordMapper">
<resultMap type="com.tuoheng.admin.entity.domain.WarningRecord" id="WarningRecordResult">
<result property="id" column="id" />
<result property="tenantId" column="tenant_id" />
<result property="warningId" column="warning_id" />
<result property="name" column="name" />
<result property="missionId" column="mission_id" />
<result property="createUser" column="create_user" />
<result property="createTime" column="create_time" />
<result property="updateUser" column="update_user" />
<result property="updateTime" column="update_time" />
<result property="mark" column="mark" />
</resultMap>
<sql id="selectWarningRecordVo">
select id, tenant_id, warning_id, name, mission_id, create_user, create_time, update_user, update_time, mark from th_warning_record
</sql>
<select id="getList" parameterType="com.tuoheng.admin.entity.request.warningrecord.QueryWarningRecordListRequest" resultMap="WarningRecordResult">
<include refid="selectWarningRecordVo"/>
<where>
<if test="1 == 1"> and mark = 1 </if>
<if test="tenantId != null "> and tenant_id = #{tenantId}</if>
</where>
order by create_time desc
</select>
<select id="getOneById" parameterType="Integer" resultMap="WarningRecordResult">
<include refid="selectWarningRecordVo"/>
where mark = 1 and id = #{id}
</select>
</mapper>

Loading…
Cancel
Save