From 169c2cf67202ffef9119f0042146b186b8ae193c Mon Sep 17 00:00:00 2001 From: wangsixiang <2970484253@qq.com> Date: Tue, 27 Feb 2024 11:28:25 +0800 Subject: [PATCH] =?UTF-8?q?=E6=84=9F=E7=9F=A5=E4=BA=8B=E4=BB=B6=E5=88=A0?= =?UTF-8?q?=E9=99=A4=E6=8E=A5=E5=8F=A3,=E6=A1=A9=E5=8F=B7=E6=97=B6?= =?UTF-8?q?=E9=97=B4=E6=9F=A5=E8=AF=A2=E6=84=9F=E7=9F=A5=E4=BA=8B=E4=BB=B6?= =?UTF-8?q?=E6=95=B0=E9=87=8F=E4=BC=98=E5=8C=96=EF=BC=8C=E5=BA=94=E6=80=A5?= =?UTF-8?q?=E4=BA=BA=E5=91=98=E6=90=9C=E7=B4=A2=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/DcEmployeesController.java | 5 ++++ .../controller/DcWarningController.java | 30 +++++++++++-------- .../zc/business/mapper/DcWarningMapper.java | 7 +++-- .../business/service/IDcWarningService.java | 6 ++-- .../service/impl/DcWarningServiceImpl.java | 11 +++++-- .../mapper/business/DcEmployeesMapper.xml | 3 +- .../DcPerceivedEventsWarningMapper.xml | 29 ++++++++++++------ .../mapper/business/DcWarningMapper.xml | 8 ++--- 8 files changed, 65 insertions(+), 34 deletions(-) diff --git a/zc-business/src/main/java/com/zc/business/controller/DcEmployeesController.java b/zc-business/src/main/java/com/zc/business/controller/DcEmployeesController.java index d75ad4fc..92ac39f9 100644 --- a/zc-business/src/main/java/com/zc/business/controller/DcEmployeesController.java +++ b/zc-business/src/main/java/com/zc/business/controller/DcEmployeesController.java @@ -48,6 +48,11 @@ public class DcEmployeesController extends BaseController public TableDataInfo list(DcEmployees dcEmployees) { startPage(); + String name = dcEmployees.getName(); + if (name != null && !name.isEmpty()) { + name = name.replace(" ", ""); // 去掉空格 + dcEmployees.setName(name); + } List list = dcEmployeesService.selectDcEmployeesList(dcEmployees); return getDataTable(list); } diff --git a/zc-business/src/main/java/com/zc/business/controller/DcWarningController.java b/zc-business/src/main/java/com/zc/business/controller/DcWarningController.java index 2c5caa34..f53480ad 100644 --- a/zc-business/src/main/java/com/zc/business/controller/DcWarningController.java +++ b/zc-business/src/main/java/com/zc/business/controller/DcWarningController.java @@ -9,6 +9,7 @@ import com.ruoyi.common.core.page.TableDataInfo; import com.ruoyi.common.enums.BusinessType; import com.ruoyi.common.utils.poi.ExcelUtil; import com.zc.business.domain.DcWarning; +import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.web.bind.annotation.DeleteMapping; @@ -62,15 +63,7 @@ public class DcWarningController extends BaseController util.exportExcel(response, list, "预警信息数据"); } - /** - * 获取预警信息详细信息 - */ - @PreAuthorize("@ss.hasPermi('business:warning:query')") - @GetMapping(value = "/{id}") - public AjaxResult getInfo(@PathVariable("id") Integer id) - { - return AjaxResult.success(dcWarningService.selectDcWarningById(id)); - } + /** * 新增预警信息 @@ -102,10 +95,10 @@ public class DcWarningController extends BaseController */ @PreAuthorize("@ss.hasPermi('business:warning:remove')") @Log(title = "预警信息", businessType = BusinessType.DELETE) - @DeleteMapping("/{ids}") - public AjaxResult remove(@PathVariable Integer[] ids) + @DeleteMapping("/{id}") + public AjaxResult remove(@PathVariable String id) { - return toAjax(dcWarningService.deleteDcWarningByIds(ids)); + return toAjax(dcWarningService.deleteDcWarningByIds(id)); } //感知事件转交通事件 @@ -114,4 +107,17 @@ public class DcWarningController extends BaseController { return dcWarningService.updateWarningConvert(dcWarning); } + //感知事件转交通事件 + @PostMapping("/delete") + public AjaxResult deleteDcWarningByStringId(@RequestBody DcWarning dcWarning) + { + if (dcWarning==null){ + return AjaxResult.error("参数错误"); + } + if (StringUtils.isBlank(dcWarning.getId())){ + return AjaxResult.error("参数错误"); + } + return toAjax(dcWarningService.deleteDcWarningByStringId(dcWarning)); + } + } diff --git a/zc-business/src/main/java/com/zc/business/mapper/DcWarningMapper.java b/zc-business/src/main/java/com/zc/business/mapper/DcWarningMapper.java index 65770819..58d60eaf 100644 --- a/zc-business/src/main/java/com/zc/business/mapper/DcWarningMapper.java +++ b/zc-business/src/main/java/com/zc/business/mapper/DcWarningMapper.java @@ -3,6 +3,7 @@ package com.zc.business.mapper; import java.util.HashMap; import java.util.List; import com.zc.business.domain.DcWarning; +import org.apache.ibatis.annotations.Param; /** * 预警信息Mapper接口 @@ -56,11 +57,13 @@ public interface DcWarningMapper /** * 批量删除预警信息 * - * @param ids 需要删除的数据主键集合 + * @param id 需要删除的数据主键集合 * @return 结果 */ - int deleteDcWarningByIds(Integer[] ids); + int deleteDcWarningByIds(String id); int selectCount(); //修改感知事件状态为已完成 int updateState(DcWarning dcWarning); + //感知事件删除 + int deleteDcWarningByStringId(DcWarning dcWarning); } diff --git a/zc-business/src/main/java/com/zc/business/service/IDcWarningService.java b/zc-business/src/main/java/com/zc/business/service/IDcWarningService.java index 15bde850..0a670456 100644 --- a/zc-business/src/main/java/com/zc/business/service/IDcWarningService.java +++ b/zc-business/src/main/java/com/zc/business/service/IDcWarningService.java @@ -50,10 +50,10 @@ public interface IDcWarningService /** * 批量删除预警信息 * - * @param ids 需要删除的预警信息主键集合 + * @param id 需要删除的预警信息主键集合 * @return 结果 */ - int deleteDcWarningByIds(Integer[] ids); + int deleteDcWarningByIds(String id); /** * 删除预警信息信息 @@ -65,4 +65,6 @@ public interface IDcWarningService //感知事件转交通事件 AjaxResult updateWarningConvert(DcWarning dcWarning); + //感知事件删除 + int deleteDcWarningByStringId(DcWarning dcWarning); } diff --git a/zc-business/src/main/java/com/zc/business/service/impl/DcWarningServiceImpl.java b/zc-business/src/main/java/com/zc/business/service/impl/DcWarningServiceImpl.java index 54bd6c2f..7dc23f6d 100644 --- a/zc-business/src/main/java/com/zc/business/service/impl/DcWarningServiceImpl.java +++ b/zc-business/src/main/java/com/zc/business/service/impl/DcWarningServiceImpl.java @@ -96,13 +96,13 @@ public class DcWarningServiceImpl implements IDcWarningService /** * 批量删除预警信息 * - * @param ids 需要删除的预警信息主键 + * @param id 需要删除的预警信息主键 * @return 结果 */ @Override - public int deleteDcWarningByIds(Integer[] ids) + public int deleteDcWarningByIds(String id) { - return dcWarningMapper.deleteDcWarningByIds(ids); + return dcWarningMapper.deleteDcWarningByIds(id); } /** @@ -161,4 +161,9 @@ public class DcWarningServiceImpl implements IDcWarningService return AjaxResult.success("操作成功"); } + @Override + public int deleteDcWarningByStringId(DcWarning dcWarning) { + return dcWarningMapper.deleteDcWarningByStringId(dcWarning); + } + } diff --git a/zc-business/src/main/resources/mapper/business/DcEmployeesMapper.xml b/zc-business/src/main/resources/mapper/business/DcEmployeesMapper.xml index 08af9b72..2f719135 100644 --- a/zc-business/src/main/resources/mapper/business/DcEmployeesMapper.xml +++ b/zc-business/src/main/resources/mapper/business/DcEmployeesMapper.xml @@ -30,8 +30,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" and employees.post_id = #{postId} and employees.organization_id = #{organizationId} - and employees.name like concat('%', #{name}, '%') - and employees.contact_number = #{contactNumber} + and CONCAT(employees.name,employees.contact_number) like concat('%', #{name}, '%') diff --git a/zc-business/src/main/resources/mapper/business/DcPerceivedEventsWarningMapper.xml b/zc-business/src/main/resources/mapper/business/DcPerceivedEventsWarningMapper.xml index 660425ea..e88c121a 100644 --- a/zc-business/src/main/resources/mapper/business/DcPerceivedEventsWarningMapper.xml +++ b/zc-business/src/main/resources/mapper/business/DcPerceivedEventsWarningMapper.xml @@ -295,15 +295,26 @@ GROUP BY stakeMarkId + SELECT DISTINCT m.stake_mark AS stakeMarkId,COALESCE(wc.count, 0) AS sectionNumber FROM + dc_stake_mark AS m + LEFT JOIN ( SELECT stake_mark, COUNT(0) AS count FROM dc_warning WHERE + DATE(warning_time)= DATE_FORMAT(#{warningTime},'%Y-%m-%d') + DATE_FORMAT(warning_time,'%Y-%m') =DATE_FORMAT(#{warningTime},'%Y-%m') + YEAR(warning_time) =DATE_FORMAT(#{warningTime},'%Y') + AND direction = #{direction} GROUP BY stake_mark ) AS wc ON m.stake_mark = wc.stake_mark + WHERE m.section_id = #{sectionId} + HAVING sectionNumber != 0; + + + + + + + + + + + \ No newline at end of file diff --git a/zc-business/src/main/resources/mapper/business/DcWarningMapper.xml b/zc-business/src/main/resources/mapper/business/DcWarningMapper.xml index f0c271e8..ad3d5986 100644 --- a/zc-business/src/main/resources/mapper/business/DcWarningMapper.xml +++ b/zc-business/src/main/resources/mapper/business/DcWarningMapper.xml @@ -146,10 +146,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - delete from dc_warning where id in - - #{id} - + delete from dc_warning where id= #{id} + + + delete from dc_warning where id= #{id}