117 lines
4.4 KiB
XML
117 lines
4.4 KiB
XML
|
|
<?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.sercurityControl.proteam.supplement.mapper.BadWeatherMapper">
|
||
|
|
<insert id="addBadWeather">
|
||
|
|
INSERT INTO t_bad_weather
|
||
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||
|
|
<if test="date != null and date != ''">date,</if>
|
||
|
|
<if test="weather != null">weather,</if>
|
||
|
|
<if test="minTemperature != null">min_temperature,</if>
|
||
|
|
<if test="maxTemperature != null">max_temperature,</if>
|
||
|
|
<if test="warning != null">warning,</if>
|
||
|
|
<if test="uploadId != null">upload_id,</if>
|
||
|
|
upload_time
|
||
|
|
</trim>
|
||
|
|
<trim prefix="VALUES (" suffix=")" suffixOverrides=",">
|
||
|
|
<if test="date != null and date != ''">#{date},</if>
|
||
|
|
<if test="weather != null">#{weather},</if>
|
||
|
|
<if test="minTemperature != null">#{minTemperature},</if>
|
||
|
|
<if test="maxTemperature != null">#{maxTemperature},</if>
|
||
|
|
<if test="warning != null">#{warning},</if>
|
||
|
|
<if test="uploadId != null">#{uploadId},</if>
|
||
|
|
NOW()
|
||
|
|
</trim>
|
||
|
|
</insert>
|
||
|
|
|
||
|
|
<insert id="addRemoteFace">
|
||
|
|
INSERT INTO t_rectification_punishment
|
||
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||
|
|
<if test="name != null and name != ''">name,</if>
|
||
|
|
<if test="type != null">type,</if>
|
||
|
|
<if test="regulationsPath != null and regulationsPath != ''">regulationsPath,</if>
|
||
|
|
<if test="punishmentPath != null and punishmentPath != ''">punishmentPath,</if>
|
||
|
|
<if test="uploadId != null">upload_id,</if>
|
||
|
|
<if test="uploadTime != null">upload_time</if>
|
||
|
|
</trim>
|
||
|
|
<trim prefix="VALUES (" suffix=")" suffixOverrides=",">
|
||
|
|
<if test="name != null and name != ''">#{name},</if>
|
||
|
|
<if test="type != null">#{type},</if>
|
||
|
|
<if test="regulationsPath != null and regulationsPath != ''">#{regulationsPath},</if>
|
||
|
|
<if test="punishmentPath != null and punishmentPath != ''">#{punishmentPath},</if>
|
||
|
|
<if test="uploadId != null">#{uploadId},</if>
|
||
|
|
<if test="uploadTime != null">#{uploadTime}</if>
|
||
|
|
</trim>
|
||
|
|
</insert>
|
||
|
|
<insert id="importExcel">
|
||
|
|
INSERT INTO t_bad_weather(
|
||
|
|
date,
|
||
|
|
weather,
|
||
|
|
min_temperature,
|
||
|
|
max_temperature,
|
||
|
|
warning,
|
||
|
|
status,
|
||
|
|
upload_time,
|
||
|
|
update_time,
|
||
|
|
is_active,
|
||
|
|
area_name,
|
||
|
|
work_content
|
||
|
|
)values
|
||
|
|
<foreach collection="list" item="item" separator=",">
|
||
|
|
( #{item.date},#{item.weather},#{item.minTemperature},#{item.maxTemperature} ,#{item.warning} ,0,now(),now(),1,#{item.areaName},#{item.workContent} )
|
||
|
|
</foreach>
|
||
|
|
|
||
|
|
</insert>
|
||
|
|
|
||
|
|
<update id="delRemoteFaceById">
|
||
|
|
update t_rectification_punishment
|
||
|
|
set is_active = 0
|
||
|
|
where id = #{id}
|
||
|
|
</update>
|
||
|
|
<update id="updateStatus">
|
||
|
|
update t_bad_weather
|
||
|
|
set status = 1
|
||
|
|
where id = #{id}
|
||
|
|
</update>
|
||
|
|
<delete id="delBadWeatherData">
|
||
|
|
delete from t_bad_weather
|
||
|
|
</delete>
|
||
|
|
<delete id="deleteData">
|
||
|
|
delete from t_bad_weather where id=#{id}
|
||
|
|
|
||
|
|
</delete>
|
||
|
|
|
||
|
|
<select id="getRectificationPunishmentList" resultType="com.sercurityControl.proteam.supplement.domain.vo.BadWeatherEntity">
|
||
|
|
SELECT
|
||
|
|
id,
|
||
|
|
date,
|
||
|
|
weather,
|
||
|
|
min_temperature AS minTemperature,
|
||
|
|
max_temperature AS maxTemperature,
|
||
|
|
warning, area_name areaName, work_content workContent,
|
||
|
|
`status`
|
||
|
|
FROM
|
||
|
|
t_bad_weather
|
||
|
|
WHERE
|
||
|
|
is_active = 1
|
||
|
|
AND date >= CURDATE()
|
||
|
|
AND date < DATE_ADD(CURDATE(), INTERVAL 7 DAY)
|
||
|
|
<if test="keyWord!=null and keyWord!=''">
|
||
|
|
and ( area_name like concat('%',#{keyWord},'%') or
|
||
|
|
warning like concat('%',#{keyWord},'%') or
|
||
|
|
work_content like concat('%',#{keyWord},'%')
|
||
|
|
)
|
||
|
|
|
||
|
|
</if>
|
||
|
|
</select>
|
||
|
|
<select id="getBadWeatherData" resultType="com.sercurityControl.proteam.supplement.domain.vo.BadWeatherEntity">
|
||
|
|
SELECT id, date, weather, min_temperature as minTemperature, max_temperature as maxTemperature, warning
|
||
|
|
FROM
|
||
|
|
t_bad_weather
|
||
|
|
WHERE
|
||
|
|
is_active=1
|
||
|
|
and `status`=1
|
||
|
|
AND DATE (date) = CURDATE()
|
||
|
|
ORDER BY update_time desc
|
||
|
|
LIMIT 1
|
||
|
|
</select>
|
||
|
|
</mapper>
|