hdy
2024-11-22 04f79eab65aec630b36ded8b329c4f2dd2eecd4e
提交 | 用户 | 时间
04f79e 1 <?xml version="1.0" encoding="UTF-8" ?>
H 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.sc.mapper.ScCollectionParamConfMapper">
6     
7     <resultMap type="ScCollectionParamConf" id="ScCollectionParamConfResult">
8         <result property="id"    column="id"    />
9         <result property="productCode"    column="product_code"    />
10         <result property="productType"    column="product_type"    />
11         <result property="locationCode"    column="location_code"    />
12         <result property="paramCode"    column="param_code"    />
13         <result property="paramName"    column="param_name"    />
14         <result property="paramSetCode"    column="param_set_code"    />
15         <result property="paramSetName"    column="param_set_name"    />
16         <result property="node"    column="node"    />
17         <result property="type"    column="type"    />
18         <result property="unit"    column="unit"    />
19         <result property="paramUpper"    column="param_upper"    />
20         <result property="paramLower"    column="param_lower"    />
21         <result property="paramCentral"    column="param_central"    />
22         <result property="orderNum"    column="order_num"    />
23         <result property="subscribe"    column="subscribe"    />
24         <result property="delFlag"    column="del_flag"    />
25         <result property="createBy"    column="create_by"    />
26         <result property="createTime"    column="create_time"    />
27         <result property="updateBy"    column="update_by"    />
28         <result property="updateTime"    column="update_time"    />
29     </resultMap>
30
31     <sql id="selectScCollectionParamConfVo">
32         select id, product_code, product_type, location_code, param_code, param_name, param_set_code, param_set_name, node, type, unit, param_upper, param_lower, param_central, order_num, subscribe, del_flag, create_by, create_time, update_by, update_time from sc_collection_param_conf
33     </sql>
34
35     <select id="selectScCollectionParamConfList" parameterType="ScCollectionParamConf" resultMap="ScCollectionParamConfResult">
36         <include refid="selectScCollectionParamConfVo"/>
37         <where>  
38             <if test="productCode != null  and productCode != ''"> and product_code = #{productCode}</if>
39             <if test="productType != null  and productType != ''"> and product_type = #{productType}</if>
40             <if test="locationCode != null  and locationCode != ''"> and location_code = #{locationCode}</if>
41             <if test="paramCode != null  and paramCode != ''"> and param_code = #{paramCode}</if>
42             <if test="paramName != null  and paramName != ''"> and param_name like concat('%', #{paramName}, '%')</if>
43             <if test="paramSetCode != null  and paramSetCode != ''"> and param_set_code = #{paramSetCode}</if>
44             <if test="paramSetName != null  and paramSetName != ''"> and param_set_name like concat('%', #{paramSetName}, '%')</if>
45             <if test="node != null  and node != ''"> and node = #{node}</if>
46             <if test="type != null  and type != ''"> and type = #{type}</if>
47             <if test="unit != null  and unit != ''"> and unit = #{unit}</if>
48             <if test="paramUpper != null  and paramUpper != ''"> and param_upper = #{paramUpper}</if>
49             <if test="paramLower != null  and paramLower != ''"> and param_lower = #{paramLower}</if>
50             <if test="paramCentral != null  and paramCentral != ''"> and param_central = #{paramCentral}</if>
51             <if test="orderNum != null "> and order_num = #{orderNum}</if>
52             <if test="subscribe != null  and subscribe != ''"> and subscribe = #{subscribe}</if>
53         </where>
54     </select>
55     
56     <select id="selectScCollectionParamConfById" parameterType="Long" resultMap="ScCollectionParamConfResult">
57         <include refid="selectScCollectionParamConfVo"/>
58         where id = #{id}
59     </select>
60
61     <insert id="insertScCollectionParamConf" parameterType="ScCollectionParamConf" useGeneratedKeys="true" keyProperty="id">
62         insert into sc_collection_param_conf
63         <trim prefix="(" suffix=")" suffixOverrides=",">
64             <if test="productCode != null">product_code,</if>
65             <if test="productType != null">product_type,</if>
66             <if test="locationCode != null">location_code,</if>
67             <if test="paramCode != null">param_code,</if>
68             <if test="paramName != null">param_name,</if>
69             <if test="paramSetCode != null">param_set_code,</if>
70             <if test="paramSetName != null">param_set_name,</if>
71             <if test="node != null">node,</if>
72             <if test="type != null">type,</if>
73             <if test="unit != null">unit,</if>
74             <if test="paramUpper != null">param_upper,</if>
75             <if test="paramLower != null">param_lower,</if>
76             <if test="paramCentral != null">param_central,</if>
77             <if test="orderNum != null">order_num,</if>
78             <if test="subscribe != null">subscribe,</if>
79             <if test="delFlag != null">del_flag,</if>
80             <if test="createBy != null">create_by,</if>
81             <if test="createTime != null">create_time,</if>
82             <if test="updateBy != null">update_by,</if>
83             <if test="updateTime != null">update_time,</if>
84          </trim>
85         <trim prefix="values (" suffix=")" suffixOverrides=",">
86             <if test="productCode != null">#{productCode},</if>
87             <if test="productType != null">#{productType},</if>
88             <if test="locationCode != null">#{locationCode},</if>
89             <if test="paramCode != null">#{paramCode},</if>
90             <if test="paramName != null">#{paramName},</if>
91             <if test="paramSetCode != null">#{paramSetCode},</if>
92             <if test="paramSetName != null">#{paramSetName},</if>
93             <if test="node != null">#{node},</if>
94             <if test="type != null">#{type},</if>
95             <if test="unit != null">#{unit},</if>
96             <if test="paramUpper != null">#{paramUpper},</if>
97             <if test="paramLower != null">#{paramLower},</if>
98             <if test="paramCentral != null">#{paramCentral},</if>
99             <if test="orderNum != null">#{orderNum},</if>
100             <if test="subscribe != null">#{subscribe},</if>
101             <if test="delFlag != null">#{delFlag},</if>
102             <if test="createBy != null">#{createBy},</if>
103             <if test="createTime != null">#{createTime},</if>
104             <if test="updateBy != null">#{updateBy},</if>
105             <if test="updateTime != null">#{updateTime},</if>
106          </trim>
107     </insert>
108
109     <update id="updateScCollectionParamConf" parameterType="ScCollectionParamConf">
110         update sc_collection_param_conf
111         <trim prefix="SET" suffixOverrides=",">
112             <if test="productCode != null">product_code = #{productCode},</if>
113             <if test="productType != null">product_type = #{productType},</if>
114             <if test="locationCode != null">location_code = #{locationCode},</if>
115             <if test="paramCode != null">param_code = #{paramCode},</if>
116             <if test="paramName != null">param_name = #{paramName},</if>
117             <if test="paramSetCode != null">param_set_code = #{paramSetCode},</if>
118             <if test="paramSetName != null">param_set_name = #{paramSetName},</if>
119             <if test="node != null">node = #{node},</if>
120             <if test="type != null">type = #{type},</if>
121             <if test="unit != null">unit = #{unit},</if>
122             <if test="paramUpper != null">param_upper = #{paramUpper},</if>
123             <if test="paramLower != null">param_lower = #{paramLower},</if>
124             <if test="paramCentral != null">param_central = #{paramCentral},</if>
125             <if test="orderNum != null">order_num = #{orderNum},</if>
126             <if test="subscribe != null">subscribe = #{subscribe},</if>
127             <if test="delFlag != null">del_flag = #{delFlag},</if>
128             <if test="createBy != null">create_by = #{createBy},</if>
129             <if test="createTime != null">create_time = #{createTime},</if>
130             <if test="updateBy != null">update_by = #{updateBy},</if>
131             <if test="updateTime != null">update_time = #{updateTime},</if>
132         </trim>
133         where id = #{id}
134     </update>
135
136     <delete id="deleteScCollectionParamConfById" parameterType="Long">
137         delete from sc_collection_param_conf where id = #{id}
138     </delete>
139
140     <delete id="deleteScCollectionParamConfByIds" parameterType="String">
141         delete from sc_collection_param_conf where id in 
142         <foreach item="id" collection="array" open="(" separator="," close=")">
143             #{id}
144         </foreach>
145     </delete>
146 </mapper>