* 预警确认 | * 预警确认 | ||||
*/ | */ | ||||
@PostMapping("/confirm") | @PostMapping("/confirm") | ||||
public JsonResult confirm(@RequestBody WarningConfirmRequest request){ | |||||
public JsonResult confirm(WarningConfirmRequest request){ | |||||
return warningService.confirm(request); | return warningService.confirm(request); | ||||
} | } | ||||
*/ | */ | ||||
private JsonResult check(Integer tenantId, WarningConfirmRequest request) { | private JsonResult check(Integer tenantId, WarningConfirmRequest request) { | ||||
// 判断预警id是否为空 | // 判断预警id是否为空 | ||||
if (ObjectUtil.isNotNull(request.getId())) { | |||||
if (ObjectUtil.isNull(request.getId())) { | |||||
throw new ServiceException("预警ID为空"); | throw new ServiceException("预警ID为空"); | ||||
} | } | ||||
Warning warning = warningMapper.selectOne(new LambdaQueryWrapper<Warning>() | Warning warning = warningMapper.selectOne(new LambdaQueryWrapper<Warning>() |
*/ | */ | ||||
private JsonResult check(Integer tenantId, Integer id) { | private JsonResult check(Integer tenantId, Integer id) { | ||||
// 判断预警id是否为空 | // 判断预警id是否为空 | ||||
if (ObjectUtil.isNotNull(id)) { | |||||
if (ObjectUtil.isNull(id)) { | |||||
throw new ServiceException("预警ID为空"); | throw new ServiceException("预警ID为空"); | ||||
} | } | ||||
Warning warning = warningMapper.selectOne(new LambdaQueryWrapper<Warning>() | Warning warning = warningMapper.selectOne(new LambdaQueryWrapper<Warning>() |
</select> | </select> | ||||
<update id="confirm" parameterType="hashmap"> | <update id="confirm" parameterType="hashmap"> | ||||
update th_inspection_file | |||||
update th_warning | |||||
<trim prefix="SET" suffixOverrides=","> | <trim prefix="SET" suffixOverrides=","> | ||||
<if test="status != null"> status = #{status}, </if> | <if test="status != null"> status = #{status}, </if> | ||||
<if test="updateUser != null and updateUser != ''"> update_user = #{updateUser}, </if> | <if test="updateUser != null and updateUser != ''"> update_user = #{updateUser}, </if> | ||||
</update> | </update> | ||||
<update id="ignore" parameterType="hashmap"> | <update id="ignore" parameterType="hashmap"> | ||||
update th_inspection_file | |||||
update th_warning | |||||
<trim prefix="SET" suffixOverrides=","> | <trim prefix="SET" suffixOverrides=","> | ||||
<if test="status != null"> status = #{status}, </if> | <if test="status != null"> status = #{status}, </if> | ||||
<if test="updateUser != null and updateUser != ''"> update_user = #{updateUser}, </if> | <if test="updateUser != null and updateUser != ''"> update_user = #{updateUser}, </if> |