测试用例

This commit is contained in:
lvys 2025-05-23 11:14:50 +08:00
parent b0bae5715e
commit 65a58e5e53
6 changed files with 668 additions and 0 deletions

View File

@ -0,0 +1,194 @@
package com.dkl.large.controller;
import com.dkl.large.domain.DklWarningInformationHandle;
import com.dkl.large.service.IDklWarningInformationHandleService;
import com.fasterxml.jackson.databind.ObjectMapper;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.mockito.Mockito;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.autoconfigure.web.servlet.WebMvcTest;
import org.springframework.boot.test.mock.mockito.MockBean;
import org.springframework.http.MediaType;
import org.springframework.security.test.context.support.WithMockUser;
import org.springframework.test.web.servlet.MockMvc;
import org.springframework.test.web.servlet.request.MockMvcRequestBuilders;
import org.springframework.test.web.servlet.result.MockMvcResultMatchers;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
/**
* 预警信息处置控制器测试类
*
* @author Dkl
* @date 2025-06-16
*/
@WebMvcTest(DklWarningInformationHandleController.class)
public class DklWarningInformationHandleControllerTest {
@Autowired
private MockMvc mockMvc;
@MockBean
private IDklWarningInformationHandleService warningInformationHandleService;
@Autowired
private ObjectMapper objectMapper;
private DklWarningInformationHandle testHandle;
/**
* 初始化测试数据
*/
@BeforeEach
void setUp() {
testHandle = new DklWarningInformationHandle();
testHandle.setId(1L);
testHandle.setDelFlag("0");
testHandle.setCreateTime(new Date());
testHandle.setCreateBy("testUser");
testHandle.setUpdateTime(new Date());
testHandle.setUpdateBy("testUser");
}
/**
* 测试查询预警信息处置列表接口
*/
@Test
@WithMockUser(authorities = "large:handle:list")
void testList() throws Exception {
// 构造测试数据
List<DklWarningInformationHandle> handleList = new ArrayList<>();
handleList.add(testHandle);
// mock 服务层方法
Mockito.when(warningInformationHandleService.selectDklWarningInformationHandleList(Mockito.any(DklWarningInformationHandle.class)))
.thenReturn(handleList);
// 执行请求并断言结果
mockMvc.perform(MockMvcRequestBuilders.get("/large/handle/list")
.contentType(MediaType.APPLICATION_JSON))
.andExpect(MockMvcResultMatchers.status().isOk())
.andExpect(MockMvcResultMatchers.jsonPath("$.rows").isArray())
.andExpect(MockMvcResultMatchers.jsonPath("$.rows[0].id").value(1L));
}
/**
* 测试查询所有预警信息处置列表接口
*/
@Test
void testListAll() throws Exception {
// 构造测试数据
List<DklWarningInformationHandle> handleList = new ArrayList<>();
handleList.add(testHandle);
// mock 服务层方法
Mockito.when(warningInformationHandleService.selectDklWarningInformationHandleList(Mockito.any(DklWarningInformationHandle.class)))
.thenReturn(handleList);
// 执行请求并断言结果
mockMvc.perform(MockMvcRequestBuilders.get("/large/handle/listAll")
.contentType(MediaType.APPLICATION_JSON))
.andExpect(MockMvcResultMatchers.status().isOk())
.andExpect(MockMvcResultMatchers.jsonPath("$.rows").isArray())
.andExpect(MockMvcResultMatchers.jsonPath("$.rows[0].delFlag").value("0"));
}
/**
* 测试导出预警信息处置列表接口
*/
@Test
@WithMockUser
void testExport() throws Exception {
// 构造测试数据
List<DklWarningInformationHandle> handleList = new ArrayList<>();
handleList.add(testHandle);
// mock 服务层方法
Mockito.when(warningInformationHandleService.selectDklWarningInformationHandleList(Mockito.any(DklWarningInformationHandle.class)))
.thenReturn(handleList);
// 执行请求并断言结果
mockMvc.perform(MockMvcRequestBuilders.post("/large/handle/export")
.contentType(MediaType.APPLICATION_JSON)
.param("id", "1"))
.andExpect(MockMvcResultMatchers.status().isOk())
.andExpect(MockMvcResultMatchers.header().exists("Content-Disposition"));
}
/**
* 测试获取预警信息处置详细信息接口
*/
@Test
@WithMockUser
void testGetInfo() throws Exception {
// mock 服务层方法
Mockito.when(warningInformationHandleService.selectDklWarningInformationHandleById(1L))
.thenReturn(testHandle);
// 执行请求并断言结果
mockMvc.perform(MockMvcRequestBuilders.get("/large/handle/1")
.contentType(MediaType.APPLICATION_JSON))
.andExpect(MockMvcResultMatchers.status().isOk())
.andExpect(MockMvcResultMatchers.jsonPath("$.code").value(200))
.andExpect(MockMvcResultMatchers.jsonPath("$.data.id").value(1L));
}
/**
* 测试新增预警信息处置接口
*/
@Test
@WithMockUser
void testAdd() throws Exception {
// mock 服务层方法
Mockito.when(warningInformationHandleService.insertDklWarningInformationHandle(Mockito.any(DklWarningInformationHandle.class)))
.thenReturn(1);
// 执行请求并断言结果
mockMvc.perform(MockMvcRequestBuilders.post("/large/handle")
.contentType(MediaType.APPLICATION_JSON)
.content(objectMapper.writeValueAsString(testHandle)))
.andExpect(MockMvcResultMatchers.status().isOk())
.andExpect(MockMvcResultMatchers.jsonPath("$.code").value(200))
.andExpect(MockMvcResultMatchers.jsonPath("$.data").value(1));
}
/**
* 测试修改预警信息处置接口
*/
@Test
@WithMockUser
void testEdit() throws Exception {
// mock 服务层方法
Mockito.when(warningInformationHandleService.updateDklWarningInformationHandle(Mockito.any(DklWarningInformationHandle.class)))
.thenReturn(1);
// 执行请求并断言结果
mockMvc.perform(MockMvcRequestBuilders.put("/large/handle")
.contentType(MediaType.APPLICATION_JSON)
.content(objectMapper.writeValueAsString(testHandle)))
.andExpect(MockMvcResultMatchers.status().isOk())
.andExpect(MockMvcResultMatchers.jsonPath("$.code").value(200))
.andExpect(MockMvcResultMatchers.jsonPath("$.data").value(1));
}
/**
* 测试删除预警信息处置接口
*/
@Test
@WithMockUser
void testRemove() throws Exception {
// mock 服务层方法
Mockito.when(warningInformationHandleService.deleteDklWarningInformationHandleByIds(Mockito.any(Long[].class)))
.thenReturn(1);
// 执行请求并断言结果
mockMvc.perform(MockMvcRequestBuilders.delete("/large/handle/1")
.contentType(MediaType.APPLICATION_JSON))
.andExpect(MockMvcResultMatchers.status().isOk())
.andExpect(MockMvcResultMatchers.jsonPath("$.code").value(200))
.andExpect(MockMvcResultMatchers.jsonPath("$.data").value(1));
}
}

