-
admin
2024-11-21 5773fa29e070fe3d8a60be63c14e871e1138dfc9
提交 | 用户 | 时间
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>
28         </where>
29     </select>
30     
31     <select id="selectDaParamCollectionById" parameterType="Long" resultMap="DaParamCollectionResult">
32         <include refid="selectDaParamCollectionVo"/>
33         where id = #{id}
34     </select>
35
36     <insert id="insertDaParamCollection" parameterType="DaParamCollection" useGeneratedKeys="true" keyProperty="id">
37         insert into da_param_collection
38         <trim prefix="(" suffix=")" suffixOverrides=",">
39             <if test="sfcCode != null and sfcCode != ''">sfc_code,</if>
40             <if test="locationCode != null and locationCode != ''">location_code,</if>
41             <if test="paramCode != null and paramCode != ''">param_code,</if>
42             <if test="paramName != null">param_name,</if>
43             <if test="paramValue != null and paramValue != ''">param_value,</if>
44             <if test="collectTime != null">collect_time,</if>
45          </trim>
46         <trim prefix="values (" suffix=")" suffixOverrides=",">
47             <if test="sfcCode != null and sfcCode != ''">#{sfcCode},</if>
48             <if test="locationCode != null and locationCode != ''">#{locationCode},</if>
49             <if test="paramCode != null and paramCode != ''">#{paramCode},</if>
50             <if test="paramName != null">#{paramName},</if>
51             <if test="paramValue != null and paramValue != ''">#{paramValue},</if>
52             <if test="collectTime != null">#{collectTime},</if>
53          </trim>
54     </insert>
55
56     <update id="updateDaParamCollection" parameterType="DaParamCollection">
57         update da_param_collection
58         <trim prefix="SET" suffixOverrides=",">
59             <if test="sfcCode != null and sfcCode != ''">sfc_code = #{sfcCode},</if>
60             <if test="locationCode != null and locationCode != ''">location_code = #{locationCode},</if>
61             <if test="paramCode != null and paramCode != ''">param_code = #{paramCode},</if>
62             <if test="paramName != null">param_name = #{paramName},</if>
63             <if test="paramValue != null and paramValue != ''">param_value = #{paramValue},</if>
64             <if test="collectTime != null">collect_time = #{collectTime},</if>
65         </trim>
66         where id = #{id}
67     </update>
68
69     <delete id="deleteDaParamCollectionById" parameterType="Long">
70         delete from da_param_collection where id = #{id}
71     </delete>
72
73     <delete id="deleteDaParamCollectionByIds" parameterType="String">
74         delete from da_param_collection where id in 
75         <foreach item="id" collection="array" open="(" separator="," close=")">
76             #{id}
77         </foreach>
78     </delete>
79 </mapper>