<?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.billion.main.da.mapper.DaParamCollectionMapper">
|
|
<resultMap type="DaParamCollection" id="DaParamCollectionResult">
|
<result property="id" column="id" />
|
<result property="sfcCode" column="sfc_code" />
|
<result property="locationCode" column="location_code" />
|
<result property="paramCode" column="param_code" />
|
<result property="paramName" column="param_name" />
|
<result property="paramValue" column="param_value" />
|
<result property="collectTime" column="collect_time" />
|
</resultMap>
|
|
<sql id="selectDaParamCollectionVo">
|
select id, sfc_code, location_code, param_code, param_name, param_value, collect_time from da_param_collection
|
</sql>
|
|
<select id="selectDaParamCollectionList" parameterType="DaParamCollection" resultMap="DaParamCollectionResult">
|
<include refid="selectDaParamCollectionVo"/>
|
<where>
|
<if test="sfcCode != null and sfcCode != ''"> and sfc_code = #{sfcCode}</if>
|
<if test="locationCode != null and locationCode != ''"> and location_code like concat('%', #{locationCode}, '%')</if>
|
<if test="paramCode != null and paramCode != ''"> and param_code = #{paramCode}</if>
|
<if test="paramName != null and paramName != ''"> and param_name like concat('%', #{paramName}, '%')</if>
|
<if test="startTime != null"> and collect_time BETWEEN #{startTime} and #{stopTime}</if>
|
|
</where>
|
</select>
|
|
<select id="selectDaParamCollectionById" parameterType="Long" resultMap="DaParamCollectionResult">
|
<include refid="selectDaParamCollectionVo"/>
|
where id = #{id}
|
</select>
|
|
<insert id="insertDaParamCollection" parameterType="DaParamCollection" useGeneratedKeys="true" keyProperty="id">
|
insert into da_param_collection
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
<if test="sfcCode != null and sfcCode != ''">sfc_code,</if>
|
<if test="locationCode != null and locationCode != ''">location_code,</if>
|
<if test="paramCode != null and paramCode != ''">param_code,</if>
|
<if test="paramName != null">param_name,</if>
|
<if test="paramValue != null and paramValue != ''">param_value,</if>
|
<if test="collectTime != null">collect_time,</if>
|
</trim>
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
<if test="sfcCode != null and sfcCode != ''">#{sfcCode},</if>
|
<if test="locationCode != null and locationCode != ''">#{locationCode},</if>
|
<if test="paramCode != null and paramCode != ''">#{paramCode},</if>
|
<if test="paramName != null">#{paramName},</if>
|
<if test="paramValue != null and paramValue != ''">#{paramValue},</if>
|
<if test="collectTime != null">#{collectTime},</if>
|
</trim>
|
</insert>
|
|
<update id="updateDaParamCollection" parameterType="DaParamCollection">
|
update da_param_collection
|
<trim prefix="SET" suffixOverrides=",">
|
<if test="sfcCode != null and sfcCode != ''">sfc_code = #{sfcCode},</if>
|
<if test="locationCode != null and locationCode != ''">location_code = #{locationCode},</if>
|
<if test="paramCode != null and paramCode != ''">param_code = #{paramCode},</if>
|
<if test="paramName != null">param_name = #{paramName},</if>
|
<if test="paramValue != null and paramValue != ''">param_value = #{paramValue},</if>
|
<if test="collectTime != null">collect_time = #{collectTime},</if>
|
</trim>
|
where id = #{id}
|
</update>
|
|
<delete id="deleteDaParamCollectionById" parameterType="Long">
|
delete from da_param_collection where id = #{id}
|
</delete>
|
|
<delete id="deleteDaParamCollectionByIds" parameterType="String">
|
delete from da_param_collection where id in
|
<foreach item="id" collection="array" open="(" separator="," close=")">
|
#{id}
|
</foreach>
|
</delete>
|
</mapper>
|