View File

@ -0,0 +1,76 @@
package com.dkl.large.domain;
import java.util.Date;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.dkl.common.annotation.Excel;
import com.dkl.common.core.domain.BaseEntity;
/**
* 预警信息处置对象 dkl_warning_information_handle
*
* @author Dkl
* @date 2025-06-16
*/
@Data
public class DklWarningInformationHandle extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** id */
@TableId(type = IdType.AUTO)
private Long id;
/** 预警唯一标识符 */
@Excel(name = "预警唯一标识符")
private String warningSigns;
/** 委派人 */
@Excel(name = "委派人")
private Long delegatePersonnel;
/** 委派时间 */
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "委派时间", width = 30, dateFormat = "yyyy-MM-dd")
private Date delegationTime;
/** 委派部门 */
@Excel(name = "委派部门")
private Long delegationDept;
/** 处置措施 */
@Excel(name = "处置措施")
private String disposalMeasures;
/** 处置结果 */
@Excel(name = "处置结果")
private String disposalResults;
/** 处理状态 */
@Excel(name = "处理状态")
private String disposalStatus;
/** 删除标志0代表存在 2代表删除 */
private String delFlag;
/** 规则名称 */
@TableField(exist = false)
private int rulesId;
/** 预警id */
private int warningId;
/** 用户名称 */
@TableField(exist = false)
private String nickName;
/** 部门名称 */
@TableField(exist = false)
private String deptName;
}

