Browse Source

感知事件删除接口,桩号时间查询感知事件数量优化,应急人员搜索优化

develop
wangsixiang 9 months ago
parent
commit
169c2cf672
  1. 5
      zc-business/src/main/java/com/zc/business/controller/DcEmployeesController.java
  2. 30
      zc-business/src/main/java/com/zc/business/controller/DcWarningController.java
  3. 7
      zc-business/src/main/java/com/zc/business/mapper/DcWarningMapper.java
  4. 6
      zc-business/src/main/java/com/zc/business/service/IDcWarningService.java
  5. 11
      zc-business/src/main/java/com/zc/business/service/impl/DcWarningServiceImpl.java
  6. 3
      zc-business/src/main/resources/mapper/business/DcEmployeesMapper.xml
  7. 27
      zc-business/src/main/resources/mapper/business/DcPerceivedEventsWarningMapper.xml
  8. 8
      zc-business/src/main/resources/mapper/business/DcWarningMapper.xml

5
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<DcEmployees> list = dcEmployeesService.selectDcEmployeesList(dcEmployees);
return getDataTable(list);
}

30
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));
}
}

7
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);
}

6
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);
}

11
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);
}
}

3
zc-business/src/main/resources/mapper/business/DcEmployeesMapper.xml

@ -30,8 +30,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<where>
<if test="postId != null and postId != ''"> and employees.post_id = #{postId}</if>
<if test="organizationId != null "> and employees.organization_id = #{organizationId}</if>
<if test="name != null and name != ''"> and employees.name like concat('%', #{name}, '%')</if>
<if test="contactNumber != null and contactNumber != ''"> and employees.contact_number = #{contactNumber}</if>
<if test="name != null and name != ''"> and CONCAT(employees.name,employees.contact_number) like concat('%', #{name}, '%')</if>
</where>
</select>

27
zc-business/src/main/resources/mapper/business/DcPerceivedEventsWarningMapper.xml

@ -295,15 +295,26 @@
GROUP BY stakeMarkId
</select>
<select id="selectWarningMarkDayOptimize" resultType="java.util.HashMap">
SELECT DISTINCT m.stake_mark stakeMarkId,
(SELECT count( 0 ) FROM dc_warning w WHERE w.stake_mark = m.stake_mark
<if test = 'type == "day"' >and DATE(w.warning_time)= DATE_FORMAT(#{warningTime},'%Y-%m-%d')</if>
<if test = 'type == "month"' >and DATE_FORMAT(w.warning_time,'%Y-%m') =DATE_FORMAT(#{warningTime},'%Y-%m')</if>
<if test = 'type == "year"' >and YEAR(w.warning_time) =DATE_FORMAT(#{warningTime},'%Y')</if>
AND w.direction = #{direction}) sectionNumber FROM dc_stake_mark AS m
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
<if test = 'type == "day"' > DATE(warning_time)= DATE_FORMAT(#{warningTime},'%Y-%m-%d')</if>
<if test = 'type == "month"' > DATE_FORMAT(warning_time,'%Y-%m') =DATE_FORMAT(#{warningTime},'%Y-%m')</if>
<if test = 'type == "year"' > YEAR(warning_time) =DATE_FORMAT(#{warningTime},'%Y')</if>
AND direction = #{direction} GROUP BY stake_mark ) AS wc ON m.stake_mark = wc.stake_mark
WHERE m.section_id = #{sectionId}
HAVING sectionNumber!=0
</select>
HAVING sectionNumber != 0;
</select>
<!-- <select id="selectWarningMarkDayOptimize" resultType="java.util.HashMap">-->
<!-- SELECT DISTINCT m.stake_mark stakeMarkId,-->
<!-- (SELECT count( 0 ) FROM dc_warning w WHERE w.stake_mark = m.stake_mark-->
<!-- <if test = 'type == "day"' >and DATE(w.warning_time)= DATE_FORMAT(#{warningTime},'%Y-%m-%d')</if>-->
<!-- <if test = 'type == "month"' >and DATE_FORMAT(w.warning_time,'%Y-%m') =DATE_FORMAT(#{warningTime},'%Y-%m')</if>-->
<!-- <if test = 'type == "year"' >and YEAR(w.warning_time) =DATE_FORMAT(#{warningTime},'%Y')</if>-->
<!-- AND w.direction = #{direction}) sectionNumber FROM dc_stake_mark AS m-->
<!-- WHERE m.section_id = #{sectionId}-->
<!-- HAVING sectionNumber!=0-->
<!-- </select>-->
</mapper>

8
zc-business/src/main/resources/mapper/business/DcWarningMapper.xml

@ -146,10 +146,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</delete>
<delete id="deleteDcWarningByIds" parameterType="String">
delete from dc_warning where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
delete from dc_warning where id= #{id}
</delete>
<delete id="deleteDcWarningByStringId">
delete from dc_warning where id= #{id}
</delete>
<select id="selectCount" resultType="int">
SELECT COUNT(*)AS count FROM dc_warning

Loading…
Cancel
Save