hdy
7 天以前 b9df2fc5c64a1d989991655a9e42e4d1f2ec4075
提交 | 用户 | 时间
4d458e 1 <?xml version="1.0" encoding="UTF-8" ?>
A 2 <!DOCTYPE mapper
3 PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
4 "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
5 <mapper namespace="com.billion.main.da.mapper.DaParamCollectionMapper">
6     
7     <resultMap type="DaParamCollection" id="DaParamCollectionResult">
8         <result property="id"    column="id"    />
9         <result property="sfcCode"    column="sfc_code"    />
10         <result property="locationCode"    column="location_code"    />
11         <result property="paramCode"    column="param_code"    />
12         <result property="paramName"    column="param_name"    />
13         <result property="paramValue"    column="param_value"    />
14         <result property="collectTime"    column="collect_time"    />
15     </resultMap>
16
17     <sql id="selectDaParamCollectionVo">
18         select id, sfc_code, location_code, param_code, param_name, param_value, collect_time from da_param_collection
19     </sql>
20
21     <select id="selectDaParamCollectionList" parameterType="DaParamCollection" resultMap="DaParamCollectionResult">
22         <include refid="selectDaParamCollectionVo"/>
23         <where>  
24             <if test="sfcCode != null  and sfcCode != ''"> and sfc_code = #{sfcCode}</if>
25             <if test="locationCode != null  and locationCode != ''"> and location_code like concat('%', #{locationCode}, '%')</if>
26             <if test="paramCode != null  and paramCode != ''"> and param_code = #{paramCode}</if>
27             <if test="paramName != null  and paramName != ''"> and param_name like concat('%', #{paramName}, '%')</if>
20c287 28             <if test="startTime != null"> and collect_time BETWEEN #{startTime} and #{stopTime}</if>
A 29
4d458e 30         </where>
A 31     </select>
32     
33     <select id="selectDaParamCollectionById" parameterType="Long" resultMap="DaParamCollectionResult">
34         <include refid="selectDaParamCollectionVo"/>
35         where id = #{id}
36     </select>
37
38     <insert id="insertDaParamCollection" parameterType="DaParamCollection" useGeneratedKeys="true" keyProperty="id">
39         insert into da_param_collection
40         <trim prefix="(" suffix=")" suffixOverrides=",">
41             <if test="sfcCode != null and sfcCode != ''">sfc_code,</if>
42             <if test="locationCode != null and locationCode != ''">location_code,</if>
43             <if test="paramCode != null and paramCode != ''">param_code,</if>
44             <if test="paramName != null">param_name,</if>
45             <if test="paramValue != null and paramValue != ''">param_value,</if>
46             <if test="collectTime != null">collect_time,</if>
47          </trim>
48         <trim prefix="values (" suffix=")" suffixOverrides=",">
49             <if test="sfcCode != null and sfcCode != ''">#{sfcCode},</if>
50             <if test="locationCode != null and locationCode != ''">#{locationCode},</if>
51             <if test="paramCode != null and paramCode != ''">#{paramCode},</if>
52             <if test="paramName != null">#{paramName},</if>
53             <if test="paramValue != null and paramValue != ''">#{paramValue},</if>
54             <if test="collectTime != null">#{collectTime},</if>
55          </trim>
56     </insert>
57
58     <update id="updateDaParamCollection" parameterType="DaParamCollection">
59         update da_param_collection
60         <trim prefix="SET" suffixOverrides=",">
61             <if test="sfcCode != null and sfcCode != ''">sfc_code = #{sfcCode},</if>
62             <if test="locationCode != null and locationCode != ''">location_code = #{locationCode},</if>
63             <if test="paramCode != null and paramCode != ''">param_code = #{paramCode},</if>
64             <if test="paramName != null">param_name = #{paramName},</if>
65             <if test="paramValue != null and paramValue != ''">param_value = #{paramValue},</if>
66             <if test="collectTime != null">collect_time = #{collectTime},</if>
67         </trim>
68         where id = #{id}
69     </update>
70
71     <delete id="deleteDaParamCollectionById" parameterType="Long">
72         delete from da_param_collection where id = #{id}
73     </delete>
74
75     <delete id="deleteDaParamCollectionByIds" parameterType="String">
76         delete from da_param_collection where id in 
77         <foreach item="id" collection="array" open="(" separator="," close=")">
78             #{id}
79         </foreach>
80     </delete>
81 </mapper>