View File

@ -0,0 +1,61 @@
package com.dkl.large.mapper;
import java.util.List;
import com.dkl.large.domain.DklWarningInformationHandle;
/**
* 预警信息处置Mapper接口
*
* @author Dkl
* @date 2025-06-16
*/
public interface DklWarningInformationHandleMapper
{
/**
* 查询预警信息处置
*
* @param id 预警信息处置主键
* @return 预警信息处置
*/
public DklWarningInformationHandle selectDklWarningInformationHandleById(Long id);
/**
* 查询预警信息处置列表
*
* @param dklWarningInformationHandle 预警信息处置
* @return 预警信息处置集合
*/
public List<DklWarningInformationHandle> selectDklWarningInformationHandleList(DklWarningInformationHandle dklWarningInformationHandle);
/**
* 新增预警信息处置
*
* @param dklWarningInformationHandle 预警信息处置
* @return 结果
*/
public int insertDklWarningInformationHandle(DklWarningInformationHandle dklWarningInformationHandle);
/**
* 修改预警信息处置
*
* @param dklWarningInformationHandle 预警信息处置
* @return 结果
*/
public int updateDklWarningInformationHandle(DklWarningInformationHandle dklWarningInformationHandle);
/**
* 删除预警信息处置
*
* @param id 预警信息处置主键
* @return 结果
*/
public int deleteDklWarningInformationHandleById(Long id);
/**
* 批量删除预警信息处置
*
* @param ids 需要删除的数据主键集合
* @return 结果
*/
public int deleteDklWarningInformationHandleByIds(Long[] ids);
}

View File

@ -0,0 +1,61 @@
package com.dkl.large.service;
import java.util.List;
import com.dkl.large.domain.DklWarningInformationHandle;
/**
* 预警信息处置Service接口
*
* @author Dkl
* @date 2025-06-16
*/
public interface IDklWarningInformationHandleService
{
/**
* 查询预警信息处置
*
* @param id 预警信息处置主键
* @return 预警信息处置
*/
public DklWarningInformationHandle selectDklWarningInformationHandleById(Long id);
/**
* 查询预警信息处置列表
*
* @param dklWarningInformationHandle 预警信息处置
* @return 预警信息处置集合
*/
public List<DklWarningInformationHandle> selectDklWarningInformationHandleList(DklWarningInformationHandle dklWarningInformationHandle);
/**
* 新增预警信息处置
*
* @param dklWarningInformationHandle 预警信息处置
* @return 结果
*/
public int insertDklWarningInformationHandle(DklWarningInformationHandle dklWarningInformationHandle);
/**
* 修改预警信息处置
*
* @param dklWarningInformationHandle 预警信息处置
* @return 结果
*/
public int updateDklWarningInformationHandle(DklWarningInformationHandle dklWarningInformationHandle);
/**
* 批量删除预警信息处置
*
* @param ids 需要删除的预警信息处置主键集合
* @return 结果
*/
public int deleteDklWarningInformationHandleByIds(Long[] ids);
/**
* 删除预警信息处置信息
*
* @param id 预警信息处置主键
* @return 结果
*/
public int deleteDklWarningInformationHandleById(Long id);
}

View File

