活动信息开发
This commit is contained in:
parent
4abfba7a2e
commit
4d0e7e899d
|
|
@ -0,0 +1,96 @@
|
||||||
|
package com.dkl.large.service.impl;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import com.dkl.common.utils.DateUtils;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import com.dkl.large.mapper.DklWarningRulesMapper;
|
||||||
|
import com.dkl.large.domain.DklWarningRules;
|
||||||
|
import com.dkl.large.service.IDklWarningRulesService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 预警规则Service业务层处理
|
||||||
|
*
|
||||||
|
* @author Dkl
|
||||||
|
* @date 2025-06-16
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class DklWarningRulesServiceImpl implements IDklWarningRulesService
|
||||||
|
{
|
||||||
|
@Autowired
|
||||||
|
private DklWarningRulesMapper dklWarningRulesMapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询预警规则
|
||||||
|
*
|
||||||
|
* @param id 预警规则主键
|
||||||
|
* @return 预警规则
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public DklWarningRules selectDklWarningRulesById(Long id)
|
||||||
|
{
|
||||||
|
return dklWarningRulesMapper.selectDklWarningRulesById(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询预警规则列表
|
||||||
|
*
|
||||||
|
* @param dklWarningRules 预警规则
|
||||||
|
* @return 预警规则
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public List<DklWarningRules> selectDklWarningRulesList(DklWarningRules dklWarningRules)
|
||||||
|
{
|
||||||
|
return dklWarningRulesMapper.selectDklWarningRulesList(dklWarningRules);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增预警规则
|
||||||
|
*
|
||||||
|
* @param dklWarningRules 预警规则
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int insertDklWarningRules(DklWarningRules dklWarningRules)
|
||||||
|
{
|
||||||
|
dklWarningRules.setCreateTime(DateUtils.getNowDate());
|
||||||
|
return dklWarningRulesMapper.insertDklWarningRules(dklWarningRules);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改预警规则
|
||||||
|
*
|
||||||
|
* @param dklWarningRules 预警规则
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int updateDklWarningRules(DklWarningRules dklWarningRules)
|
||||||
|
{
|
||||||
|
dklWarningRules.setUpdateTime(DateUtils.getNowDate());
|
||||||
|
return dklWarningRulesMapper.updateDklWarningRules(dklWarningRules);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除预警规则
|
||||||
|
*
|
||||||
|
* @param ids 需要删除的预警规则主键
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int deleteDklWarningRulesByIds(int[] ids)
|
||||||
|
{
|
||||||
|
return dklWarningRulesMapper.deleteDklWarningRulesByIds(ids);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除预警规则信息
|
||||||
|
*
|
||||||
|
* @param id 预警规则主键
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int deleteDklWarningRulesById(int id)
|
||||||
|
{
|
||||||
|
return dklWarningRulesMapper.deleteDklWarningRulesById(id);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,92 @@
|
||||||
|
<?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.DklWarningRulesMapper">
|
||||||
|
|
||||||
|
<resultMap type="DklWarningRules" id="DklWarningRulesResult">
|
||||||
|
<result property="id" column="id" />
|
||||||
|
<result property="ruleName" column="rule_name" />
|
||||||
|
<result property="controlMeasures" column="control_measures" />
|
||||||
|
<result property="resourceScheduling" column="resource_scheduling" />
|
||||||
|
<result property="ruleLevel" column="rule_level" />
|
||||||
|
<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" />
|
||||||
|
</resultMap>
|
||||||
|
|
||||||
|
<sql id="selectDklWarningRulesVo">
|
||||||
|
select id, rule_name, control_measures, resource_scheduling, rule_level, create_by, create_time, update_by, update_time, del_flag from dkl_warning_rules
|
||||||
|
</sql>
|
||||||
|
|
||||||
|
<select id="selectDklWarningRulesList" parameterType="DklWarningRules" resultMap="DklWarningRulesResult">
|
||||||
|
<include refid="selectDklWarningRulesVo"/>
|
||||||
|
<where>
|
||||||
|
<if test="ruleName != null and ruleName != ''"> and rule_name like concat('%', #{ruleName}, '%')</if>
|
||||||
|
<if test="controlMeasures != null and controlMeasures != ''"> and control_measures = #{controlMeasures}</if>
|
||||||
|
<if test="resourceScheduling != null and resourceScheduling != ''"> and resource_scheduling = #{resourceScheduling}</if>
|
||||||
|
<if test="ruleLevel != null and ruleLevel != ''"> and rule_level = #{ruleLevel}</if>
|
||||||
|
<if test="delFlag != null and delFlag != ''"> and del_flag = #{delFlag}</if>
|
||||||
|
</where>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="selectDklWarningRulesById" parameterType="Long" resultMap="DklWarningRulesResult">
|
||||||
|
<include refid="selectDklWarningRulesVo"/>
|
||||||
|
where id = #{id}
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<insert id="insertDklWarningRules" parameterType="DklWarningRules">
|
||||||
|
insert into dkl_warning_rules
|
||||||
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||||
|
<if test="ruleName != null">rule_name,</if>
|
||||||
|
<if test="controlMeasures != null">control_measures,</if>
|
||||||
|
<if test="resourceScheduling != null">resource_scheduling,</if>
|
||||||
|
<if test="ruleLevel != null">rule_level,</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>
|
||||||
|
</trim>
|
||||||
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||||
|
<if test="ruleName != null">#{ruleName},</if>
|
||||||
|
<if test="controlMeasures != null">#{controlMeasures},</if>
|
||||||
|
<if test="resourceScheduling != null">#{resourceScheduling},</if>
|
||||||
|
<if test="ruleLevel != null">#{ruleLevel},</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>
|
||||||
|
</trim>
|
||||||
|
</insert>
|
||||||
|
|
||||||
|
<update id="updateDklWarningRules" parameterType="DklWarningRules">
|
||||||
|
update dkl_warning_rules
|
||||||
|
<trim prefix="SET" suffixOverrides=",">
|
||||||
|
<if test="ruleName != null">rule_name = #{ruleName},</if>
|
||||||
|
<if test="controlMeasures != null">control_measures = #{controlMeasures},</if>
|
||||||
|
<if test="resourceScheduling != null">resource_scheduling = #{resourceScheduling},</if>
|
||||||
|
<if test="ruleLevel != null">rule_level = #{ruleLevel},</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>
|
||||||
|
</trim>
|
||||||
|
where id = #{id}
|
||||||
|
</update>
|
||||||
|
|
||||||
|
<update id="deleteDklWarningRulesById" parameterType="int">
|
||||||
|
update dkl_warning_rules set del_flag = 2 where id = #{id}
|
||||||
|
</update>
|
||||||
|
|
||||||
|
<update id="deleteDklWarningRulesByIds" parameterType="int">
|
||||||
|
update dkl_warning_rules set del_flag = 2 where id in
|
||||||
|
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||||
|
#{id}
|
||||||
|
</foreach>
|
||||||
|
</update>
|
||||||
|
</mapper>
|
||||||
|
|
@ -0,0 +1,83 @@
|
||||||
|
<?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.DklWeatherMapper">
|
||||||
|
|
||||||
|
<resultMap type="DklWeather" id="DklWeatherResult">
|
||||||
|
<result property="id" column="id" />
|
||||||
|
<result property="weatherDate" column="weather_date" />
|
||||||
|
<result property="weatherTypes" column="weather_types" />
|
||||||
|
<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" />
|
||||||
|
</resultMap>
|
||||||
|
|
||||||
|
<sql id="selectDklWeatherVo">
|
||||||
|
select id, weather_date, weather_types, create_by, create_time, update_by, update_time, del_flag from dkl_weather
|
||||||
|
</sql>
|
||||||
|
|
||||||
|
<select id="selectDklWeatherList" parameterType="DklWeather" resultMap="DklWeatherResult">
|
||||||
|
<include refid="selectDklWeatherVo"/>
|
||||||
|
<where>
|
||||||
|
<if test="weatherDate != null and weatherDate != ''"> and weather_date = #{weatherDate}</if>
|
||||||
|
<if test="weatherTypes != null and weatherTypes != ''"> and weather_types = #{weatherTypes}</if>
|
||||||
|
</where>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="selectDklWeatherById" parameterType="Long" resultMap="DklWeatherResult">
|
||||||
|
<include refid="selectDklWeatherVo"/>
|
||||||
|
where id = #{id}
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<insert id="insertDklWeather" parameterType="DklWeather">
|
||||||
|
insert into dkl_weather
|
||||||
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||||
|
<if test="id != null">id,</if>
|
||||||
|
<if test="weatherDate != null">weather_date,</if>
|
||||||
|
<if test="weatherTypes != null">weather_types,</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>
|
||||||
|
</trim>
|
||||||
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||||
|
<if test="id != null">#{id},</if>
|
||||||
|
<if test="weatherDate != null">#{weatherDate},</if>
|
||||||
|
<if test="weatherTypes != null">#{weatherTypes},</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>
|
||||||
|
</trim>
|
||||||
|
</insert>
|
||||||
|
|
||||||
|
<update id="updateDklWeather" parameterType="DklWeather">
|
||||||
|
update dkl_weather
|
||||||
|
<trim prefix="SET" suffixOverrides=",">
|
||||||
|
<if test="weatherDate != null">weather_date = #{weatherDate},</if>
|
||||||
|
<if test="weatherTypes != null">weather_types = #{weatherTypes},</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>
|
||||||
|
</trim>
|
||||||
|
where id = #{id}
|
||||||
|
</update>
|
||||||
|
|
||||||
|
<delete id="deleteDklWeatherById" parameterType="Long">
|
||||||
|
delete from dkl_weather where id = #{id}
|
||||||
|
</delete>
|
||||||
|
|
||||||
|
<delete id="deleteDklWeatherByIds" parameterType="String">
|
||||||
|
delete from dkl_weather where id in
|
||||||
|
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||||
|
#{id}
|
||||||
|
</foreach>
|
||||||
|
</delete>
|
||||||
|
</mapper>
|
||||||
Loading…
Reference in New Issue