提交 | 用户 | 时间
|
c9abcf
|
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.ScOpcConfMapper"> |
|
6 |
|
|
7 |
<resultMap type="ScOpcConf" id="ScOpcConfResult"> |
|
8 |
<result property="id" column="id" /> |
|
9 |
<result property="locationCode" column="location_code" /> |
|
10 |
<result property="locationName" column="location_name" /> |
|
11 |
<result property="node" column="node" /> |
|
12 |
<result property="type" column="type" /> |
|
13 |
<result property="subscribe" column="subscribe" /> |
|
14 |
<result property="delFlag" column="del_flag" /> |
|
15 |
<result property="createBy" column="create_by" /> |
|
16 |
<result property="createTime" column="create_time" /> |
|
17 |
<result property="updateBy" column="update_by" /> |
|
18 |
<result property="updateTime" column="update_time" /> |
|
19 |
</resultMap> |
|
20 |
|
|
21 |
<sql id="selectScOpcConfVo"> |
|
22 |
select id, location_code, location_name, node, type, subscribe, del_flag, create_by, create_time, update_by, update_time from sc_opc_conf |
|
23 |
</sql> |
|
24 |
|
|
25 |
<select id="selectScOpcConfList" parameterType="ScOpcConf" resultMap="ScOpcConfResult"> |
|
26 |
<include refid="selectScOpcConfVo"/> |
|
27 |
<where> |
|
28 |
<if test="locationCode != null and locationCode != ''"> and location_code like concat('%', #{locationCode}, '%')</if> |
|
29 |
<if test="locationName != null and locationName != ''"> and location_name like concat('%', #{locationName}, '%')</if> |
|
30 |
<if test="node != null and node != ''"> and node like concat('%', #{node}, '%')</if> |
|
31 |
<if test="type != null and type != ''"> and type = #{type}</if> |
|
32 |
<if test="subscribe != null and subscribe != ''"> and subscribe = #{subscribe}</if> |
|
33 |
</where> |
|
34 |
</select> |
|
35 |
|
|
36 |
<select id="selectScOpcConfById" parameterType="Long" resultMap="ScOpcConfResult"> |
|
37 |
<include refid="selectScOpcConfVo"/> |
|
38 |
where id = #{id} |
|
39 |
</select> |
|
40 |
|
|
41 |
<insert id="insertScOpcConf" parameterType="ScOpcConf" useGeneratedKeys="true" keyProperty="id"> |
|
42 |
insert into sc_opc_conf |
|
43 |
<trim prefix="(" suffix=")" suffixOverrides=","> |
|
44 |
<if test="locationCode != null">location_code,</if> |
|
45 |
<if test="locationName != null">location_name,</if> |
|
46 |
<if test="node != null">node,</if> |
|
47 |
<if test="type != null">type,</if> |
|
48 |
<if test="subscribe != null">subscribe,</if> |
|
49 |
<if test="delFlag != null">del_flag,</if> |
|
50 |
<if test="createBy != null">create_by,</if> |
|
51 |
<if test="createTime != null">create_time,</if> |
|
52 |
<if test="updateBy != null">update_by,</if> |
|
53 |
<if test="updateTime != null">update_time,</if> |
|
54 |
</trim> |
|
55 |
<trim prefix="values (" suffix=")" suffixOverrides=","> |
|
56 |
<if test="locationCode != null">#{locationCode},</if> |
|
57 |
<if test="locationName != null">#{locationName},</if> |
|
58 |
<if test="node != null">#{node},</if> |
|
59 |
<if test="type != null">#{type},</if> |
|
60 |
<if test="subscribe != null">#{subscribe},</if> |
|
61 |
<if test="delFlag != null">#{delFlag},</if> |
|
62 |
<if test="createBy != null">#{createBy},</if> |
|
63 |
<if test="createTime != null">#{createTime},</if> |
|
64 |
<if test="updateBy != null">#{updateBy},</if> |
|
65 |
<if test="updateTime != null">#{updateTime},</if> |
|
66 |
</trim> |
|
67 |
</insert> |
|
68 |
|
|
69 |
<update id="updateScOpcConf" parameterType="ScOpcConf"> |
|
70 |
update sc_opc_conf |
|
71 |
<trim prefix="SET" suffixOverrides=","> |
|
72 |
<if test="locationCode != null">location_code = #{locationCode},</if> |
|
73 |
<if test="locationName != null">location_name = #{locationName},</if> |
|
74 |
<if test="node != null">node = #{node},</if> |
|
75 |
<if test="type != null">type = #{type},</if> |
|
76 |
<if test="subscribe != null">subscribe = #{subscribe},</if> |
|
77 |
<if test="delFlag != null">del_flag = #{delFlag},</if> |
|
78 |
<if test="createBy != null">create_by = #{createBy},</if> |
|
79 |
<if test="createTime != null">create_time = #{createTime},</if> |
|
80 |
<if test="updateBy != null">update_by = #{updateBy},</if> |
|
81 |
<if test="updateTime != null">update_time = #{updateTime},</if> |
|
82 |
</trim> |
|
83 |
where id = #{id} |
|
84 |
</update> |
|
85 |
|
|
86 |
<delete id="deleteScOpcConfById" parameterType="Long"> |
|
87 |
delete from sc_opc_conf where id = #{id} |
|
88 |
</delete> |
|
89 |
|
|
90 |
<delete id="deleteScOpcConfByIds" parameterType="String"> |
|
91 |
delete from sc_opc_conf where id in |
|
92 |
<foreach item="id" collection="array" open="(" separator="," close=")"> |
|
93 |
#{id} |
|
94 |
</foreach> |
|
95 |
</delete> |
|
96 |
</mapper> |