@ -0,0 +1,156 @@
package com.dkl.large.service.impl;
import java.util.Date;
import java.util.List;
import com.dkl.common.utils.DateUtils;
import com.dkl.common.utils.bean.BeanUtils;
import com.dkl.large.domain.DklWarningInformation;
import com.dkl.large.domain.DklWarningInformationProcess;
import com.dkl.large.mapper.DklWarningInformationMapper;
import com.dkl.large.mapper.DklWarningInformationProcessMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.dkl.large.mapper.DklWarningInformationHandleMapper;
import com.dkl.large.domain.DklWarningInformationHandle;
import com.dkl.large.service.IDklWarningInformationHandleService;
import org.springframework.transaction.annotation.Transactional;
/**
* 预警信息处置Service业务层处理
*
* @author Dkl
* @date 2025-06-16
*/
@Service
public class DklWarningInformationHandleServiceImpl implements IDklWarningInformationHandleService
{
@Autowired
private DklWarningInformationHandleMapper dklWarningInformationHandleMapper;
@Autowired
private DklWarningInformationMapper dklWarningInformationMapper;
@Autowired
private DklWarningInformationProcessMapper dklWarningInformationProcessMapper;
/**
* 查询预警信息处置
*
* @param id 预警信息处置主键
* @return 预警信息处置
*/
@Override
public DklWarningInformationHandle selectDklWarningInformationHandleById(Long id)
{
return dklWarningInformationHandleMapper.selectDklWarningInformationHandleById(id);
}
/**
* 查询预警信息处置列表
*
* @param dklWarningInformationHandle 预警信息处置
* @return 预警信息处置
*/
@Override
public List<DklWarningInformationHandle> selectDklWarningInformationHandleList(DklWarningInformationHandle dklWarningInformationHandle)
{
return dklWarningInformationHandleMapper.selectDklWarningInformationHandleList(dklWarningInformationHandle);
}
/**
* 新增预警信息处置
*
* @param dklWarningInformationHandle 预警信息处置
* @return 结果
*/
@Override
@Transactional
public int insertDklWarningInformationHandle(DklWarningInformationHandle dklWarningInformationHandle)
{
//下发 即在处置表中添加数据
//修改主表的处置规则
DklWarningInformation dklWarningInformation = dklWarningInformationMapper.selectDklWarningInformationById((long) dklWarningInformationHandle.getWarningId());
dklWarningInformation.setRulesId(dklWarningInformationHandle.getRulesId());
dklWarningInformation.setEventStatus("1");
dklWarningInformationMapper.updateDklWarningInformation(dklWarningInformation);
//添加流程数据
DklWarningInformationProcess dklWarningInformationProcess = new DklWarningInformationProcess();
BeanUtils.copyProperties( dklWarningInformationHandle,dklWarningInformationProcess);
dklWarningInformationHandle.setDisposalStatus("0");
dklWarningInformationHandle.setDelFlag("0");
dklWarningInformationHandle.setCreateTime(new Date());
dklWarningInformationHandle.setCreateBy(dklWarningInformationHandle.getCreateBy());
dklWarningInformationHandle.setUpdateTime(new Date());
dklWarningInformationHandle.setUpdateBy(dklWarningInformationHandle.getCreateBy());
dklWarningInformationHandleMapper.insertDklWarningInformationHandle(dklWarningInformationHandle);
dklWarningInformationProcess.setHandleId(dklWarningInformationHandle.getId());
dklWarningInformationProcess.setDisposalStatus("0");
return dklWarningInformationProcessMapper.insertDklWarningInformationProcess(dklWarningInformationProcess);
}
/**
* 修改预警信息处置
*
* @param dklWarningInformationHandle 预警信息处置
* @return 结果
*/
@Override
@Transactional
public int updateDklWarningInformationHandle(DklWarningInformationHandle dklWarningInformationHandle)
{
DklWarningInformationProcess dklWarningInformationProcess = new DklWarningInformationProcess();
BeanUtils.copyProperties( dklWarningInformationHandle,dklWarningInformationProcess);
dklWarningInformationHandle.setDelFlag("0");
dklWarningInformationHandle.setCreateTime(new Date());
dklWarningInformationHandle.setCreateBy(dklWarningInformationHandle.getCreateBy());
dklWarningInformationHandle.setUpdateTime(new Date());
dklWarningInformationHandle.setUpdateBy(dklWarningInformationHandle.getCreateBy());
//预警信息处置流程是1 即受理
if (("1").equals(dklWarningInformationHandle.getDisposalStatus())){
dklWarningInformationProcess.setHandleId(dklWarningInformationHandle.getId());
dklWarningInformationProcess.setDisposalStatus(dklWarningInformationHandle.getDisposalStatus());
dklWarningInformationProcessMapper.insertDklWarningInformationProcess(dklWarningInformationProcess);
//修改主表的处置规则 处理中
DklWarningInformation dklWarningInformation = dklWarningInformationMapper.selectDklWarningInformationById((long) dklWarningInformationHandle.getId());
// dklWarningInformation.setRulesId(dklWarningInformationHandle.getRulesId());
dklWarningInformation.setWarningStatus("2");
dklWarningInformationMapper.updateDklWarningInformation(dklWarningInformation);
}else if(("2").equals(dklWarningInformationHandle.getDisposalStatus())){
dklWarningInformationProcess.setHandleId(dklWarningInformationHandle.getId());
dklWarningInformationProcess.setDisposalStatus(dklWarningInformationHandle.getDisposalStatus());
dklWarningInformationProcess.setDisposalMeasures(dklWarningInformationHandle.getDisposalMeasures());
// dklWarningInformationProcess.setDisposalResults(dklWarningInformationHandle.getDisposalResults());
dklWarningInformationProcessMapper.insertDklWarningInformationProcess(dklWarningInformationProcess);
//修改主表的处置规则 已完成
DklWarningInformation dklWarningInformation = dklWarningInformationMapper.selectDklWarningInformationById((long) dklWarningInformationHandle.getId());
dklWarningInformation.setRulesId(dklWarningInformationHandle.getRulesId());
dklWarningInformation.setWarningStatus("3");
dklWarningInformationMapper.updateDklWarningInformation(dklWarningInformation);
}
return 1;
}
/**
* 批量删除预警信息处置
*
* @param ids 需要删除的预警信息处置主键
* @return 结果
*/
@Override
public int deleteDklWarningInformationHandleByIds(Long[] ids)
{
return dklWarningInformationHandleMapper.deleteDklWarningInformationHandleByIds(ids);
}
/**
* 删除预警信息处置信息
*
* @param id 预警信息处置主键
* @return 结果
*/
@Override
public int deleteDklWarningInformationHandleById(Long id)
{
return dklWarningInformationHandleMapper.deleteDklWarningInformationHandleById(id);
}
}

