@@ -1,69 +1,69 @@ | |||
package com.tuoheng.admin.entity.domain; | |||
import com.baomidou.mybatisplus.annotation.TableField; | |||
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 Integer cameraType; | |||
/** | |||
* 经度 | |||
*/ | |||
private String longitude; | |||
/** | |||
* 纬度 | |||
*/ | |||
private String latitude; | |||
/** | |||
* 位置名称 | |||
*/ | |||
private String location; | |||
/** | |||
* flv地址 | |||
*/ | |||
private String flvUrl; | |||
/** | |||
* 备注 | |||
*/ | |||
private String remark; | |||
@TableField(exist = false) | |||
private String updateUserName; | |||
} | |||
package com.tuoheng.admin.entity.domain; | |||
import com.baomidou.mybatisplus.annotation.TableField; | |||
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 Integer cameraType; | |||
/** | |||
* 经度 | |||
*/ | |||
private String longitude; | |||
/** | |||
* 纬度 | |||
*/ | |||
private String latitude; | |||
/** | |||
* 位置名称 | |||
*/ | |||
private String location; | |||
/** | |||
* flv地址 | |||
*/ | |||
private String flvUrl; | |||
/** | |||
* 备注 | |||
*/ | |||
private String remark; | |||
@TableField(exist = false) | |||
private String updateUserName; | |||
} |
@@ -1,60 +1,60 @@ | |||
package com.tuoheng.admin.entity.domain; | |||
import com.baomidou.mybatisplus.annotation.TableField; | |||
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 Integer goodsType; | |||
/** | |||
* 物资库存 | |||
*/ | |||
private String goodsStock; | |||
/** | |||
* 物资作用 | |||
*/ | |||
private String goodsAction; | |||
@TableField(exist = false) | |||
private String updateUserName; | |||
} | |||
package com.tuoheng.admin.entity.domain; | |||
import com.baomidou.mybatisplus.annotation.TableField; | |||
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 Integer goodsType; | |||
/** | |||
* 物资库存 | |||
*/ | |||
private String goodsStock; | |||
/** | |||
* 物资作用 | |||
*/ | |||
private String goodsAction; | |||
@TableField(exist = false) | |||
private String updateUserName; | |||
} |
@@ -1,55 +1,55 @@ | |||
package com.tuoheng.admin.entity.domain; | |||
import com.baomidou.mybatisplus.annotation.TableField; | |||
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; | |||
@TableField(exist = false) | |||
private String updateUserName; | |||
} | |||
package com.tuoheng.admin.entity.domain; | |||
import com.baomidou.mybatisplus.annotation.TableField; | |||
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; | |||
@TableField(exist = false) | |||
private String updateUserName; | |||
} |
@@ -1,75 +1,75 @@ | |||
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; | |||
/** | |||
* 任务ID | |||
*/ | |||
private Integer missionId; | |||
/** | |||
* 发现方式 1监控摄像 2无人机巡检 3人工巡检 | |||
*/ | |||
private Integer discoveryWay; | |||
/** | |||
* 火灾位置名称 | |||
*/ | |||
private String location; | |||
/** | |||
* 预警状态 1待确认 2确认 3忽略 | |||
*/ | |||
private Integer 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; | |||
/** | |||
* 处理结果 | |||
*/ | |||
private String checkResult; | |||
} | |||
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; | |||
/** | |||
* 任务ID | |||
*/ | |||
private Integer missionId; | |||
/** | |||
* 发现方式 1监控摄像 2无人机巡检 3人工巡检 | |||
*/ | |||
private Integer discoveryWay; | |||
/** | |||
* 火灾位置名称 | |||
*/ | |||
private String location; | |||
/** | |||
* 预警状态 1待确认 2确认 3忽略 | |||
*/ | |||
private Integer 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; | |||
/** | |||
* 处理结果 | |||
*/ | |||
private String checkResult; | |||
} |
@@ -1,52 +1,52 @@ | |||
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; | |||
/** | |||
* 应急任务ID | |||
*/ | |||
private Integer emergencyMissionId; | |||
} | |||
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; | |||
/** | |||
* 应急任务ID | |||
*/ | |||
private Integer emergencyMissionId; | |||
} |
@@ -11,9 +11,9 @@ public enum QuestionTypeEnum { | |||
Q2("002001","病死树"), | |||
Q3("002003","人员活动"), | |||
Q3("002003","火焰"), | |||
Q4("002004","火灾隐患"); | |||
Q4("002004","烟雾"); | |||
QuestionTypeEnum(String code, String description){ | |||
this.code = code; |
@@ -1,121 +1,121 @@ | |||
package com.tuoheng.admin.service.camera; | |||
import cn.hutool.core.util.ObjectUtil; | |||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; | |||
import com.baomidou.mybatisplus.core.metadata.IPage; | |||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; | |||
import com.tuoheng.admin.common.ServiceExceptionEnum; | |||
import com.tuoheng.admin.entity.domain.Camera; | |||
import com.tuoheng.admin.entity.request.camera.QueryCameraListRequest; | |||
import com.tuoheng.admin.enums.MarkTypeEnum; | |||
import com.tuoheng.admin.mapper.CameraMapper; | |||
import com.tuoheng.admin.service.camera.query.QueryCameraListService; | |||
import com.tuoheng.admin.utils.GaodeUtil; | |||
import com.tuoheng.common.common.BaseServiceImpl; | |||
import com.tuoheng.common.exception.ServiceException; | |||
import com.tuoheng.common.utils.JsonResult; | |||
import com.tuoheng.common.utils.StringUtils; | |||
import com.tuoheng.system.entity.User; | |||
import com.tuoheng.system.mapper.UserMapper; | |||
import com.tuoheng.system.utils.ShiroUtils; | |||
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 extends BaseServiceImpl<CameraMapper, Camera> implements ICameraService { | |||
@Autowired | |||
private QueryCameraListService queryCameraListService; | |||
@Autowired | |||
private CameraMapper cameraMapper; | |||
@Autowired | |||
private UserMapper userMapper; | |||
/** | |||
* 查询摄像头列表 | |||
* | |||
* @param request 摄像头 | |||
* @return 摄像头 | |||
*/ | |||
@Override | |||
public JsonResult getList(QueryCameraListRequest request) { | |||
return queryCameraListService.getList(request); | |||
} | |||
/** | |||
* 查询摄像头 | |||
* | |||
* @param id 摄像头主键 | |||
* @return 摄像头 | |||
*/ | |||
@Override | |||
public JsonResult getOneById(Integer id) { | |||
return null; | |||
} | |||
@Override | |||
public JsonResult editInfo(Camera entity) { | |||
//新增 | |||
if (StringUtils.isNull(entity.getId())) { | |||
if (StringUtils.isEmpty(entity.getCameraName())) { | |||
throw new ServiceException("摄像头名称不能为空"); | |||
} | |||
if (ObjectUtil.isEmpty(entity.getCameraType())) { | |||
throw new ServiceException("设备类型不能为空"); | |||
} | |||
if (StringUtils.isEmpty(entity.getLongitude())) { | |||
throw new ServiceException("经度不能为空"); | |||
} | |||
if (StringUtils.isEmpty(entity.getLatitude())) { | |||
throw new ServiceException("纬度不能为空"); | |||
} | |||
if (StringUtils.isEmpty(entity.getFlvUrl())) { | |||
throw new ServiceException("摄像头地址不能为空"); | |||
} | |||
Integer tenantId = ShiroUtils.getTenantId(); | |||
entity.setTenantId(tenantId); | |||
entity.setCreateUser(ShiroUtils.getUserId()); | |||
} | |||
if(StringUtils.isNotEmpty(entity.getLongitude()) && StringUtils.isNotEmpty(entity.getLatitude())){ | |||
String gaodeAddress = GaodeUtil.getGaodeAddress(entity.getLongitude(), entity.getLatitude()); | |||
entity.setLocation(gaodeAddress); | |||
} | |||
entity.setUpdateUser(ShiroUtils.getUserId()); | |||
super.edit(entity); | |||
return JsonResult.success(); | |||
} | |||
@Override | |||
public JsonResult getPage(QueryCameraListRequest request) { | |||
if (null == request.getPage() || null == request.getLimit()) { | |||
throw new ServiceException(ServiceExceptionEnum.PARAMETER_IS_NULL); | |||
} | |||
// 获取分页数据 | |||
IPage<Camera> page = new Page<>(request.getPage(), request.getLimit()); | |||
IPage<Camera> pageData = cameraMapper.selectPage(page, new LambdaQueryWrapper<Camera>() | |||
.eq(Camera::getMark, MarkTypeEnum.VALID.getCode()) | |||
.eq(Camera::getTenantId, ShiroUtils.getTenantId()) | |||
.like(StringUtils.isNotEmpty(request.getCameraName()), Camera::getCameraName, request.getCameraName()) | |||
.orderByDesc(Camera::getCreateTime)); | |||
for (Camera record : pageData.getRecords()) { | |||
User user = userMapper.selectById(record.getUpdateUser()); | |||
if(ObjectUtil.isNotNull(user)){ | |||
record.setUpdateUserName(user.getRealname()); | |||
} | |||
} | |||
return JsonResult.success(pageData); | |||
} | |||
} | |||
package com.tuoheng.admin.service.camera; | |||
import cn.hutool.core.util.ObjectUtil; | |||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; | |||
import com.baomidou.mybatisplus.core.metadata.IPage; | |||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; | |||
import com.tuoheng.admin.common.ServiceExceptionEnum; | |||
import com.tuoheng.admin.entity.domain.Camera; | |||
import com.tuoheng.admin.entity.request.camera.QueryCameraListRequest; | |||
import com.tuoheng.admin.enums.MarkTypeEnum; | |||
import com.tuoheng.admin.mapper.CameraMapper; | |||
import com.tuoheng.admin.service.camera.query.QueryCameraListService; | |||
import com.tuoheng.admin.utils.GaodeUtil; | |||
import com.tuoheng.common.common.BaseServiceImpl; | |||
import com.tuoheng.common.exception.ServiceException; | |||
import com.tuoheng.common.utils.JsonResult; | |||
import com.tuoheng.common.utils.StringUtils; | |||
import com.tuoheng.system.entity.User; | |||
import com.tuoheng.system.mapper.UserMapper; | |||
import com.tuoheng.system.utils.ShiroUtils; | |||
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 extends BaseServiceImpl<CameraMapper, Camera> implements ICameraService { | |||
@Autowired | |||
private QueryCameraListService queryCameraListService; | |||
@Autowired | |||
private CameraMapper cameraMapper; | |||
@Autowired | |||
private UserMapper userMapper; | |||
/** | |||
* 查询摄像头列表 | |||
* | |||
* @param request 摄像头 | |||
* @return 摄像头 | |||
*/ | |||
@Override | |||
public JsonResult getList(QueryCameraListRequest request) { | |||
return queryCameraListService.getList(request); | |||
} | |||
/** | |||
* 查询摄像头 | |||
* | |||
* @param id 摄像头主键 | |||
* @return 摄像头 | |||
*/ | |||
@Override | |||
public JsonResult getOneById(Integer id) { | |||
return null; | |||
} | |||
@Override | |||
public JsonResult editInfo(Camera entity) { | |||
//新增 | |||
if (StringUtils.isNull(entity.getId())) { | |||
if (StringUtils.isEmpty(entity.getCameraName())) { | |||
throw new ServiceException("摄像头名称不能为空"); | |||
} | |||
if (ObjectUtil.isEmpty(entity.getCameraType())) { | |||
throw new ServiceException("设备类型不能为空"); | |||
} | |||
if (StringUtils.isEmpty(entity.getLongitude())) { | |||
throw new ServiceException("经度不能为空"); | |||
} | |||
if (StringUtils.isEmpty(entity.getLatitude())) { | |||
throw new ServiceException("纬度不能为空"); | |||
} | |||
if (StringUtils.isEmpty(entity.getFlvUrl())) { | |||
throw new ServiceException("摄像头地址不能为空"); | |||
} | |||
Integer tenantId = ShiroUtils.getTenantId(); | |||
entity.setTenantId(tenantId); | |||
entity.setCreateUser(ShiroUtils.getUserId()); | |||
} | |||
if(StringUtils.isNotEmpty(entity.getLongitude()) && StringUtils.isNotEmpty(entity.getLatitude())){ | |||
String gaodeAddress = GaodeUtil.getGaodeAddress(entity.getLongitude(), entity.getLatitude()); | |||
entity.setLocation(gaodeAddress); | |||
} | |||
entity.setUpdateUser(ShiroUtils.getUserId()); | |||
super.edit(entity); | |||
return JsonResult.success(); | |||
} | |||
@Override | |||
public JsonResult getPage(QueryCameraListRequest request) { | |||
if (null == request.getPage() || null == request.getLimit()) { | |||
throw new ServiceException(ServiceExceptionEnum.PARAMETER_IS_NULL); | |||
} | |||
// 获取分页数据 | |||
IPage<Camera> page = new Page<>(request.getPage(), request.getLimit()); | |||
IPage<Camera> pageData = cameraMapper.selectPage(page, new LambdaQueryWrapper<Camera>() | |||
.eq(Camera::getMark, MarkTypeEnum.VALID.getCode()) | |||
.eq(Camera::getTenantId, ShiroUtils.getTenantId()) | |||
.like(StringUtils.isNotEmpty(request.getCameraName()), Camera::getCameraName, request.getCameraName()) | |||
.orderByDesc(Camera::getCreateTime)); | |||
for (Camera record : pageData.getRecords()) { | |||
User user = userMapper.selectById(record.getUpdateUser()); | |||
if(ObjectUtil.isNotNull(user)){ | |||
record.setUpdateUserName(user.getRealname()); | |||
} | |||
} | |||
return JsonResult.success(pageData); | |||
} | |||
} |
@@ -1,71 +1,71 @@ | |||
package com.tuoheng.admin.service.goods; | |||
import cn.hutool.core.util.ObjectUtil; | |||
import com.tuoheng.admin.entity.domain.Goods; | |||
import com.tuoheng.admin.entity.request.goods.QueryGoodsListByWarehouseIdRequest; | |||
import com.tuoheng.admin.mapper.GoodsMapper; | |||
import com.tuoheng.admin.service.goods.query.QueryGoodsListByWarehouseIdService; | |||
import com.tuoheng.admin.utils.GaodeUtil; | |||
import com.tuoheng.common.common.BaseServiceImpl; | |||
import com.tuoheng.common.exception.ServiceException; | |||
import com.tuoheng.common.utils.JsonResult; | |||
import com.tuoheng.common.utils.StringUtils; | |||
import com.tuoheng.system.utils.ShiroUtils; | |||
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 extends BaseServiceImpl<GoodsMapper, Goods> implements IGoodsService { | |||
@Autowired | |||
private QueryGoodsListByWarehouseIdService queryGoodsListService; | |||
/** | |||
* 根据仓库Id查询物资列表 | |||
* | |||
* @param request 查询物资列表实体 | |||
* @return 摄像头集合 | |||
*/ | |||
@Override | |||
public JsonResult getListByWarehouseId(QueryGoodsListByWarehouseIdRequest request) { | |||
return queryGoodsListService.getListByWarehouseId(request); | |||
} | |||
/** | |||
* 查询物资 | |||
* | |||
* @param id 物资主键 | |||
* @return 物资 | |||
*/ | |||
@Override | |||
public JsonResult getOnesById(String id) { | |||
return null; | |||
} | |||
@Override | |||
public JsonResult editInfo(Goods entity) { | |||
//新增 | |||
if (StringUtils.isNull(entity.getId())) { | |||
if (StringUtils.isEmpty(entity.getGoodsName())) { | |||
throw new ServiceException("物资名称不能为空"); | |||
} | |||
if (ObjectUtil.isEmpty(entity.getGoodsType())) { | |||
throw new ServiceException("物资类型不能为空"); | |||
} | |||
Integer tenantId = ShiroUtils.getTenantId(); | |||
entity.setTenantId(tenantId); | |||
entity.setCreateUser(ShiroUtils.getUserId()); | |||
} | |||
entity.setUpdateUser(ShiroUtils.getUserId()); | |||
super.edit(entity); | |||
return JsonResult.success(); | |||
} | |||
} | |||
package com.tuoheng.admin.service.goods; | |||
import cn.hutool.core.util.ObjectUtil; | |||
import com.tuoheng.admin.entity.domain.Goods; | |||
import com.tuoheng.admin.entity.request.goods.QueryGoodsListByWarehouseIdRequest; | |||
import com.tuoheng.admin.mapper.GoodsMapper; | |||
import com.tuoheng.admin.service.goods.query.QueryGoodsListByWarehouseIdService; | |||
import com.tuoheng.admin.utils.GaodeUtil; | |||
import com.tuoheng.common.common.BaseServiceImpl; | |||
import com.tuoheng.common.exception.ServiceException; | |||
import com.tuoheng.common.utils.JsonResult; | |||
import com.tuoheng.common.utils.StringUtils; | |||
import com.tuoheng.system.utils.ShiroUtils; | |||
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 extends BaseServiceImpl<GoodsMapper, Goods> implements IGoodsService { | |||
@Autowired | |||
private QueryGoodsListByWarehouseIdService queryGoodsListService; | |||
/** | |||
* 根据仓库Id查询物资列表 | |||
* | |||
* @param request 查询物资列表实体 | |||
* @return 摄像头集合 | |||
*/ | |||
@Override | |||
public JsonResult getListByWarehouseId(QueryGoodsListByWarehouseIdRequest request) { | |||
return queryGoodsListService.getListByWarehouseId(request); | |||
} | |||
/** | |||
* 查询物资 | |||
* | |||
* @param id 物资主键 | |||
* @return 物资 | |||
*/ | |||
@Override | |||
public JsonResult getOnesById(String id) { | |||
return null; | |||
} | |||
@Override | |||
public JsonResult editInfo(Goods entity) { | |||
//新增 | |||
if (StringUtils.isNull(entity.getId())) { | |||
if (StringUtils.isEmpty(entity.getGoodsName())) { | |||
throw new ServiceException("物资名称不能为空"); | |||
} | |||
if (ObjectUtil.isEmpty(entity.getGoodsType())) { | |||
throw new ServiceException("物资类型不能为空"); | |||
} | |||
Integer tenantId = ShiroUtils.getTenantId(); | |||
entity.setTenantId(tenantId); | |||
entity.setCreateUser(ShiroUtils.getUserId()); | |||
} | |||
entity.setUpdateUser(ShiroUtils.getUserId()); | |||
super.edit(entity); | |||
return JsonResult.success(); | |||
} | |||
} |
@@ -30,6 +30,7 @@ import org.springframework.beans.BeanUtils; | |||
import org.springframework.beans.factory.annotation.Autowired; | |||
import org.springframework.http.HttpStatus; | |||
import org.springframework.stereotype.Service; | |||
import org.springframework.transaction.annotation.Propagation; | |||
import org.springframework.transaction.annotation.Transactional; | |||
import org.springframework.util.CollectionUtils; | |||
@@ -290,6 +291,7 @@ public class QuestionServiceImpl extends BaseServiceImpl<QuestionMapper, Questio | |||
} | |||
@Override | |||
@Transactional(propagation = Propagation.REQUIRED) | |||
public JsonResult process(String requestId, CallbackRequest callbackRequest) throws ServiceException { | |||
ThMission mission = getThMission(requestId); | |||
@@ -402,7 +404,7 @@ public class QuestionServiceImpl extends BaseServiceImpl<QuestionMapper, Questio | |||
for (Question question : questionList) { | |||
Warning warning = new Warning(); | |||
//问题类型为火灾隐患时添加数据 | |||
if (question.getType().equals(QuestionTypeEnum.Q4.getCode())) { | |||
if (question.getType().equals(QuestionTypeEnum.Q4.getCode()) || question.getType().equals(QuestionTypeEnum.Q3.getCode())) { | |||
warning.setTenantId(question.getTenantId()); | |||
warning.setDiscoveryWay(DiscoveryWayEnum.UAV_PATROL.getCode()); | |||
warning.setLocation(""); |
@@ -1,87 +1,87 @@ | |||
package com.tuoheng.admin.service.warehouse; | |||
import com.tuoheng.admin.entity.domain.Warehouse; | |||
import com.tuoheng.admin.entity.request.warehouse.QueryWarehouseListRequest; | |||
import com.tuoheng.admin.entity.request.warehouse.QueryWarehousePageListRequest; | |||
import com.tuoheng.admin.mapper.WarehouseMapper; | |||
import com.tuoheng.admin.service.warehouse.query.QueryWarehouseListService; | |||
import com.tuoheng.admin.service.warehouse.query.QueryWarehousePageListService; | |||
import com.tuoheng.admin.utils.GaodeUtil; | |||
import com.tuoheng.common.common.BaseServiceImpl; | |||
import com.tuoheng.common.exception.ServiceException; | |||
import com.tuoheng.common.utils.JsonResult; | |||
import com.tuoheng.common.utils.StringUtils; | |||
import com.tuoheng.system.utils.ShiroUtils; | |||
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 extends BaseServiceImpl<WarehouseMapper, Warehouse> implements IWarehouseService { | |||
@Autowired | |||
private QueryWarehouseListService queryWarehouseListService; | |||
@Autowired | |||
private QueryWarehousePageListService queryWarehousePageListService; | |||
/** | |||
* 查询仓库列表 | |||
* | |||
* @param request 仓库 | |||
* @return 仓库 | |||
*/ | |||
@Override | |||
public JsonResult getList(QueryWarehouseListRequest request) { | |||
return queryWarehouseListService.getList(request); | |||
} | |||
/** | |||
* 查询仓库分页列表 | |||
* | |||
* @param request 仓库 | |||
* @return 仓库 | |||
*/ | |||
@Override | |||
public JsonResult getPageList(QueryWarehousePageListRequest request) { | |||
return queryWarehousePageListService.getPageList(request); | |||
} | |||
/** | |||
* 查询仓库 | |||
* | |||
* @param id 仓库主键 | |||
* @return 仓库 | |||
*/ | |||
@Override | |||
public JsonResult getOneById(Integer id) { | |||
return null; | |||
} | |||
@Override | |||
public JsonResult editInfo(Warehouse entity) { | |||
//新增 | |||
if (StringUtils.isNull(entity.getId())) { | |||
if (StringUtils.isEmpty(entity.getWarehouseName())) { | |||
throw new ServiceException("仓库名称不能为空"); | |||
} | |||
Integer tenantId = ShiroUtils.getTenantId(); | |||
entity.setTenantId(tenantId); | |||
entity.setCreateUser(ShiroUtils.getUserId()); | |||
} | |||
if (StringUtils.isNotEmpty(entity.getLongitude()) && StringUtils.isNotEmpty(entity.getLatitude())) { | |||
String gaodeAddress = GaodeUtil.getGaodeAddress(entity.getLongitude(), entity.getLatitude()); | |||
entity.setLocation(gaodeAddress); | |||
} | |||
entity.setUpdateUser(ShiroUtils.getUserId()); | |||
super.edit(entity); | |||
return JsonResult.success(); | |||
} | |||
} | |||
package com.tuoheng.admin.service.warehouse; | |||
import com.tuoheng.admin.entity.domain.Warehouse; | |||
import com.tuoheng.admin.entity.request.warehouse.QueryWarehouseListRequest; | |||
import com.tuoheng.admin.entity.request.warehouse.QueryWarehousePageListRequest; | |||
import com.tuoheng.admin.mapper.WarehouseMapper; | |||
import com.tuoheng.admin.service.warehouse.query.QueryWarehouseListService; | |||
import com.tuoheng.admin.service.warehouse.query.QueryWarehousePageListService; | |||
import com.tuoheng.admin.utils.GaodeUtil; | |||
import com.tuoheng.common.common.BaseServiceImpl; | |||
import com.tuoheng.common.exception.ServiceException; | |||
import com.tuoheng.common.utils.JsonResult; | |||
import com.tuoheng.common.utils.StringUtils; | |||
import com.tuoheng.system.utils.ShiroUtils; | |||
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 extends BaseServiceImpl<WarehouseMapper, Warehouse> implements IWarehouseService { | |||
@Autowired | |||
private QueryWarehouseListService queryWarehouseListService; | |||
@Autowired | |||
private QueryWarehousePageListService queryWarehousePageListService; | |||
/** | |||
* 查询仓库列表 | |||
* | |||
* @param request 仓库 | |||
* @return 仓库 | |||
*/ | |||
@Override | |||
public JsonResult getList(QueryWarehouseListRequest request) { | |||
return queryWarehouseListService.getList(request); | |||
} | |||
/** | |||
* 查询仓库分页列表 | |||
* | |||
* @param request 仓库 | |||
* @return 仓库 | |||
*/ | |||
@Override | |||
public JsonResult getPageList(QueryWarehousePageListRequest request) { | |||
return queryWarehousePageListService.getPageList(request); | |||
} | |||
/** | |||
* 查询仓库 | |||
* | |||
* @param id 仓库主键 | |||
* @return 仓库 | |||
*/ | |||
@Override | |||
public JsonResult getOneById(Integer id) { | |||
return null; | |||
} | |||
@Override | |||
public JsonResult editInfo(Warehouse entity) { | |||
//新增 | |||
if (StringUtils.isNull(entity.getId())) { | |||
if (StringUtils.isEmpty(entity.getWarehouseName())) { | |||
throw new ServiceException("仓库名称不能为空"); | |||
} | |||
Integer tenantId = ShiroUtils.getTenantId(); | |||
entity.setTenantId(tenantId); | |||
entity.setCreateUser(ShiroUtils.getUserId()); | |||
} | |||
if (StringUtils.isNotEmpty(entity.getLongitude()) && StringUtils.isNotEmpty(entity.getLatitude())) { | |||
String gaodeAddress = GaodeUtil.getGaodeAddress(entity.getLongitude(), entity.getLatitude()); | |||
entity.setLocation(gaodeAddress); | |||
} | |||
entity.setUpdateUser(ShiroUtils.getUserId()); | |||
super.edit(entity); | |||
return JsonResult.success(); | |||
} | |||
} |
@@ -1,60 +1,60 @@ | |||
<?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="getListByWarehouseId" parameterType="com.tuoheng.admin.entity.request.goods.QueryGoodsListByWarehouseIdRequest" resultMap="GoodsResult"> | |||
select | |||
g.id, | |||
g.tenant_id, | |||
g.warehouse_id, | |||
g.goods_name, | |||
g.goods_type, | |||
g.goods_stock, | |||
g.goods_action, | |||
g.create_user, | |||
g.create_time, | |||
g.update_user, | |||
g.update_time, | |||
g.mark, | |||
u.realname AS updateUserName | |||
from th_goods g | |||
LEFT JOIN sys_user u ON g.update_user = u.id | |||
<where> | |||
<if test="1 == 1"> and g.mark = 1 </if> | |||
<if test="tenantId != null "> and g.tenant_id = #{tenantId}</if> | |||
<if test="warehouseId != null "> and g.warehouse_id = #{warehouseId}</if> | |||
<if test="goodsType != null "> and g.goods_type = #{goodsType}</if> | |||
<if test="goodsName != null and goodsName != ''"> | |||
and g.goods_name like concat('%',#{goodsName},'%') | |||
</if> | |||
</where> | |||
order by g.create_time desc | |||
</select> | |||
<select id="getOneById" parameterType="Integer" resultMap="GoodsResult"> | |||
<include refid="selectGoodsVo"/> | |||
where mark = 1 and id = #{id} | |||
</select> | |||
<?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="getListByWarehouseId" parameterType="com.tuoheng.admin.entity.request.goods.QueryGoodsListByWarehouseIdRequest" resultMap="GoodsResult"> | |||
select | |||
g.id, | |||
g.tenant_id, | |||
g.warehouse_id, | |||
g.goods_name, | |||
g.goods_type, | |||
g.goods_stock, | |||
g.goods_action, | |||
g.create_user, | |||
g.create_time, | |||
g.update_user, | |||
g.update_time, | |||
g.mark, | |||
u.realname AS updateUserName | |||
from th_goods g | |||
LEFT JOIN sys_user u ON g.update_user = u.id | |||
<where> | |||
<if test="1 == 1"> and g.mark = 1 </if> | |||
<if test="tenantId != null "> and g.tenant_id = #{tenantId}</if> | |||
<if test="warehouseId != null "> and g.warehouse_id = #{warehouseId}</if> | |||
<if test="goodsType != null "> and g.goods_type = #{goodsType}</if> | |||
<if test="goodsName != null and goodsName != ''"> | |||
and g.goods_name like concat('%',#{goodsName},'%') | |||
</if> | |||
</where> | |||
order by g.create_time desc | |||
</select> | |||
<select id="getOneById" parameterType="Integer" resultMap="GoodsResult"> | |||
<include refid="selectGoodsVo"/> | |||
where mark = 1 and id = #{id} | |||
</select> | |||
</mapper> |
@@ -1,57 +1,57 @@ | |||
<?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"> | |||
SELECT | |||
w.id, | |||
w.tenant_id, | |||
w.warehouse_name, | |||
w.longitude, | |||
w.latitude, | |||
w.location, | |||
w.create_user, | |||
w.create_time, | |||
w.update_user, | |||
w.update_time, | |||
w.mark, | |||
u.realname AS updateUserName | |||
FROM | |||
th_warehouse w | |||
LEFT JOIN sys_user u ON w.update_user = u.id | |||
<where> | |||
<if test="1 == 1"> and w.mark = 1 </if> | |||
<if test="request.tenantId != null and request.tenantId != 0"> and w.tenant_id = #{request.tenantId}</if> | |||
<if test="request.warehouseName != null and request.warehouseName != ''"> | |||
and w.warehouse_name like concat('%',#{request.warehouseName},'%') | |||
</if> | |||
</where> | |||
order by w.create_time desc | |||
</select> | |||
<select id="getOneById" parameterType="Integer" resultMap="WarehouseResult"> | |||
<include refid="selectWarehouseVo"/> | |||
where mark = 1 and id = #{id} | |||
</select> | |||
<?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"> | |||
SELECT | |||
w.id, | |||
w.tenant_id, | |||
w.warehouse_name, | |||
w.longitude, | |||
w.latitude, | |||
w.location, | |||
w.create_user, | |||
w.create_time, | |||
w.update_user, | |||
w.update_time, | |||
w.mark, | |||
u.realname AS updateUserName | |||
FROM | |||
th_warehouse w | |||
LEFT JOIN sys_user u ON w.update_user = u.id | |||
<where> | |||
<if test="1 == 1"> and w.mark = 1 </if> | |||
<if test="request.tenantId != null and request.tenantId != 0"> and w.tenant_id = #{request.tenantId}</if> | |||
<if test="request.warehouseName != null and request.warehouseName != ''"> | |||
and w.warehouse_name like concat('%',#{request.warehouseName},'%') | |||
</if> | |||
</where> | |||
order by w.create_time desc | |||
</select> | |||
<select id="getOneById" parameterType="Integer" resultMap="WarehouseResult"> | |||
<include refid="selectWarehouseVo"/> | |||
where mark = 1 and id = #{id} | |||
</select> | |||
</mapper> |
@@ -1,68 +1,68 @@ | |||
<?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="missionId" column="mission_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="checkResult" column="check_result" /> | |||
<result property="mark" column="mark" /> | |||
</resultMap> | |||
<sql id="selectWarningVo"> | |||
select id, tenant_id, mission_id, discovery_way, location, status, question_id, create_user, create_time, update_user, update_time, check_user, check_time, check_result, 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> | |||
<if test="status != null and status != 0 "> and status = #{status}</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> | |||
<update id="confirm" parameterType="hashmap"> | |||
update th_inspection_file | |||
<trim prefix="SET" suffixOverrides=","> | |||
<if test="status != null"> status = #{status}, </if> | |||
<if test="updateUser != null and updateUser != ''"> update_user = #{updateUser}, </if> | |||
<if test="updateTime != null"> update_time = #{updateTime}, </if> | |||
<if test="checkUser != null and checkUser != ''"> check_user = #{checkUser}, </if> | |||
<if test="checkTime != null"> check_time = #{checkTime}, </if> | |||
<if test="checkResult != null and checkResult != ''"> check_result = #{checkResult}, </if> | |||
</trim> | |||
where id = #{id} | |||
</update> | |||
<update id="ignore" parameterType="hashmap"> | |||
update th_inspection_file | |||
<trim prefix="SET" suffixOverrides=","> | |||
<if test="status != null"> status = #{status}, </if> | |||
<if test="updateUser != null and updateUser != ''"> update_user = #{updateUser}, </if> | |||
<if test="updateTime != null"> update_time = #{updateTime}, </if> | |||
<if test="checkUser != null and checkUser != ''"> check_user = #{checkUser}, </if> | |||
<if test="checkTime != null"> check_time = #{checkTime}, </if> | |||
</trim> | |||
where id = #{id} | |||
</update> | |||
<?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="missionId" column="mission_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="checkResult" column="check_result" /> | |||
<result property="mark" column="mark" /> | |||
</resultMap> | |||
<sql id="selectWarningVo"> | |||
select id, tenant_id, mission_id, discovery_way, location, status, question_id, create_user, create_time, update_user, update_time, check_user, check_time, check_result, 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> | |||
<if test="status != null and status != 0 "> and status = #{status}</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> | |||
<update id="confirm" parameterType="hashmap"> | |||
update th_inspection_file | |||
<trim prefix="SET" suffixOverrides=","> | |||
<if test="status != null"> status = #{status}, </if> | |||
<if test="updateUser != null and updateUser != ''"> update_user = #{updateUser}, </if> | |||
<if test="updateTime != null"> update_time = #{updateTime}, </if> | |||
<if test="checkUser != null and checkUser != ''"> check_user = #{checkUser}, </if> | |||
<if test="checkTime != null"> check_time = #{checkTime}, </if> | |||
<if test="checkResult != null and checkResult != ''"> check_result = #{checkResult}, </if> | |||
</trim> | |||
where id = #{id} | |||
</update> | |||
<update id="ignore" parameterType="hashmap"> | |||
update th_inspection_file | |||
<trim prefix="SET" suffixOverrides=","> | |||
<if test="status != null"> status = #{status}, </if> | |||
<if test="updateUser != null and updateUser != ''"> update_user = #{updateUser}, </if> | |||
<if test="updateTime != null"> update_time = #{updateTime}, </if> | |||
<if test="checkUser != null and checkUser != ''"> check_user = #{checkUser}, </if> | |||
<if test="checkTime != null"> check_time = #{checkTime}, </if> | |||
</trim> | |||
where id = #{id} | |||
</update> | |||
</mapper> |
@@ -1,40 +1,40 @@ | |||
<?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="missionId" column="mission_id" /> | |||
<result property="emergencyMissionId" column="emergency_mission_id" /> | |||
<result property="name" column="name" /> | |||
<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.QueryWarningRecordListByWarningIdRequest" resultMap="WarningRecordResult"> | |||
<include refid="selectWarningRecordVo"/> | |||
<where> | |||
<if test="1 == 1"> and mark = 1 </if> | |||
<if test="tenantId != null "> and tenant_id = #{tenantId}</if> | |||
<if test="warningId != null "> and warning_id = #{warningId}</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> | |||
<?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="missionId" column="mission_id" /> | |||
<result property="emergencyMissionId" column="emergency_mission_id" /> | |||
<result property="name" column="name" /> | |||
<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.QueryWarningRecordListByWarningIdRequest" resultMap="WarningRecordResult"> | |||
<include refid="selectWarningRecordVo"/> | |||
<where> | |||
<if test="1 == 1"> and mark = 1 </if> | |||
<if test="tenantId != null "> and tenant_id = #{tenantId}</if> | |||
<if test="warningId != null "> and warning_id = #{warningId}</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> |