84 lines
3.7 KiB
XML
84 lines
3.7 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.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>
|