View File

@ -0,0 +1,120 @@
<?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.dkl.large.mapper.DklWarningInformationHandleMapper">
<resultMap type="DklWarningInformationHandle" id="DklWarningInformationHandleResult">
<result property="id" column="id" />
<result property="warningSigns" column="warning_signs" />
<result property="delegatePersonnel" column="delegate_personnel" />
<result property="delegationTime" column="delegation_time" />
<result property="delegationDept" column="delegation_dept" />
<result property="disposalMeasures" column="disposal_measures" />
<result property="disposalResults" column="disposal_results" />
<result property="disposalStatus" column="disposal_status" />
<result property="createBy" column="create_by" />
<result property="createTime" column="create_time" />
<result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" />
<result property="delFlag" column="del_flag" />
<result property="warningId" column="warning_id" />
</resultMap>
<sql id="selectDklWarningInformationHandleVo">
select dwih.id, dwih.warning_signs, dwih.delegate_personnel, dwih.delegation_time, dwih.delegation_dept,
dwih.disposal_measures, dwih.disposal_results, dwih.disposal_status, dwih.create_by, dwih.create_time,dwih.warning_id,
dwih.update_by, dwih.update_time, dwih.del_flag,d.dept_name AS deptName,u.nick_name AS nickName from dkl_warning_information_handle AS dwih
left join sys_dept d on dwih.delegation_dept = d.dept_id
left join sys_user u on dwih.delegate_personnel = u.user_id
</sql>
<select id="selectDklWarningInformationHandleList" parameterType="DklWarningInformationHandle" resultMap="DklWarningInformationHandleResult">
<include refid="selectDklWarningInformationHandleVo"/>
<where>
<if test="warningSigns != null and warningSigns != ''"> and dwih.warning_signs = #{warningSigns}</if>
<if test="delegatePersonnel != null "> and dwih.delegate_personnel = #{delegatePersonnel}</if>
<if test="delegationTime != null "> and dwih.delegation_time = #{delegationTime}</if>
<if test="delegationDept != null "> and dwih.delegation_dept = #{delegationDept}</if>
<if test="disposalMeasures != null and disposalMeasures != ''"> and dwih.disposal_measures = #{disposalMeasures}</if>
<if test="disposalResults != null and disposalResults != ''"> and dwih.disposal_results = #{disposalResults}</if>
<if test="disposalStatus != null and disposalStatus != ''"> and dwih.disposal_status = #{disposalStatus}</if>
<if test="delFlag != null and delFlag != ''"> and dwih.del_flag = #{delFlag}</if>
</where>
${params.dataScope}
order by dwih.create_time desc
</select>
<select id="selectDklWarningInformationHandleById" parameterType="Long" resultMap="DklWarningInformationHandleResult">
<include refid="selectDklWarningInformationHandleVo"/>
where id = #{id}
</select>
<insert id="insertDklWarningInformationHandle" parameterType="DklWarningInformationHandle">
insert into dkl_warning_information_handle
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="warningSigns != null">warning_signs,</if>
<if test="delegatePersonnel != null">delegate_personnel,</if>
<if test="delegationTime != null">delegation_time,</if>
<if test="delegationDept != null">delegation_dept,</if>
<if test="disposalMeasures != null">disposal_measures,</if>
<if test="disposalResults != null">disposal_results,</if>
<if test="disposalStatus != null">disposal_status,</if>
<if test="createBy != null">create_by,</if>
<if test="createTime != null">create_time,</if>
<if test="updateBy != null">update_by,</if>
<if test="updateTime != null">update_time,</if>
<if test="delFlag != null">del_flag,</if>
<if test="warningId != null">warning_id,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="warningSigns != null">#{warningSigns},</if>
<if test="delegatePersonnel != null">#{delegatePersonnel},</if>
<if test="delegationTime != null">#{delegationTime},</if>
<if test="delegationDept != null">#{delegationDept},</if>
<if test="disposalMeasures != null">#{disposalMeasures},</if>
<if test="disposalResults != null">#{disposalResults},</if>
<if test="disposalStatus != null">#{disposalStatus},</if>
<if test="createBy != null">#{createBy},</if>
<if test="createTime != null">#{createTime},</if>
<if test="updateBy != null">#{updateBy},</if>
<if test="updateTime != null">#{updateTime},</if>
<if test="delFlag != null">#{delFlag},</if>
<if test="warningId != null">#{warningId},</if>
</trim>
<selectKey keyProperty="id" resultType="long" order="AFTER" >
SELECT CURRVAL('dkl_warning_information_handle_id_seq') <!-- 人大金仓序列函数 -->
</selectKey>
</insert>
<update id="updateDklWarningInformationHandle" parameterType="DklWarningInformationHandle">
update dkl_warning_information_handle
<trim prefix="SET" suffixOverrides=",">
<if test="warningSigns != null">warning_signs = #{warningSigns},</if>
<if test="delegatePersonnel != null">delegate_personnel = #{delegatePersonnel},</if>
<if test="delegationTime != null">delegation_time = #{delegationTime},</if>
<if test="delegationDept != null">delegation_dept = #{delegationDept},</if>
<if test="disposalMeasures != null">disposal_measures = #{disposalMeasures},</if>
<if test="disposalResults != null">disposal_results = #{disposalResults},</if>
<if test="disposalStatus != null">disposal_status = #{disposalStatus},</if>
<if test="createBy != null">create_by = #{createBy},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
<if test="delFlag != null">del_flag = #{delFlag},</if>
<if test="warningId != null">warning_id = #{warningId},</if>
</trim>
where id = #{id}
</update>
<update id="deleteDklWarningInformationHandleById" parameterType="Long">
update dkl_warning_information_handle set del_flag = 2 where id = #{id}
</update>
<update id="deleteDklWarningInformationHandleByIds" parameterType="String">
update dkl_warning_information_handle set del_flag = 2 where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</update>
</mapper>