bns_jjsp_service/securityControl-modules/securityControl-proteam/target/classes/mapper/dutyTask/BadWeatherMapper.xml

87 lines
3.5 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.dutyTask.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>
<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>
<select id="getRectificationPunishmentList" resultType="com.sercurityControl.proteam.dutyTask.domain.BadWeatherEntity">
SELECT
id,
date,
weather,
min_temperature AS minTemperature,
max_temperature AS maxTemperature,
warning,
`status`
FROM
t_bad_weather
WHERE
is_active = 1
AND date >= CURDATE()
AND date &lt; DATE_ADD(CURDATE(), INTERVAL 7 DAY)
</select>
<select id="getBadWeatherData" resultType="com.sercurityControl.proteam.dutyTask.domain.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>