Commit 13160947c9318f529c7a49dd17c7f47433737f3c
1 parent
0fcc40d6
添加设备操作异常警报
Showing
14 changed files
with
1164 additions
and
12 deletions
Bsth-admin/src/main/java/com/ruoyi/controller/dss/DssEquipmentController.java
| @@ -10,14 +10,13 @@ import com.ruoyi.common.core.domain.entity.SysDictData; | @@ -10,14 +10,13 @@ import com.ruoyi.common.core.domain.entity.SysDictData; | ||
| 10 | import com.ruoyi.common.core.domain.entity.SysUser; | 10 | import com.ruoyi.common.core.domain.entity.SysUser; |
| 11 | import com.ruoyi.common.core.domain.model.LoginUser; | 11 | import com.ruoyi.common.core.domain.model.LoginUser; |
| 12 | import com.ruoyi.common.utils.MessageUtils; | 12 | import com.ruoyi.common.utils.MessageUtils; |
| 13 | -import com.ruoyi.domain.dss.equipment.dto.EquipmentAuthDTO; | ||
| 14 | -import com.ruoyi.domain.dss.equipment.dto.EquipmentSelfcheckCamerasDto; | ||
| 15 | -import com.ruoyi.domain.dss.equipment.dto.EquipmentSelfcheckDto; | ||
| 16 | -import com.ruoyi.domain.dss.equipment.dto.HeartbeatDTO; | 13 | +import com.ruoyi.domain.driver.NewDriver; |
| 14 | +import com.ruoyi.domain.dss.equipment.dto.*; | ||
| 17 | import com.ruoyi.domain.dss.equipment.vo.AuthVo; | 15 | import com.ruoyi.domain.dss.equipment.vo.AuthVo; |
| 18 | import com.ruoyi.domain.dss.equipment.vo.EquimentAddressParamVo; | 16 | import com.ruoyi.domain.dss.equipment.vo.EquimentAddressParamVo; |
| 19 | import com.ruoyi.domain.dss.equipment.vo.EquimentVideoParamVo; | 17 | import com.ruoyi.domain.dss.equipment.vo.EquimentVideoParamVo; |
| 20 | import com.ruoyi.domain.dss.equipment.vo.EquipmentConfigVo; | 18 | import com.ruoyi.domain.dss.equipment.vo.EquipmentConfigVo; |
| 19 | +import com.ruoyi.domain.equipment.alert.EquipmentAlert; | ||
| 21 | import com.ruoyi.domain.equipment.heartbeat.LingangEquipmentHeartbeat; | 20 | import com.ruoyi.domain.equipment.heartbeat.LingangEquipmentHeartbeat; |
| 22 | import com.ruoyi.domain.equipment.self.check.LingangEquimentSelfCheck; | 21 | import com.ruoyi.domain.equipment.self.check.LingangEquimentSelfCheck; |
| 23 | import com.ruoyi.equipment.domain.Equipment; | 22 | import com.ruoyi.equipment.domain.Equipment; |
| @@ -27,6 +26,8 @@ import com.ruoyi.framework.manager.factory.AsyncFactory; | @@ -27,6 +26,8 @@ import com.ruoyi.framework.manager.factory.AsyncFactory; | ||
| 27 | import com.ruoyi.framework.security.context.AuthenticationContextHolder; | 26 | import com.ruoyi.framework.security.context.AuthenticationContextHolder; |
| 28 | import com.ruoyi.framework.security.filter.JwtAuthenticationTokenFilter; | 27 | import com.ruoyi.framework.security.filter.JwtAuthenticationTokenFilter; |
| 29 | import com.ruoyi.framework.web.service.TokenService; | 28 | import com.ruoyi.framework.web.service.TokenService; |
| 29 | +import com.ruoyi.service.driver.NewDriverService; | ||
| 30 | +import com.ruoyi.service.equipment.alert.EquipmentAlertService; | ||
| 30 | import com.ruoyi.service.equipment.heartbeat.LingangEquipmentHeartbeatService; | 31 | import com.ruoyi.service.equipment.heartbeat.LingangEquipmentHeartbeatService; |
| 31 | import com.ruoyi.service.equipment.self.check.LingangEquimentSelfCheckService; | 32 | import com.ruoyi.service.equipment.self.check.LingangEquimentSelfCheckService; |
| 32 | import com.ruoyi.system.service.ISysDictDataService; | 33 | import com.ruoyi.system.service.ISysDictDataService; |
| @@ -74,6 +75,10 @@ public class DssEquipmentController extends BaseController { | @@ -74,6 +75,10 @@ public class DssEquipmentController extends BaseController { | ||
| 74 | private ISysDictDataService sysDictDataService; | 75 | private ISysDictDataService sysDictDataService; |
| 75 | @Autowired | 76 | @Autowired |
| 76 | private LingangEquimentSelfCheckService lingangEquimentSelfCheckServicelingangEquimentSelfCheckService; | 77 | private LingangEquimentSelfCheckService lingangEquimentSelfCheckServicelingangEquimentSelfCheckService; |
| 78 | + @Autowired | ||
| 79 | + private EquipmentAlertService equipmentAlertService; | ||
| 80 | + @Autowired | ||
| 81 | + private NewDriverService driverService; | ||
| 77 | 82 | ||
| 78 | 83 | ||
| 79 | private static final String[] GET_CONFIG_DICT_KEY = {"drinking", "drunkenness", "videoParam", "addressParam", "resource_base_url"}; | 84 | private static final String[] GET_CONFIG_DICT_KEY = {"drinking", "drunkenness", "videoParam", "addressParam", "resource_base_url"}; |
| @@ -117,9 +122,9 @@ public class DssEquipmentController extends BaseController { | @@ -117,9 +122,9 @@ public class DssEquipmentController extends BaseController { | ||
| 117 | } | 122 | } |
| 118 | 123 | ||
| 119 | String msg = JwtAuthenticationTokenFilter.validateDevice(heartbeatDTO.getDevice()); | 124 | String msg = JwtAuthenticationTokenFilter.validateDevice(heartbeatDTO.getDevice()); |
| 120 | - if(StringUtils.isNotEmpty(msg)){ | 125 | + if (StringUtils.isNotEmpty(msg)) { |
| 121 | log.info(msg); | 126 | log.info(msg); |
| 122 | - return ResponseResult.error(TipEnum.TIP_401.getCode(),TipEnum.TIP_401.getMsg()); | 127 | + return ResponseResult.error(TipEnum.TIP_401.getCode(), TipEnum.TIP_401.getMsg()); |
| 123 | } | 128 | } |
| 124 | 129 | ||
| 125 | List<LingangEquipmentHeartbeat> heartbeats = convertHeartbeatDTO(heartbeatDTO); | 130 | List<LingangEquipmentHeartbeat> heartbeats = convertHeartbeatDTO(heartbeatDTO); |
| @@ -138,9 +143,9 @@ public class DssEquipmentController extends BaseController { | @@ -138,9 +143,9 @@ public class DssEquipmentController extends BaseController { | ||
| 138 | } | 143 | } |
| 139 | 144 | ||
| 140 | String msg = JwtAuthenticationTokenFilter.validateDevice(device); | 145 | String msg = JwtAuthenticationTokenFilter.validateDevice(device); |
| 141 | - if(StringUtils.isNotEmpty(msg)){ | 146 | + if (StringUtils.isNotEmpty(msg)) { |
| 142 | log.info(msg); | 147 | log.info(msg); |
| 143 | - return ResponseResult.error(TipEnum.TIP_401.getCode(),TipEnum.TIP_401.getMsg()); | 148 | + return ResponseResult.error(TipEnum.TIP_401.getCode(), TipEnum.TIP_401.getMsg()); |
| 144 | } | 149 | } |
| 145 | 150 | ||
| 146 | 151 | ||
| @@ -162,9 +167,9 @@ public class DssEquipmentController extends BaseController { | @@ -162,9 +167,9 @@ public class DssEquipmentController extends BaseController { | ||
| 162 | public ResponseResult<EquipmentConfigVo> getConfigV1_1(@RequestParam(value = "device") String device) { | 167 | public ResponseResult<EquipmentConfigVo> getConfigV1_1(@RequestParam(value = "device") String device) { |
| 163 | 168 | ||
| 164 | String msg = JwtAuthenticationTokenFilter.validateDevice(device); | 169 | String msg = JwtAuthenticationTokenFilter.validateDevice(device); |
| 165 | - if(StringUtils.isNotEmpty(msg)){ | 170 | + if (StringUtils.isNotEmpty(msg)) { |
| 166 | log.info(msg); | 171 | log.info(msg); |
| 167 | - return ResponseResult.error(TipEnum.TIP_401.getCode(),TipEnum.TIP_401.getMsg()); | 172 | + return ResponseResult.error(TipEnum.TIP_401.getCode(), TipEnum.TIP_401.getMsg()); |
| 168 | } | 173 | } |
| 169 | 174 | ||
| 170 | return getConfig(device); | 175 | return getConfig(device); |
| @@ -179,9 +184,9 @@ public class DssEquipmentController extends BaseController { | @@ -179,9 +184,9 @@ public class DssEquipmentController extends BaseController { | ||
| 179 | } | 184 | } |
| 180 | 185 | ||
| 181 | String msg = JwtAuthenticationTokenFilter.validateDevice(equipmentSelfcheckDto.getDevice()); | 186 | String msg = JwtAuthenticationTokenFilter.validateDevice(equipmentSelfcheckDto.getDevice()); |
| 182 | - if(StringUtils.isNotEmpty(msg)){ | 187 | + if (StringUtils.isNotEmpty(msg)) { |
| 183 | log.info(msg); | 188 | log.info(msg); |
| 184 | - return ResponseResult.error(TipEnum.TIP_401.getCode(),TipEnum.TIP_401.getMsg()); | 189 | + return ResponseResult.error(TipEnum.TIP_401.getCode(), TipEnum.TIP_401.getMsg()); |
| 185 | } | 190 | } |
| 186 | 191 | ||
| 187 | LingangEquimentSelfCheck selfCheck = convertLingangEquimentSelfCheck(equipmentSelfcheckDto); | 192 | LingangEquimentSelfCheck selfCheck = convertLingangEquimentSelfCheck(equipmentSelfcheckDto); |
| @@ -189,6 +194,82 @@ public class DssEquipmentController extends BaseController { | @@ -189,6 +194,82 @@ public class DssEquipmentController extends BaseController { | ||
| 189 | return ResponseResult.success(); | 194 | return ResponseResult.success(); |
| 190 | } | 195 | } |
| 191 | 196 | ||
| 197 | + @PostMapping("/device/alert/add") | ||
| 198 | + @ApiOperation("添加设备警报信息") | ||
| 199 | + public ResponseResult addDeviceAlert(@Valid @RequestBody DssEquipmentAlertAddDTO equipmentAlertAddDTO, BindingResult bindingResult) { | ||
| 200 | + if (bindingResult.hasErrors()) { | ||
| 201 | + return ResponseResult.error(bindingResult.getFieldError().getDefaultMessage()); | ||
| 202 | + } | ||
| 203 | + | ||
| 204 | + String msg = JwtAuthenticationTokenFilter.validateDevice(equipmentAlertAddDTO.getDeviceCode()); | ||
| 205 | + if (StringUtils.isNotEmpty(msg)) { | ||
| 206 | + log.info(msg); | ||
| 207 | + return ResponseResult.error(TipEnum.TIP_401.getCode(), TipEnum.TIP_401.getMsg()); | ||
| 208 | + } | ||
| 209 | + | ||
| 210 | + EquipmentAlert equipmentAlert = convert(equipmentAlertAddDTO); | ||
| 211 | + equipmentAlert.setCreateTime(new Date()); | ||
| 212 | + equipmentAlert.setStatus("0"); | ||
| 213 | + | ||
| 214 | + if (StringUtils.isNotEmpty(equipmentAlertAddDTO.getJobCode())) { | ||
| 215 | + NewDriver driver = driverService.getOne(equipmentAlertAddDTO.getJobCode()); | ||
| 216 | + if (Objects.isNull(driver)) { | ||
| 217 | + return ResponseResult.error(TipEnum.TIP_500.getCode(), "没有找到操作人员信息"); | ||
| 218 | + } | ||
| 219 | + equipmentAlert.setCreateBy(Convert.toLong(driver.getId())); | ||
| 220 | + } | ||
| 221 | + | ||
| 222 | + equipmentAlertService.save(equipmentAlert); | ||
| 223 | + return ResponseResult.success(); | ||
| 224 | + } | ||
| 225 | + | ||
| 226 | + | ||
| 227 | + @PostMapping("/device/alert/update/status") | ||
| 228 | + @ApiOperation("修改设备警报状态") | ||
| 229 | + public ResponseResult deviceAlert(@Valid @RequestBody DssEquipmentAlertUpdateStatusDTO alertUpdateStatusDTO, BindingResult bindingResult) { | ||
| 230 | + if (bindingResult.hasErrors()) { | ||
| 231 | + return ResponseResult.error(bindingResult.getFieldError().getDefaultMessage()); | ||
| 232 | + } | ||
| 233 | + | ||
| 234 | + String msg = JwtAuthenticationTokenFilter.validateDevice(alertUpdateStatusDTO.getDeviceCode()); | ||
| 235 | + if (StringUtils.isNotEmpty(msg)) { | ||
| 236 | + log.info(msg); | ||
| 237 | + return ResponseResult.error(TipEnum.TIP_401.getCode(), TipEnum.TIP_401.getMsg()); | ||
| 238 | + } | ||
| 239 | + | ||
| 240 | + | ||
| 241 | + EquipmentAlert source = new EquipmentAlert(); | ||
| 242 | + source.setDeviceCode(alertUpdateStatusDTO.getDeviceCode()); | ||
| 243 | + source.setType(alertUpdateStatusDTO.getType()); | ||
| 244 | + source.setStatus("0"); | ||
| 245 | + | ||
| 246 | + source = equipmentAlertService.getOne(source); | ||
| 247 | + if (Objects.isNull(source)) { | ||
| 248 | + return ResponseResult.error(TipEnum.TIP_500.getCode(), "没有找到此警报信息"); | ||
| 249 | + } | ||
| 250 | + | ||
| 251 | + if (StringUtils.isNotEmpty(alertUpdateStatusDTO.getJobCode())) { | ||
| 252 | + NewDriver driver = driverService.getOne(alertUpdateStatusDTO.getJobCode()); | ||
| 253 | + if (Objects.isNull(driver)) { | ||
| 254 | + return ResponseResult.error(TipEnum.TIP_500.getCode(), "没有找到操作人员信息"); | ||
| 255 | + } | ||
| 256 | + source.setUpdateBy(Convert.toLong(driver.getId())); | ||
| 257 | + } | ||
| 258 | + source.setUpdateTime(new Date()); | ||
| 259 | + source.setStatus(alertUpdateStatusDTO.getStatus()); | ||
| 260 | + | ||
| 261 | + equipmentAlertService.updateByPrimaryKey(source); | ||
| 262 | + return ResponseResult.success(); | ||
| 263 | + } | ||
| 264 | + | ||
| 265 | + private EquipmentAlert convert(DssEquipmentAlertAddDTO source) { | ||
| 266 | + return java.util.Optional.ofNullable(source).map(sc -> { | ||
| 267 | + EquipmentAlert target = new EquipmentAlert(); | ||
| 268 | + BeanUtils.copyProperties(sc, target); | ||
| 269 | + return target; | ||
| 270 | + }).orElseGet(null); | ||
| 271 | + } | ||
| 272 | + | ||
| 192 | private List<LingangEquipmentHeartbeat> convertHeartbeatDTO(HeartbeatDTO heartbeatDTO) { | 273 | private List<LingangEquipmentHeartbeat> convertHeartbeatDTO(HeartbeatDTO heartbeatDTO) { |
| 193 | if (Objects.isNull(heartbeatDTO)) { | 274 | if (Objects.isNull(heartbeatDTO)) { |
| 194 | return Collections.emptyList(); | 275 | return Collections.emptyList(); |
Bsth-admin/src/main/java/com/ruoyi/controller/equipment/alert/EquipmentAlertController.java
0 → 100644
| 1 | +package com.ruoyi.controller.equipment.alert; | ||
| 2 | + | ||
| 3 | +import com.baomidou.mybatisplus.core.metadata.IPage; | ||
| 4 | +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; | ||
| 5 | +import com.ruoyi.common.core.controller.BaseController; | ||
| 6 | +import com.ruoyi.common.utils.poi.ExcelUtil; | ||
| 7 | +import com.ruoyi.domain.OrderEntity; | ||
| 8 | +import com.ruoyi.domain.equipment.alert.EquipmentAlert; | ||
| 9 | +import com.ruoyi.domain.equipment.alert.dto.EquipmentAlertAddDTO; | ||
| 10 | +import com.ruoyi.domain.equipment.alert.dto.EquipmentAlertQueryDTO; | ||
| 11 | +import com.ruoyi.domain.equipment.alert.dto.EquipmentAlertUpdateDTO; | ||
| 12 | +import com.ruoyi.domain.equipment.alert.dto.EquipmentAlertUpdateStatusDTO; | ||
| 13 | +import com.ruoyi.domain.equipment.alert.vo.EquipmentAlertVO; | ||
| 14 | +import com.ruoyi.service.equipment.alert.EquipmentAlertService; | ||
| 15 | +import io.swagger.annotations.Api; | ||
| 16 | +import io.swagger.annotations.ApiOperation; | ||
| 17 | +import org.springframework.beans.BeanUtils; | ||
| 18 | +import org.springframework.beans.factory.annotation.Autowired; | ||
| 19 | +import org.springframework.security.access.prepost.PreAuthorize; | ||
| 20 | +import org.springframework.validation.BindingResult; | ||
| 21 | +import org.springframework.web.bind.annotation.*; | ||
| 22 | + | ||
| 23 | +import javax.servlet.http.HttpServletResponse; | ||
| 24 | +import javax.validation.Valid; | ||
| 25 | +import java.util.Date; | ||
| 26 | +import java.util.List; | ||
| 27 | + | ||
| 28 | + | ||
| 29 | + | ||
| 30 | +@RestController | ||
| 31 | +@Api(tags = "设备警报信息") | ||
| 32 | +@RequestMapping("equipment/alert") | ||
| 33 | +public class EquipmentAlertController extends BaseController { | ||
| 34 | + @Autowired | ||
| 35 | + private EquipmentAlertService equipmentAlertService; | ||
| 36 | + | ||
| 37 | + @ApiOperation("分页查询") | ||
| 38 | + @PreAuthorize("@ss.hasPermi('equipment:alert:list:limit:page:limit')") | ||
| 39 | + @PostMapping(value = "/list/limit/{page}/{pageLimit}") | ||
| 40 | + public IPage<EquipmentAlertVO> listLimit(@ModelAttribute EquipmentAlertQueryDTO request, @ModelAttribute OrderEntity orderEntity, @PathVariable Integer page, @PathVariable Integer pageLimit, org.springframework.ui.Model model) { | ||
| 41 | + EquipmentAlert entity = convert(request); | ||
| 42 | + IPage<EquipmentAlert> response = equipmentAlertService.pageList(new Page<EquipmentAlert>(page, pageLimit), entity, orderEntity); | ||
| 43 | + | ||
| 44 | + return convert(response); | ||
| 45 | + } | ||
| 46 | + | ||
| 47 | + @ApiOperation("根据ID查询详情") | ||
| 48 | + @GetMapping(value = "/view/{id}") | ||
| 49 | + public com.ruoyi.common.core.domain.ResponseResult<EquipmentAlertVO> view(@PathVariable("id") Long id, org.springframework.ui.Model model) { | ||
| 50 | + EquipmentAlert source = equipmentAlertService.getById(id); | ||
| 51 | + | ||
| 52 | + return com.ruoyi.common.core.domain.ResponseResult.success(convert(source)); | ||
| 53 | + } | ||
| 54 | + | ||
| 55 | +// @PostMapping(value = "/list/select") | ||
| 56 | +// @ApiOperation("(页面选择)") | ||
| 57 | +// public com.ruoyi.common.core.domain.ResponseResult<List<EquipmentAlertVO>> listSelect(EquipmentAlertQueryDTO request) { | ||
| 58 | +// EquipmentAlert entity = convert(request); | ||
| 59 | +// List<EquipmentAlert> selectList = equipmentAlertService.listOfSelect(entity); | ||
| 60 | +// return com.ruoyi.common.core.domain.ResponseResult.success(convert(selectList)); | ||
| 61 | +// } | ||
| 62 | + | ||
| 63 | + @PreAuthorize("@ss.hasPermi('equipment:alert:export')") | ||
| 64 | + @ApiOperation("导出") | ||
| 65 | + @PostMapping("/export") | ||
| 66 | + public void export(HttpServletResponse response, @RequestBody EquipmentAlertQueryDTO request) { | ||
| 67 | + EquipmentAlert entity = convert(request); | ||
| 68 | + List<EquipmentAlert> list = equipmentAlertService.list(entity); | ||
| 69 | + ExcelUtil<EquipmentAlert> util = new ExcelUtil<EquipmentAlert>(EquipmentAlert.class); | ||
| 70 | + util.exportExcel(response, list, "EquipmentAlert"); | ||
| 71 | + } | ||
| 72 | + | ||
| 73 | + @ApiOperation("添加") | ||
| 74 | + @PreAuthorize("@ss.hasPermi('equipment:alert:add')") | ||
| 75 | + @PostMapping(value = "/add") | ||
| 76 | + public com.ruoyi.common.core.domain.ResponseResult add(@Valid @ModelAttribute EquipmentAlertAddDTO request, BindingResult bindingResult) { | ||
| 77 | + if (bindingResult.hasErrors()) { | ||
| 78 | + return com.ruoyi.common.core.domain.ResponseResult.error(bindingResult.getFieldError().getDefaultMessage()); | ||
| 79 | + } | ||
| 80 | + EquipmentAlert entity = convert(request); | ||
| 81 | + entity.setCreateBy(getUserId()); | ||
| 82 | + entity.setCreateTime(new Date()); | ||
| 83 | + int count = equipmentAlertService.insertSelective(entity); | ||
| 84 | + return count > 0 ? com.ruoyi.common.core.domain.ResponseResult.success(Boolean.TRUE) : com.ruoyi.common.core.domain.ResponseResult.error("添加数据失败,请稍后再试"); | ||
| 85 | + } | ||
| 86 | + | ||
| 87 | + @ApiOperation("修改") | ||
| 88 | + @PreAuthorize("@ss.hasPermi('equipment:alert:update')") | ||
| 89 | + @PostMapping(value = "/update") | ||
| 90 | + public com.ruoyi.common.core.domain.ResponseResult update(@Valid @ModelAttribute EquipmentAlertUpdateDTO request, BindingResult bindingResult) { | ||
| 91 | + if (bindingResult.hasErrors()) { | ||
| 92 | + return com.ruoyi.common.core.domain.ResponseResult.error(bindingResult.getFieldError().getDefaultMessage()); | ||
| 93 | + } | ||
| 94 | + EquipmentAlert entity = convert(request); | ||
| 95 | + entity.setUpdateBy(getUserId()); | ||
| 96 | + entity.setUpdateTime(new Date()); | ||
| 97 | + boolean flag = equipmentAlertService.updateByPrimaryKey(entity); | ||
| 98 | + return flag ? com.ruoyi.common.core.domain.ResponseResult.success(Boolean.TRUE) : com.ruoyi.common.core.domain.ResponseResult.error("修改数据失败,请稍后再试"); | ||
| 99 | + } | ||
| 100 | + | ||
| 101 | + @ApiOperation("修改状态") | ||
| 102 | + @PreAuthorize("@ss.hasPermi('equipment:alert:update:status')") | ||
| 103 | + @PostMapping(value = "/update/status") | ||
| 104 | + public com.ruoyi.common.core.domain.ResponseResult updateState(@ModelAttribute EquipmentAlertUpdateStatusDTO request) { | ||
| 105 | + EquipmentAlert entity = convert(request); | ||
| 106 | + boolean flag = equipmentAlertService.updateByPrimaryKey(entity); | ||
| 107 | + return flag ? com.ruoyi.common.core.domain.ResponseResult.success(Boolean.TRUE) : com.ruoyi.common.core.domain.ResponseResult.error("修改数据失败,请稍后再试"); | ||
| 108 | + } | ||
| 109 | + | ||
| 110 | + private EquipmentAlert convert(EquipmentAlertQueryDTO source) { | ||
| 111 | + return java.util.Optional.ofNullable(source).map(sc -> { | ||
| 112 | + EquipmentAlert target = new EquipmentAlert(); | ||
| 113 | + BeanUtils.copyProperties(sc, target); | ||
| 114 | + return target; | ||
| 115 | + }).orElse(null); | ||
| 116 | + } | ||
| 117 | + | ||
| 118 | + private EquipmentAlert convert(EquipmentAlertUpdateDTO source) { | ||
| 119 | + return java.util.Optional.ofNullable(source).map(sc -> { | ||
| 120 | + EquipmentAlert target = new EquipmentAlert(); | ||
| 121 | + BeanUtils.copyProperties(sc, target); | ||
| 122 | + return target; | ||
| 123 | + }).orElse(null); | ||
| 124 | + } | ||
| 125 | + | ||
| 126 | + private EquipmentAlert convert(EquipmentAlertUpdateStatusDTO source) { | ||
| 127 | + return java.util.Optional.ofNullable(source).map(sc -> { | ||
| 128 | + EquipmentAlert target = new EquipmentAlert(); | ||
| 129 | + BeanUtils.copyProperties(sc, target); | ||
| 130 | + return target; | ||
| 131 | + }).orElse(null); | ||
| 132 | + } | ||
| 133 | + | ||
| 134 | + private EquipmentAlert convert(EquipmentAlertAddDTO source) { | ||
| 135 | + return java.util.Optional.ofNullable(source).map(sc -> { | ||
| 136 | + EquipmentAlert target = new EquipmentAlert(); | ||
| 137 | + BeanUtils.copyProperties(sc, target); | ||
| 138 | + return target; | ||
| 139 | + }).orElseGet(null); | ||
| 140 | + } | ||
| 141 | + | ||
| 142 | + private EquipmentAlertVO convert(EquipmentAlert source) { | ||
| 143 | + return java.util.Optional.ofNullable(source).map(sc -> { | ||
| 144 | + EquipmentAlertVO target = new EquipmentAlertVO(); | ||
| 145 | + BeanUtils.copyProperties(source, target); | ||
| 146 | + return target; | ||
| 147 | + }).orElseGet(null); | ||
| 148 | + } | ||
| 149 | + | ||
| 150 | + private List<EquipmentAlertVO> convert(List<EquipmentAlert> sources) { | ||
| 151 | + return java.util.Optional.ofNullable(sources).map(scs -> { | ||
| 152 | + return scs.stream().map(source -> { | ||
| 153 | + return convert(source); | ||
| 154 | + }).collect(java.util.stream.Collectors.toList()); | ||
| 155 | + }).orElseGet(null); | ||
| 156 | + } | ||
| 157 | + | ||
| 158 | + private IPage<EquipmentAlertVO> convert(IPage<EquipmentAlert> sources) { | ||
| 159 | + return java.util.Optional.ofNullable(sources).map(scs -> { | ||
| 160 | + IPage<EquipmentAlertVO> target = new Page(); | ||
| 161 | + BeanUtils.copyProperties(scs, target); | ||
| 162 | + List<EquipmentAlertVO> voNames = convert(scs.getRecords()); | ||
| 163 | + target.setRecords(voNames); | ||
| 164 | + | ||
| 165 | + return target; | ||
| 166 | + }).orElseGet(null); | ||
| 167 | + } | ||
| 168 | +} | ||
| 0 | \ No newline at end of file | 169 | \ No newline at end of file |
Bsth-admin/src/main/java/com/ruoyi/domain/dss/equipment/dto/DssEquipmentAlertAddDTO.java
0 → 100644
| 1 | +package com.ruoyi.domain.dss.equipment.dto; | ||
| 2 | + | ||
| 3 | +import io.swagger.annotations.ApiModel; | ||
| 4 | +import io.swagger.annotations.ApiModelProperty; | ||
| 5 | +import lombok.Data; | ||
| 6 | +import lombok.EqualsAndHashCode; | ||
| 7 | +import lombok.experimental.Accessors; | ||
| 8 | + | ||
| 9 | +import javax.validation.constraints.NotEmpty; | ||
| 10 | +import javax.validation.constraints.NotNull; | ||
| 11 | + | ||
| 12 | +@Data | ||
| 13 | +@ApiModel(value = "设备警报信息的添加DTO") | ||
| 14 | +@Accessors(chain = true) | ||
| 15 | +@EqualsAndHashCode(callSuper = false) | ||
| 16 | +/**设备警报信息 DTO*/ | ||
| 17 | +public class DssEquipmentAlertAddDTO implements java.io.Serializable { | ||
| 18 | + private static final long serialVersionUID = 732422387L; | ||
| 19 | + | ||
| 20 | + /***设备编号*/ | ||
| 21 | + @NotEmpty(message = "设备号不能为空") | ||
| 22 | + @ApiModelProperty(value = "设备编号",required = true) | ||
| 23 | + private String deviceCode; | ||
| 24 | + /***1:未关舱门*/ | ||
| 25 | + @NotNull(message = "警报类型不能为空") | ||
| 26 | + @ApiModelProperty(value = "警报类型,1:未关舱门", example = "1",required = true) | ||
| 27 | + private Integer type; | ||
| 28 | + /***操作人员*/ | ||
| 29 | + @NotEmpty(message = "操作人员不能为空") | ||
| 30 | + @ApiModelProperty(value = "操作人员",required = true) | ||
| 31 | + private String jobCode; | ||
| 32 | + /***备注*/ | ||
| 33 | + @ApiModelProperty(value = "备注") | ||
| 34 | + private String remark; | ||
| 35 | + | ||
| 36 | + | ||
| 37 | + | ||
| 38 | + | ||
| 39 | + @Override | ||
| 40 | + public String toString() { | ||
| 41 | + return com.alibaba.fastjson2.JSON.toJSONString(this); | ||
| 42 | + } | ||
| 43 | +} | ||
| 0 | \ No newline at end of file | 44 | \ No newline at end of file |
Bsth-admin/src/main/java/com/ruoyi/domain/dss/equipment/dto/DssEquipmentAlertUpdateStatusDTO.java
0 → 100644
| 1 | +package com.ruoyi.domain.dss.equipment.dto; | ||
| 2 | + | ||
| 3 | +import io.swagger.annotations.ApiModel; | ||
| 4 | +import io.swagger.annotations.ApiModelProperty; | ||
| 5 | +import lombok.Data; | ||
| 6 | +import lombok.EqualsAndHashCode; | ||
| 7 | +import lombok.experimental.Accessors; | ||
| 8 | + | ||
| 9 | +import javax.validation.constraints.NotEmpty; | ||
| 10 | +import javax.validation.constraints.NotNull; | ||
| 11 | + | ||
| 12 | +@Data | ||
| 13 | +@ApiModel(value = "设备警报信息的修改状态DTO") | ||
| 14 | +@Accessors(chain = true) | ||
| 15 | +@EqualsAndHashCode(callSuper = false) | ||
| 16 | +/**设备警报信息 DTO*/ | ||
| 17 | +public class DssEquipmentAlertUpdateStatusDTO implements java.io.Serializable { | ||
| 18 | + private static final long serialVersionUID = 385884175L; | ||
| 19 | + | ||
| 20 | + | ||
| 21 | + /***设备编号*/ | ||
| 22 | + @NotEmpty(message = "设备号不能为空") | ||
| 23 | + @ApiModelProperty(value = "设备编号", required = true) | ||
| 24 | + private String deviceCode; | ||
| 25 | + | ||
| 26 | + @NotNull(message = "警报类型不能为空") | ||
| 27 | + @ApiModelProperty(value = "警报类型,1:未关舱门", example = "1",required = true) | ||
| 28 | + private Integer type; | ||
| 29 | + /***操作人员*/ | ||
| 30 | + @ApiModelProperty(value = "操作人员") | ||
| 31 | + private String jobCode; | ||
| 32 | + /***备注*/ | ||
| 33 | + @ApiModelProperty(value = "备注") | ||
| 34 | + private String remark; | ||
| 35 | + | ||
| 36 | + /***1:已处理;0未处理*/ | ||
| 37 | + @NotEmpty(message = "处理状态不能为空") | ||
| 38 | + @ApiModelProperty(value = "1:已处理;0未处理", required = true) | ||
| 39 | + private String status; | ||
| 40 | + | ||
| 41 | + | ||
| 42 | + @Override | ||
| 43 | + public String toString() { | ||
| 44 | + return com.alibaba.fastjson2.JSON.toJSONString(this); | ||
| 45 | + } | ||
| 46 | +} | ||
| 0 | \ No newline at end of file | 47 | \ No newline at end of file |
Bsth-admin/src/main/java/com/ruoyi/domain/equipment/alert/EquipmentAlert.java
0 → 100644
| 1 | +package com.ruoyi.domain.equipment.alert; | ||
| 2 | + | ||
| 3 | +import com.baomidou.mybatisplus.annotation.IdType; | ||
| 4 | +import com.baomidou.mybatisplus.annotation.TableId; | ||
| 5 | +import com.baomidou.mybatisplus.annotation.TableName; | ||
| 6 | +import com.ruoyi.common.annotation.Excel; | ||
| 7 | +import lombok.AllArgsConstructor; | ||
| 8 | +import lombok.Data; | ||
| 9 | +import lombok.EqualsAndHashCode; | ||
| 10 | +import lombok.NoArgsConstructor; | ||
| 11 | +import lombok.experimental.Accessors; | ||
| 12 | +import lombok.extern.slf4j.Slf4j; | ||
| 13 | + | ||
| 14 | + | ||
| 15 | +@Data | ||
| 16 | +@Slf4j | ||
| 17 | +@NoArgsConstructor | ||
| 18 | +@AllArgsConstructor | ||
| 19 | +@Accessors(chain = true) | ||
| 20 | +@EqualsAndHashCode(callSuper = false) | ||
| 21 | +@TableName("equipment_alert") | ||
| 22 | +/**设备警报信息 实体*/ | ||
| 23 | +public class EquipmentAlert { | ||
| 24 | + /***ID*/ | ||
| 25 | + @TableId(value = "id", type = IdType.AUTO) | ||
| 26 | + @Excel(name = "ID") | ||
| 27 | + private Long id; | ||
| 28 | + | ||
| 29 | + | ||
| 30 | + /***设备编号*/ | ||
| 31 | + @Excel(name = "设备编号") | ||
| 32 | + private String deviceCode; | ||
| 33 | + | ||
| 34 | + | ||
| 35 | + /***1:未关舱门*/ | ||
| 36 | + @Excel(name = "1:未关舱门") | ||
| 37 | + private Integer type; | ||
| 38 | + | ||
| 39 | + | ||
| 40 | + /***操作人员*/ | ||
| 41 | + @Excel(name = "操作人员") | ||
| 42 | + private String jobCode; | ||
| 43 | + | ||
| 44 | + | ||
| 45 | + /***备注*/ | ||
| 46 | + @Excel(name = "备注") | ||
| 47 | + private String remark; | ||
| 48 | + | ||
| 49 | + | ||
| 50 | + /***1:已处理;0未处理*/ | ||
| 51 | + @Excel(name = "1:已处理;0未处理") | ||
| 52 | + private String status; | ||
| 53 | + | ||
| 54 | + | ||
| 55 | + /***创建人员*/ | ||
| 56 | + @Excel(name = "创建人员") | ||
| 57 | + private Long createBy; | ||
| 58 | + | ||
| 59 | + | ||
| 60 | + /***上报时间*/ | ||
| 61 | + @Excel(name = "上报时间") | ||
| 62 | + private java.util.Date createTime; | ||
| 63 | + | ||
| 64 | + | ||
| 65 | + /***修改人员*/ | ||
| 66 | + @Excel(name = "修改人员") | ||
| 67 | + private Long updateBy; | ||
| 68 | + | ||
| 69 | + | ||
| 70 | + /***修改时间*/ | ||
| 71 | + @Excel(name = "修改时间") | ||
| 72 | + private java.util.Date updateTime; | ||
| 73 | + | ||
| 74 | + | ||
| 75 | + /***是否删除,0 未删除;1是删除*/ | ||
| 76 | + @Excel(name = "是否删除,0 未删除;1是删除") | ||
| 77 | + private Boolean delFlag; | ||
| 78 | + | ||
| 79 | + | ||
| 80 | + @Override | ||
| 81 | + public String toString() { | ||
| 82 | + return com.alibaba.fastjson2.JSON.toJSONString(this); | ||
| 83 | + } | ||
| 84 | +} | ||
| 0 | \ No newline at end of file | 85 | \ No newline at end of file |
Bsth-admin/src/main/java/com/ruoyi/domain/equipment/alert/dto/EquipmentAlertAddDTO.java
0 → 100644
| 1 | +package com.ruoyi.domain.equipment.alert.dto; | ||
| 2 | + | ||
| 3 | +import io.swagger.annotations.ApiModel; | ||
| 4 | +import io.swagger.annotations.ApiModelProperty; | ||
| 5 | +import lombok.Data; | ||
| 6 | +import lombok.EqualsAndHashCode; | ||
| 7 | +import lombok.experimental.Accessors; | ||
| 8 | + | ||
| 9 | +@Data | ||
| 10 | +@ApiModel(value = "设备警报信息的添加DTO") | ||
| 11 | +@Accessors(chain = true) | ||
| 12 | +@EqualsAndHashCode(callSuper = false) | ||
| 13 | +/**设备警报信息 DTO*/ | ||
| 14 | +public class EquipmentAlertAddDTO implements java.io.Serializable { | ||
| 15 | + private static final long serialVersionUID = 732422387L; | ||
| 16 | + | ||
| 17 | + /***ID*/ | ||
| 18 | + @ApiModelProperty(value = "ID", example = "1") | ||
| 19 | + private Long id; | ||
| 20 | + /***设备编号*/ | ||
| 21 | + @ApiModelProperty(value = "设备编号") | ||
| 22 | + private String deviceCode; | ||
| 23 | + /***1:未关舱门*/ | ||
| 24 | + @ApiModelProperty(value = "1:未关舱门", example = "1") | ||
| 25 | + private Integer type; | ||
| 26 | + /***操作人员*/ | ||
| 27 | + @ApiModelProperty(value = "操作人员") | ||
| 28 | + private String jobCode; | ||
| 29 | + /***备注*/ | ||
| 30 | + @ApiModelProperty(value = "备注") | ||
| 31 | + private String remark; | ||
| 32 | + /***1:已处理;0未处理*/ | ||
| 33 | + @ApiModelProperty(value = "1:已处理;0未处理") | ||
| 34 | + private String status; | ||
| 35 | + /***创建人员*/ | ||
| 36 | + @ApiModelProperty(value = "创建人员", example = "1") | ||
| 37 | + private Long createBy; | ||
| 38 | + /***上报时间*/ | ||
| 39 | + @ApiModelProperty(value = "上报时间") | ||
| 40 | + private java.util.Date createTime; | ||
| 41 | + /***修改人员*/ | ||
| 42 | + @ApiModelProperty(value = "修改人员", example = "1") | ||
| 43 | + private Long updateBy; | ||
| 44 | + /***修改时间*/ | ||
| 45 | + @ApiModelProperty(value = "修改时间") | ||
| 46 | + private java.util.Date updateTime; | ||
| 47 | + /***是否删除,0 未删除;1是删除*/ | ||
| 48 | + @ApiModelProperty(value = "是否删除,0 未删除;1是删除") | ||
| 49 | + private Boolean delFlag; | ||
| 50 | + /***操作人员*/ | ||
| 51 | + @ApiModelProperty(value = "操作人员") | ||
| 52 | + private String operator; | ||
| 53 | + | ||
| 54 | + | ||
| 55 | + public void clearStrEmpty() { | ||
| 56 | + if (org.apache.commons.lang3.StringUtils.isEmpty(this.deviceCode)) { | ||
| 57 | + this.deviceCode = null; | ||
| 58 | + } | ||
| 59 | + if (org.apache.commons.lang3.StringUtils.isEmpty(this.jobCode)) { | ||
| 60 | + this.jobCode = null; | ||
| 61 | + } | ||
| 62 | + if (org.apache.commons.lang3.StringUtils.isEmpty(this.remark)) { | ||
| 63 | + this.remark = null; | ||
| 64 | + } | ||
| 65 | + if (org.apache.commons.lang3.StringUtils.isEmpty(this.status)) { | ||
| 66 | + this.status = null; | ||
| 67 | + } | ||
| 68 | + if (org.apache.commons.lang3.StringUtils.isEmpty(this.operator)) { | ||
| 69 | + this.operator = null; | ||
| 70 | + } | ||
| 71 | + } | ||
| 72 | + | ||
| 73 | + | ||
| 74 | + @Override | ||
| 75 | + public String toString() { | ||
| 76 | + return com.alibaba.fastjson2.JSON.toJSONString(this); | ||
| 77 | + } | ||
| 78 | +} | ||
| 0 | \ No newline at end of file | 79 | \ No newline at end of file |
Bsth-admin/src/main/java/com/ruoyi/domain/equipment/alert/dto/EquipmentAlertQueryDTO.java
0 → 100644
| 1 | +package com.ruoyi.domain.equipment.alert.dto; | ||
| 2 | + | ||
| 3 | +import io.swagger.annotations.ApiModel; | ||
| 4 | +import io.swagger.annotations.ApiModelProperty; | ||
| 5 | +import lombok.Data; | ||
| 6 | +import lombok.EqualsAndHashCode; | ||
| 7 | +import lombok.experimental.Accessors; | ||
| 8 | + | ||
| 9 | +@Data | ||
| 10 | +@ApiModel(value = "设备警报信息的查询DTO") | ||
| 11 | +@Accessors(chain = true) | ||
| 12 | +@EqualsAndHashCode(callSuper = false) | ||
| 13 | +/**设备警报信息 DTO*/ | ||
| 14 | +public class EquipmentAlertQueryDTO implements java.io.Serializable { | ||
| 15 | + private static final long serialVersionUID = 994372684L; | ||
| 16 | + | ||
| 17 | + /***ID*/ | ||
| 18 | + @ApiModelProperty(value = "ID", example = "1") | ||
| 19 | + private Long id; | ||
| 20 | + /***设备编号*/ | ||
| 21 | + @ApiModelProperty(value = "设备编号") | ||
| 22 | + private String deviceCode; | ||
| 23 | + /***1:未关舱门*/ | ||
| 24 | + @ApiModelProperty(value = "1:未关舱门", example = "1") | ||
| 25 | + private Integer type; | ||
| 26 | + /***操作人员*/ | ||
| 27 | + @ApiModelProperty(value = "操作人员") | ||
| 28 | + private String jobCode; | ||
| 29 | + /***备注*/ | ||
| 30 | + @ApiModelProperty(value = "备注") | ||
| 31 | + private String remark; | ||
| 32 | + /***1:已处理;0未处理*/ | ||
| 33 | + @ApiModelProperty(value = "1:已处理;0未处理") | ||
| 34 | + private String status; | ||
| 35 | + /***创建人员*/ | ||
| 36 | + @ApiModelProperty(value = "创建人员", example = "1") | ||
| 37 | + private Long createBy; | ||
| 38 | + /***上报时间*/ | ||
| 39 | + @ApiModelProperty(value = "上报时间") | ||
| 40 | + private java.util.Date createTime; | ||
| 41 | + /***修改人员*/ | ||
| 42 | + @ApiModelProperty(value = "修改人员", example = "1") | ||
| 43 | + private Long updateBy; | ||
| 44 | + /***修改时间*/ | ||
| 45 | + @ApiModelProperty(value = "修改时间") | ||
| 46 | + private java.util.Date updateTime; | ||
| 47 | + /***是否删除,0 未删除;1是删除*/ | ||
| 48 | + @ApiModelProperty(value = "是否删除,0 未删除;1是删除") | ||
| 49 | + private Boolean delFlag; | ||
| 50 | + | ||
| 51 | + | ||
| 52 | + public void clearStrEmpty() { | ||
| 53 | + if (org.apache.commons.lang3.StringUtils.isEmpty(this.deviceCode)) { | ||
| 54 | + this.deviceCode = null; | ||
| 55 | + } | ||
| 56 | + if (org.apache.commons.lang3.StringUtils.isEmpty(this.jobCode)) { | ||
| 57 | + this.jobCode = null; | ||
| 58 | + } | ||
| 59 | + if (org.apache.commons.lang3.StringUtils.isEmpty(this.remark)) { | ||
| 60 | + this.remark = null; | ||
| 61 | + } | ||
| 62 | + if (org.apache.commons.lang3.StringUtils.isEmpty(this.status)) { | ||
| 63 | + this.status = null; | ||
| 64 | + } | ||
| 65 | + } | ||
| 66 | + | ||
| 67 | + | ||
| 68 | + @Override | ||
| 69 | + public String toString() { | ||
| 70 | + return com.alibaba.fastjson2.JSON.toJSONString(this); | ||
| 71 | + } | ||
| 72 | +} | ||
| 0 | \ No newline at end of file | 73 | \ No newline at end of file |
Bsth-admin/src/main/java/com/ruoyi/domain/equipment/alert/dto/EquipmentAlertUpdateDTO.java
0 → 100644
| 1 | +package com.ruoyi.domain.equipment.alert.dto; | ||
| 2 | + | ||
| 3 | +import io.swagger.annotations.ApiModel; | ||
| 4 | +import io.swagger.annotations.ApiModelProperty; | ||
| 5 | +import lombok.Data; | ||
| 6 | +import lombok.EqualsAndHashCode; | ||
| 7 | +import lombok.experimental.Accessors; | ||
| 8 | + | ||
| 9 | +@Data | ||
| 10 | +@ApiModel(value = "设备警报信息的修改DTO") | ||
| 11 | +@Accessors(chain = true) | ||
| 12 | +@EqualsAndHashCode(callSuper = false) | ||
| 13 | +/**设备警报信息 DTO*/ | ||
| 14 | +public class EquipmentAlertUpdateDTO implements java.io.Serializable { | ||
| 15 | + private static final long serialVersionUID = 806250211L; | ||
| 16 | + | ||
| 17 | + /***ID*/ | ||
| 18 | + @ApiModelProperty(value = "ID", example = "1") | ||
| 19 | + private Long id; | ||
| 20 | + /***设备编号*/ | ||
| 21 | + @ApiModelProperty(value = "设备编号") | ||
| 22 | + private String deviceCode; | ||
| 23 | + /***1:未关舱门*/ | ||
| 24 | + @ApiModelProperty(value = "1:未关舱门", example = "1") | ||
| 25 | + private Integer type; | ||
| 26 | + /***操作人员*/ | ||
| 27 | + @ApiModelProperty(value = "操作人员") | ||
| 28 | + private String jobCode; | ||
| 29 | + /***备注*/ | ||
| 30 | + @ApiModelProperty(value = "备注") | ||
| 31 | + private String remark; | ||
| 32 | + /***1:已处理;0未处理*/ | ||
| 33 | + @ApiModelProperty(value = "1:已处理;0未处理") | ||
| 34 | + private String status; | ||
| 35 | + /***创建人员*/ | ||
| 36 | + @ApiModelProperty(value = "创建人员", example = "1") | ||
| 37 | + private Long createBy; | ||
| 38 | + /***上报时间*/ | ||
| 39 | + @ApiModelProperty(value = "上报时间") | ||
| 40 | + private java.util.Date createTime; | ||
| 41 | + /***修改人员*/ | ||
| 42 | + @ApiModelProperty(value = "修改人员", example = "1") | ||
| 43 | + private Long updateBy; | ||
| 44 | + /***修改时间*/ | ||
| 45 | + @ApiModelProperty(value = "修改时间") | ||
| 46 | + private java.util.Date updateTime; | ||
| 47 | + /***是否删除,0 未删除;1是删除*/ | ||
| 48 | + @ApiModelProperty(value = "是否删除,0 未删除;1是删除") | ||
| 49 | + private Boolean delFlag; | ||
| 50 | + /***操作人员*/ | ||
| 51 | + @ApiModelProperty(value = "操作人员") | ||
| 52 | + private String operator; | ||
| 53 | + | ||
| 54 | + | ||
| 55 | + public void clearStrEmpty() { | ||
| 56 | + if (org.apache.commons.lang3.StringUtils.isEmpty(this.deviceCode)) { | ||
| 57 | + this.deviceCode = null; | ||
| 58 | + } | ||
| 59 | + if (org.apache.commons.lang3.StringUtils.isEmpty(this.jobCode)) { | ||
| 60 | + this.jobCode = null; | ||
| 61 | + } | ||
| 62 | + if (org.apache.commons.lang3.StringUtils.isEmpty(this.remark)) { | ||
| 63 | + this.remark = null; | ||
| 64 | + } | ||
| 65 | + if (org.apache.commons.lang3.StringUtils.isEmpty(this.status)) { | ||
| 66 | + this.status = null; | ||
| 67 | + } | ||
| 68 | + if (org.apache.commons.lang3.StringUtils.isEmpty(this.operator)) { | ||
| 69 | + this.operator = null; | ||
| 70 | + } | ||
| 71 | + } | ||
| 72 | + | ||
| 73 | + | ||
| 74 | + @Override | ||
| 75 | + public String toString() { | ||
| 76 | + return com.alibaba.fastjson2.JSON.toJSONString(this); | ||
| 77 | + } | ||
| 78 | +} | ||
| 0 | \ No newline at end of file | 79 | \ No newline at end of file |
Bsth-admin/src/main/java/com/ruoyi/domain/equipment/alert/dto/EquipmentAlertUpdateStatusDTO.java
0 → 100644
| 1 | +package com.ruoyi.domain.equipment.alert.dto; | ||
| 2 | + | ||
| 3 | +import io.swagger.annotations.ApiModel; | ||
| 4 | +import io.swagger.annotations.ApiModelProperty; | ||
| 5 | +import lombok.Data; | ||
| 6 | +import lombok.EqualsAndHashCode; | ||
| 7 | +import lombok.experimental.Accessors; | ||
| 8 | + | ||
| 9 | +@Data | ||
| 10 | +@ApiModel(value = "设备警报信息的修改状态DTO") | ||
| 11 | +@Accessors(chain = true) | ||
| 12 | +@EqualsAndHashCode(callSuper = false) | ||
| 13 | +/**设备警报信息 DTO*/ | ||
| 14 | +public class EquipmentAlertUpdateStatusDTO implements java.io.Serializable { | ||
| 15 | + private static final long serialVersionUID = 385884175L; | ||
| 16 | + | ||
| 17 | + /***ID*/ | ||
| 18 | + @ApiModelProperty(value = "ID", example = "1") | ||
| 19 | + private Long id; | ||
| 20 | + /***设备编号*/ | ||
| 21 | + @ApiModelProperty(value = "设备编号") | ||
| 22 | + private String deviceCode; | ||
| 23 | + /***1:未关舱门*/ | ||
| 24 | + @ApiModelProperty(value = "1:未关舱门", example = "1") | ||
| 25 | + private Integer type; | ||
| 26 | + /***操作人员*/ | ||
| 27 | + @ApiModelProperty(value = "操作人员") | ||
| 28 | + private String jobCode; | ||
| 29 | + /***备注*/ | ||
| 30 | + @ApiModelProperty(value = "备注") | ||
| 31 | + private String remark; | ||
| 32 | + /***1:已处理;0未处理*/ | ||
| 33 | + @ApiModelProperty(value = "1:已处理;0未处理") | ||
| 34 | + private String status; | ||
| 35 | + /***创建人员*/ | ||
| 36 | + @ApiModelProperty(value = "创建人员", example = "1") | ||
| 37 | + private Long createBy; | ||
| 38 | + /***上报时间*/ | ||
| 39 | + @ApiModelProperty(value = "上报时间") | ||
| 40 | + private java.util.Date createTime; | ||
| 41 | + /***修改人员*/ | ||
| 42 | + @ApiModelProperty(value = "修改人员", example = "1") | ||
| 43 | + private Long updateBy; | ||
| 44 | + /***修改时间*/ | ||
| 45 | + @ApiModelProperty(value = "修改时间") | ||
| 46 | + private java.util.Date updateTime; | ||
| 47 | + /***是否删除,0 未删除;1是删除*/ | ||
| 48 | + @ApiModelProperty(value = "是否删除,0 未删除;1是删除") | ||
| 49 | + private Boolean delFlag; | ||
| 50 | + /***操作人员*/ | ||
| 51 | + @ApiModelProperty(value = "操作人员") | ||
| 52 | + private String operator; | ||
| 53 | + | ||
| 54 | + | ||
| 55 | + public void clearStrEmpty() { | ||
| 56 | + if (org.apache.commons.lang3.StringUtils.isEmpty(this.deviceCode)) { | ||
| 57 | + this.deviceCode = null; | ||
| 58 | + } | ||
| 59 | + if (org.apache.commons.lang3.StringUtils.isEmpty(this.jobCode)) { | ||
| 60 | + this.jobCode = null; | ||
| 61 | + } | ||
| 62 | + if (org.apache.commons.lang3.StringUtils.isEmpty(this.remark)) { | ||
| 63 | + this.remark = null; | ||
| 64 | + } | ||
| 65 | + if (org.apache.commons.lang3.StringUtils.isEmpty(this.status)) { | ||
| 66 | + this.status = null; | ||
| 67 | + } | ||
| 68 | + if (org.apache.commons.lang3.StringUtils.isEmpty(this.operator)) { | ||
| 69 | + this.operator = null; | ||
| 70 | + } | ||
| 71 | + } | ||
| 72 | + | ||
| 73 | + | ||
| 74 | + @Override | ||
| 75 | + public String toString() { | ||
| 76 | + return com.alibaba.fastjson2.JSON.toJSONString(this); | ||
| 77 | + } | ||
| 78 | +} | ||
| 0 | \ No newline at end of file | 79 | \ No newline at end of file |
Bsth-admin/src/main/java/com/ruoyi/domain/equipment/alert/vo/EquipmentAlertVO.java
0 → 100644
| 1 | +package com.ruoyi.domain.equipment.alert.vo; | ||
| 2 | + | ||
| 3 | +import io.swagger.annotations.ApiModel; | ||
| 4 | +import io.swagger.annotations.ApiModelProperty; | ||
| 5 | + | ||
| 6 | +import lombok.Data; | ||
| 7 | +import lombok.EqualsAndHashCode; | ||
| 8 | +import lombok.experimental.Accessors; | ||
| 9 | +import lombok.NoArgsConstructor; | ||
| 10 | +import lombok.AllArgsConstructor; | ||
| 11 | + | ||
| 12 | +@Data | ||
| 13 | +@NoArgsConstructor | ||
| 14 | +@AllArgsConstructor | ||
| 15 | +@ApiModel(value = "设备警报信息的VO") | ||
| 16 | +@Accessors(chain = true) | ||
| 17 | +@EqualsAndHashCode(callSuper = false) | ||
| 18 | +/**设备警报信息 VO*/ | ||
| 19 | +public class EquipmentAlertVO implements java.io.Serializable { | ||
| 20 | + private static final long serialVersionUID = 589148312L; | ||
| 21 | + | ||
| 22 | + /***ID*/ | ||
| 23 | + @ApiModelProperty(value = "ID", example = "1") | ||
| 24 | + private Long id; | ||
| 25 | + /***设备编号*/ | ||
| 26 | + @ApiModelProperty(value = "设备编号") | ||
| 27 | + private String deviceCode; | ||
| 28 | + /***1:未关舱门*/ | ||
| 29 | + @ApiModelProperty(value = "1:未关舱门", example = "1") | ||
| 30 | + private Integer type; | ||
| 31 | + /***操作人员*/ | ||
| 32 | + @ApiModelProperty(value = "操作人员") | ||
| 33 | + private String jobCode; | ||
| 34 | + /***备注*/ | ||
| 35 | + @ApiModelProperty(value = "备注") | ||
| 36 | + private String remark; | ||
| 37 | + /***1:已处理;0未处理*/ | ||
| 38 | + @ApiModelProperty(value = "1:已处理;0未处理") | ||
| 39 | + private String status; | ||
| 40 | + /***创建人员*/ | ||
| 41 | + @ApiModelProperty(value = "创建人员", example = "1") | ||
| 42 | + private Long createBy; | ||
| 43 | + /***上报时间*/ | ||
| 44 | + @ApiModelProperty(value = "上报时间") | ||
| 45 | + private java.util.Date createTime; | ||
| 46 | + /***修改人员*/ | ||
| 47 | + @ApiModelProperty(value = "修改人员", example = "1") | ||
| 48 | + private Long updateBy; | ||
| 49 | + /***修改时间*/ | ||
| 50 | + @ApiModelProperty(value = "修改时间") | ||
| 51 | + private java.util.Date updateTime; | ||
| 52 | + /***是否删除,0 未删除;1是删除*/ | ||
| 53 | + @ApiModelProperty(value = "是否删除,0 未删除;1是删除") | ||
| 54 | + private Boolean delFlag; | ||
| 55 | + | ||
| 56 | + | ||
| 57 | + @Override | ||
| 58 | + public String toString() { | ||
| 59 | + return com.alibaba.fastjson2.JSON.toJSONString(this); | ||
| 60 | + } | ||
| 61 | +} | ||
| 0 | \ No newline at end of file | 62 | \ No newline at end of file |
Bsth-admin/src/main/java/com/ruoyi/mapper/equipment/alert/EquipmentAlertMapper.java
0 → 100644
| 1 | +package com.ruoyi.mapper.equipment.alert; | ||
| 2 | + | ||
| 3 | +import com.baomidou.mybatisplus.core.mapper.BaseMapper; | ||
| 4 | +import com.ruoyi.domain.equipment.alert.EquipmentAlert; | ||
| 5 | +import org.apache.ibatis.annotations.Mapper; | ||
| 6 | + | ||
| 7 | + | ||
| 8 | +@Mapper | ||
| 9 | +/**设备警报信息 Mapper接口*/ | ||
| 10 | +public interface EquipmentAlertMapper extends BaseMapper<EquipmentAlert> { | ||
| 11 | + /** | ||
| 12 | + * 插入有值的列 | ||
| 13 | + */ | ||
| 14 | + int insertSelective(EquipmentAlert name); | ||
| 15 | +} | ||
| 0 | \ No newline at end of file | 16 | \ No newline at end of file |
Bsth-admin/src/main/java/com/ruoyi/service/equipment/alert/EquipmentAlertService.java
0 → 100644
| 1 | +package com.ruoyi.service.equipment.alert; | ||
| 2 | + | ||
| 3 | +import com.baomidou.mybatisplus.core.metadata.IPage; | ||
| 4 | +import com.baomidou.mybatisplus.extension.service.IService; | ||
| 5 | +import com.ruoyi.domain.OrderEntity; | ||
| 6 | +import com.ruoyi.domain.equipment.alert.EquipmentAlert; | ||
| 7 | + | ||
| 8 | +import java.util.List; | ||
| 9 | + | ||
| 10 | + | ||
| 11 | +/** | ||
| 12 | + * 设备警报信息 Service接口 | ||
| 13 | + */ | ||
| 14 | +public interface EquipmentAlertService extends IService<EquipmentAlert> { | ||
| 15 | + /** | ||
| 16 | + * 分页查询 | ||
| 17 | + */ | ||
| 18 | + IPage<EquipmentAlert> pageList(com.baomidou.mybatisplus.extension.plugins.pagination.Page<EquipmentAlert> page, EquipmentAlert entity, OrderEntity orderEntity); | ||
| 19 | + | ||
| 20 | + /** | ||
| 21 | + * 带条件查询 | ||
| 22 | + */ | ||
| 23 | + List<EquipmentAlert> list(EquipmentAlert entity); | ||
| 24 | + | ||
| 25 | + // List<EquipmentAlert> listOfIds(java.util.Collection<java.lang.Long> ids); | ||
| 26 | + // /*** | ||
| 27 | + // *用于页面选择 | ||
| 28 | + // */ | ||
| 29 | + // List<EquipmentAlert> listOfSelect(EquipmentAlert entity); | ||
| 30 | + | ||
| 31 | + /** | ||
| 32 | + * 条件查询只返回一条数据的方法 | ||
| 33 | + */ | ||
| 34 | + EquipmentAlert getOne(EquipmentAlert entity); | ||
| 35 | + | ||
| 36 | + Integer countId(EquipmentAlert entity); | ||
| 37 | + | ||
| 38 | + /** | ||
| 39 | + * 插入有值的列 | ||
| 40 | + */ | ||
| 41 | + int insertSelective(EquipmentAlert entity); | ||
| 42 | + | ||
| 43 | + /***插入数据*/ | ||
| 44 | + boolean insert(EquipmentAlert entity); | ||
| 45 | + | ||
| 46 | + /** | ||
| 47 | + * 根据主键修改数据 | ||
| 48 | + */ | ||
| 49 | + boolean updateByPrimaryKey(EquipmentAlert entity); | ||
| 50 | + | ||
| 51 | +} | ||
| 0 | \ No newline at end of file | 52 | \ No newline at end of file |
Bsth-admin/src/main/java/com/ruoyi/service/impl/equipment/alert/EquipmentAlertServiceImpl.java
0 → 100644
| 1 | +package com.ruoyi.service.impl.equipment.alert; | ||
| 2 | + | ||
| 3 | +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; | ||
| 4 | +import com.baomidou.mybatisplus.core.metadata.IPage; | ||
| 5 | +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; | ||
| 6 | +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; | ||
| 7 | +import com.github.pagehelper.PageHelper; | ||
| 8 | +import com.ruoyi.domain.OrderEntity; | ||
| 9 | +import com.ruoyi.domain.equipment.alert.EquipmentAlert; | ||
| 10 | +import com.ruoyi.mapper.equipment.alert.EquipmentAlertMapper; | ||
| 11 | +import com.ruoyi.service.equipment.alert.EquipmentAlertService; | ||
| 12 | +import lombok.extern.slf4j.Slf4j; | ||
| 13 | +import org.springframework.beans.factory.annotation.Autowired; | ||
| 14 | +import org.springframework.stereotype.Service; | ||
| 15 | + | ||
| 16 | +import java.util.Collections; | ||
| 17 | +import java.util.List; | ||
| 18 | + | ||
| 19 | +@Slf4j | ||
| 20 | +@Service | ||
| 21 | +/**设备警报信息 Service实现类*/ | ||
| 22 | +public class EquipmentAlertServiceImpl extends ServiceImpl<EquipmentAlertMapper, EquipmentAlert> implements EquipmentAlertService { | ||
| 23 | + @Autowired | ||
| 24 | + private EquipmentAlertMapper equipmentAlertMapper; | ||
| 25 | + | ||
| 26 | + /** | ||
| 27 | + * 分页查询 | ||
| 28 | + */ | ||
| 29 | + @Override | ||
| 30 | + public IPage<EquipmentAlert> pageList(Page<EquipmentAlert> page, EquipmentAlert entity, OrderEntity orderEntity) { | ||
| 31 | + LambdaQueryWrapper<EquipmentAlert> countWrapper = new LambdaQueryWrapper<>(entity); | ||
| 32 | + countWrapper.select(EquipmentAlert::getId); | ||
| 33 | + int count = count(countWrapper); | ||
| 34 | + | ||
| 35 | + List<EquipmentAlert> lists = Collections.emptyList(); | ||
| 36 | + if (count > 0) { | ||
| 37 | + PageHelper.startPage((int) page.getCurrent(), (int) page.getSize(), false); | ||
| 38 | + LambdaQueryWrapper<EquipmentAlert> selectWrapper = new LambdaQueryWrapper<>(entity); | ||
| 39 | + orderColumn(selectWrapper, orderEntity); | ||
| 40 | + lists = list(selectWrapper); | ||
| 41 | + } | ||
| 42 | + | ||
| 43 | + IPage<EquipmentAlert> returnPage = new Page<EquipmentAlert>(); | ||
| 44 | + returnPage.setRecords(lists); | ||
| 45 | + returnPage.setPages(count % page.getSize() == 0 ? count / page.getSize() : count / page.getSize() + 1); | ||
| 46 | + returnPage.setCurrent(page.getCurrent()); | ||
| 47 | + returnPage.setSize(page.getSize()); | ||
| 48 | + returnPage.setTotal(count); | ||
| 49 | + | ||
| 50 | + return returnPage; | ||
| 51 | + } | ||
| 52 | + | ||
| 53 | + @Override | ||
| 54 | + public List<EquipmentAlert> list(EquipmentAlert entity) { | ||
| 55 | + return list(new LambdaQueryWrapper<>(entity)); | ||
| 56 | + } | ||
| 57 | + // @Override | ||
| 58 | + // public List<EquipmentAlert> listOfSelect(EquipmentAlert entity) { | ||
| 59 | + // LambdaQueryWrapper<EquipmentAlert> wrapper = new LambdaQueryWrapper<>(entity); | ||
| 60 | + // wrapper.select(EquipmentAlert::, EquipmentAlert::); | ||
| 61 | + // return list(wrapper); | ||
| 62 | + // } | ||
| 63 | + | ||
| 64 | + // @Override | ||
| 65 | + // public List<EquipmentAlert> listOfIds(java.util.Collection<java.lang.Long> ids) { | ||
| 66 | + // if (org.springframework.util.CollectionUtils.isEmpty(ids)) { | ||
| 67 | + // return java.util.Collections.emptyList(); | ||
| 68 | + // } | ||
| 69 | + // LambdaQueryWrapper<EquipmentAlert> wrapper = new LambdaQueryWrapper<>(); | ||
| 70 | + // wrapper.select(EquipmentAlert::getId,EquipmentAlert::); | ||
| 71 | + // wrapper.in(EquipmentAlert::getId, ids); | ||
| 72 | + // return list(wrapper); | ||
| 73 | + // } | ||
| 74 | + | ||
| 75 | + @Override | ||
| 76 | + public EquipmentAlert getOne(EquipmentAlert entity) { | ||
| 77 | + return getOne(new LambdaQueryWrapper<>(entity)); | ||
| 78 | + } | ||
| 79 | + | ||
| 80 | + @Override | ||
| 81 | + public Integer countId(EquipmentAlert entity) { | ||
| 82 | + LambdaQueryWrapper<EquipmentAlert> wrapper = new LambdaQueryWrapper<>(entity); | ||
| 83 | + wrapper.select(EquipmentAlert::getId); | ||
| 84 | + return count(wrapper); | ||
| 85 | + } | ||
| 86 | + | ||
| 87 | + | ||
| 88 | + /** | ||
| 89 | + * 插入有值的列 | ||
| 90 | + */ | ||
| 91 | + @Override | ||
| 92 | + public int insertSelective(EquipmentAlert entity) { | ||
| 93 | + return equipmentAlertMapper.insertSelective(entity); | ||
| 94 | + } | ||
| 95 | + | ||
| 96 | + /** | ||
| 97 | + * 插入数据 | ||
| 98 | + */ | ||
| 99 | + @Override | ||
| 100 | + public boolean insert(EquipmentAlert entity) { | ||
| 101 | + return save(entity); | ||
| 102 | + } | ||
| 103 | + | ||
| 104 | + /** | ||
| 105 | + * 根据主键修改数据 | ||
| 106 | + */ | ||
| 107 | + @Override | ||
| 108 | + public boolean updateByPrimaryKey(EquipmentAlert entity) { | ||
| 109 | + return updateById(entity); | ||
| 110 | + } | ||
| 111 | + | ||
| 112 | + | ||
| 113 | + public static void orderColumn(LambdaQueryWrapper<EquipmentAlert> wrapper, OrderEntity orderEntity) { | ||
| 114 | + if (org.apache.commons.lang3.StringUtils.equals("ascending", orderEntity.getOrder())) { | ||
| 115 | + if (org.apache.commons.lang3.StringUtils.equals(orderEntity.getProp(), "id")) { | ||
| 116 | + wrapper.orderByAsc(EquipmentAlert::getId); | ||
| 117 | + } | ||
| 118 | + if (org.apache.commons.lang3.StringUtils.equals(orderEntity.getProp(), "deviceCode")) { | ||
| 119 | + wrapper.orderByAsc(EquipmentAlert::getDeviceCode); | ||
| 120 | + } | ||
| 121 | + if (org.apache.commons.lang3.StringUtils.equals(orderEntity.getProp(), "type")) { | ||
| 122 | + wrapper.orderByAsc(EquipmentAlert::getType); | ||
| 123 | + } | ||
| 124 | + if (org.apache.commons.lang3.StringUtils.equals(orderEntity.getProp(), "jobCode")) { | ||
| 125 | + wrapper.orderByAsc(EquipmentAlert::getJobCode); | ||
| 126 | + } | ||
| 127 | + if (org.apache.commons.lang3.StringUtils.equals(orderEntity.getProp(), "remark")) { | ||
| 128 | + wrapper.orderByAsc(EquipmentAlert::getRemark); | ||
| 129 | + } | ||
| 130 | + if (org.apache.commons.lang3.StringUtils.equals(orderEntity.getProp(), "status")) { | ||
| 131 | + wrapper.orderByAsc(EquipmentAlert::getStatus); | ||
| 132 | + } | ||
| 133 | + if (org.apache.commons.lang3.StringUtils.equals(orderEntity.getProp(), "createBy")) { | ||
| 134 | + wrapper.orderByAsc(EquipmentAlert::getCreateBy); | ||
| 135 | + } | ||
| 136 | + if (org.apache.commons.lang3.StringUtils.equals(orderEntity.getProp(), "createTime")) { | ||
| 137 | + wrapper.orderByAsc(EquipmentAlert::getCreateTime); | ||
| 138 | + } | ||
| 139 | + if (org.apache.commons.lang3.StringUtils.equals(orderEntity.getProp(), "updateBy")) { | ||
| 140 | + wrapper.orderByAsc(EquipmentAlert::getUpdateBy); | ||
| 141 | + } | ||
| 142 | + if (org.apache.commons.lang3.StringUtils.equals(orderEntity.getProp(), "updateTime")) { | ||
| 143 | + wrapper.orderByAsc(EquipmentAlert::getUpdateTime); | ||
| 144 | + } | ||
| 145 | + if (org.apache.commons.lang3.StringUtils.equals(orderEntity.getProp(), "delFlag")) { | ||
| 146 | + wrapper.orderByAsc(EquipmentAlert::getDelFlag); | ||
| 147 | + } | ||
| 148 | + } else if (org.apache.commons.lang3.StringUtils.equals("descending", orderEntity.getOrder())) { | ||
| 149 | + if (org.apache.commons.lang3.StringUtils.equals(orderEntity.getProp(), "id")) { | ||
| 150 | + wrapper.orderByDesc(EquipmentAlert::getId); | ||
| 151 | + } | ||
| 152 | + if (org.apache.commons.lang3.StringUtils.equals(orderEntity.getProp(), "deviceCode")) { | ||
| 153 | + wrapper.orderByDesc(EquipmentAlert::getDeviceCode); | ||
| 154 | + } | ||
| 155 | + if (org.apache.commons.lang3.StringUtils.equals(orderEntity.getProp(), "type")) { | ||
| 156 | + wrapper.orderByDesc(EquipmentAlert::getType); | ||
| 157 | + } | ||
| 158 | + if (org.apache.commons.lang3.StringUtils.equals(orderEntity.getProp(), "jobCode")) { | ||
| 159 | + wrapper.orderByDesc(EquipmentAlert::getJobCode); | ||
| 160 | + } | ||
| 161 | + if (org.apache.commons.lang3.StringUtils.equals(orderEntity.getProp(), "remark")) { | ||
| 162 | + wrapper.orderByDesc(EquipmentAlert::getRemark); | ||
| 163 | + } | ||
| 164 | + if (org.apache.commons.lang3.StringUtils.equals(orderEntity.getProp(), "status")) { | ||
| 165 | + wrapper.orderByDesc(EquipmentAlert::getStatus); | ||
| 166 | + } | ||
| 167 | + if (org.apache.commons.lang3.StringUtils.equals(orderEntity.getProp(), "createBy")) { | ||
| 168 | + wrapper.orderByDesc(EquipmentAlert::getCreateBy); | ||
| 169 | + } | ||
| 170 | + if (org.apache.commons.lang3.StringUtils.equals(orderEntity.getProp(), "createTime")) { | ||
| 171 | + wrapper.orderByDesc(EquipmentAlert::getCreateTime); | ||
| 172 | + } | ||
| 173 | + if (org.apache.commons.lang3.StringUtils.equals(orderEntity.getProp(), "updateBy")) { | ||
| 174 | + wrapper.orderByDesc(EquipmentAlert::getUpdateBy); | ||
| 175 | + } | ||
| 176 | + if (org.apache.commons.lang3.StringUtils.equals(orderEntity.getProp(), "updateTime")) { | ||
| 177 | + wrapper.orderByDesc(EquipmentAlert::getUpdateTime); | ||
| 178 | + } | ||
| 179 | + if (org.apache.commons.lang3.StringUtils.equals(orderEntity.getProp(), "delFlag")) { | ||
| 180 | + wrapper.orderByDesc(EquipmentAlert::getDelFlag); | ||
| 181 | + } | ||
| 182 | + } else { | ||
| 183 | + wrapper.orderByDesc(EquipmentAlert::getId); | ||
| 184 | + } | ||
| 185 | + } | ||
| 186 | +} | ||
| 0 | \ No newline at end of file | 187 | \ No newline at end of file |
Bsth-admin/src/main/resources/mapper/equipment/alert/EquipmentAlertMapper.xml
0 → 100644
| 1 | +<?xml version="1.0" encoding="UTF-8"?> | ||
| 2 | +<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> | ||
| 3 | +<mapper namespace="com.ruoyi.mapper.equipment.alert.EquipmentAlertMapper"> | ||
| 4 | + <resultMap id="BaseResultMap" type="com.ruoyi.domain.equipment.alert.EquipmentAlert"> | ||
| 5 | + <id column="id" jdbcType="BIGINT" property="id"/> | ||
| 6 | + <result column="device_code" jdbcType="VARCHAR" property="deviceCode"/> | ||
| 7 | + <result column="type" jdbcType="INTEGER" property="type"/> | ||
| 8 | + <result column="job_code" jdbcType="VARCHAR" property="jobCode"/> | ||
| 9 | + <result column="remark" jdbcType="VARCHAR" property="remark"/> | ||
| 10 | + <result column="status" jdbcType="VARCHAR" property="status"/> | ||
| 11 | + <result column="create_by" jdbcType="BIGINT" property="createBy"/> | ||
| 12 | + <result column="create_time" jdbcType="TIMESTAMP" property="createTime"/> | ||
| 13 | + <result column="update_by" jdbcType="BIGINT" property="updateBy"/> | ||
| 14 | + <result column="update_time" jdbcType="TIMESTAMP" property="updateTime"/> | ||
| 15 | + <result column="del_flag" jdbcType="BIT" property="delFlag"/> | ||
| 16 | + </resultMap> | ||
| 17 | + | ||
| 18 | + <insert id="insertSelective" keyColumn="id" keyProperty="id" useGeneratedKeys="true" | ||
| 19 | + parameterType="com.ruoyi.domain.equipment.alert.EquipmentAlert"> | ||
| 20 | + INSERT INTO equipment_alert | ||
| 21 | + <include refid="insertSelectiveColumn"></include> | ||
| 22 | + <include refid="insertSelectiveValue"></include> | ||
| 23 | + </insert> | ||
| 24 | + | ||
| 25 | + <sql id="columns"> | ||
| 26 | + id | ||
| 27 | + , device_code , type , job_code , remark , status , create_by , create_time , update_by , update_time , del_flag | ||
| 28 | + </sql> | ||
| 29 | + | ||
| 30 | + <sql id="insert_columns"> | ||
| 31 | + id | ||
| 32 | + , device_code , type , job_code , remark , status , create_by , create_time , update_by , update_time , del_flag | ||
| 33 | + </sql> | ||
| 34 | + | ||
| 35 | + <sql id="insert_values"> | ||
| 36 | + #{id} | ||
| 37 | + , | ||
| 38 | + #{deviceCode}, | ||
| 39 | + #{type}, | ||
| 40 | + #{jobCode}, | ||
| 41 | + #{remark}, | ||
| 42 | + #{status}, | ||
| 43 | + #{createBy}, | ||
| 44 | + #{createTime}, | ||
| 45 | + #{updateBy}, | ||
| 46 | + #{updateTime}, | ||
| 47 | + #{delFlag} | ||
| 48 | + </sql> | ||
| 49 | + | ||
| 50 | + <sql id="insertSelectiveColumn"> | ||
| 51 | + <trim prefix="(" suffix=")" suffixOverrides=","> | ||
| 52 | + <if test="null!=id">id,</if> | ||
| 53 | + <if test="null!=deviceCode">device_code,</if> | ||
| 54 | + <if test="null!=type">type,</if> | ||
| 55 | + <if test="null!=jobCode">job_code,</if> | ||
| 56 | + <if test="null!=remark">remark,</if> | ||
| 57 | + <if test="null!=status">status,</if> | ||
| 58 | + <if test="null!=createBy">create_by,</if> | ||
| 59 | + <if test="null!=createTime">create_time,</if> | ||
| 60 | + <if test="null!=updateBy">update_by,</if> | ||
| 61 | + <if test="null!=updateTime">update_time,</if> | ||
| 62 | + <if test="null!=delFlag">del_flag,</if> | ||
| 63 | + </trim> | ||
| 64 | + </sql> | ||
| 65 | + | ||
| 66 | + <sql id="insertSelectiveValue"> | ||
| 67 | + <trim prefix="values (" suffix=")" suffixOverrides=","> | ||
| 68 | + <if test="null!=id">#{id,jdbcType=BIGINT},</if> | ||
| 69 | + <if test="null!=deviceCode">#{deviceCode,jdbcType=VARCHAR},</if> | ||
| 70 | + <if test="null!=type">#{type,jdbcType=INTEGER},</if> | ||
| 71 | + <if test="null!=jobCode">#{jobCode,jdbcType=VARCHAR},</if> | ||
| 72 | + <if test="null!=remark">#{remark,jdbcType=VARCHAR},</if> | ||
| 73 | + <if test="null!=status">#{status,jdbcType=VARCHAR},</if> | ||
| 74 | + <if test="null!=createBy">#{createBy,jdbcType=BIGINT},</if> | ||
| 75 | + <if test="null!=createTime">#{createTime,jdbcType=TIMESTAMP},</if> | ||
| 76 | + <if test="null!=updateBy">#{updateBy,jdbcType=BIGINT},</if> | ||
| 77 | + <if test="null!=updateTime">#{updateTime,jdbcType=TIMESTAMP},</if> | ||
| 78 | + <if test="null!=delFlag">#{delFlag,jdbcType=BIT},</if> | ||
| 79 | + </trim> | ||
| 80 | + </sql> | ||
| 81 | + | ||
| 82 | + <sql id="updateByPrimaryKeySelectiveSql"> | ||
| 83 | + <set> | ||
| 84 | + <if test="null!=id">id = #{id,jdbcType=BIGINT},</if> | ||
| 85 | + <if test="null!=deviceCode">device_code = #{deviceCode,jdbcType=VARCHAR},</if> | ||
| 86 | + <if test="null!=type">type = #{type,jdbcType=INTEGER},</if> | ||
| 87 | + <if test="null!=jobCode">job_code = #{jobCode,jdbcType=VARCHAR},</if> | ||
| 88 | + <if test="null!=remark">remark = #{remark,jdbcType=VARCHAR},</if> | ||
| 89 | + <if test="null!=status">status = #{status,jdbcType=VARCHAR},</if> | ||
| 90 | + <if test="null!=createBy">create_by = #{createBy,jdbcType=BIGINT},</if> | ||
| 91 | + <if test="null!=createTime">create_time = #{createTime,jdbcType=TIMESTAMP},</if> | ||
| 92 | + <if test="null!=updateBy">update_by = #{updateBy,jdbcType=BIGINT},</if> | ||
| 93 | + <if test="null!=updateTime">update_time = #{updateTime,jdbcType=TIMESTAMP},</if> | ||
| 94 | + <if test="null!=delFlag">del_flag = #{delFlag,jdbcType=BIT},</if> | ||
| 95 | + </set> | ||
| 96 | + </sql> | ||
| 97 | + | ||
| 98 | + <sql id="where"> | ||
| 99 | + <if test="null!=id">AND id = #{id,jdbcType=BIGINT},</if> | ||
| 100 | + <if test="null!=deviceCode">AND device_code = #{deviceCode,jdbcType=VARCHAR},</if> | ||
| 101 | + <if test="null!=type">AND type = #{type,jdbcType=INTEGER},</if> | ||
| 102 | + <if test="null!=jobCode">AND job_code = #{jobCode,jdbcType=VARCHAR},</if> | ||
| 103 | + <if test="null!=remark">AND remark = #{remark,jdbcType=VARCHAR},</if> | ||
| 104 | + <if test="null!=status">AND status = #{status,jdbcType=VARCHAR},</if> | ||
| 105 | + <if test="null!=createBy">AND create_by = #{createBy,jdbcType=BIGINT},</if> | ||
| 106 | + <if test="null!=createTime">AND create_time = #{createTime,jdbcType=TIMESTAMP},</if> | ||
| 107 | + <if test="null!=updateBy">AND update_by = #{updateBy,jdbcType=BIGINT},</if> | ||
| 108 | + <if test="null!=updateTime">AND update_time = #{updateTime,jdbcType=TIMESTAMP},</if> | ||
| 109 | + <if test="null!=delFlag">AND del_flag = #{delFlag,jdbcType=BIT},</if> | ||
| 110 | + </sql> | ||
| 111 | +</mapper> | ||
| 0 | \ No newline at end of file | 112 | \ No newline at end of file |