燕山石化溯源三维电子沙盘-【后端】-服务
1
13693261870
2024-11-29 9a8c8a90c7c01b6bc770d4be5baeff72c058468c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
<?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.yssh.mapper.AlertConfigMapper">
    <resultMap id="AlertConfigResult" type="com.yssh.entity.AlertConfig">
        <id column="id" property="id" />
        <result column="jcyj" property="jcyj" />
        <result column="jcbj" property="jcbj" />
        <result column="pfyj" property="pfyj" />
        <result column="pfbj" property="pfbj" />
    </resultMap>
     
    <sql id="alertConfigSQL">
        SELECT id, jcyj, jcbj, pfyj, pfbj 
        FROM alert_config
    </sql>
    
    <select id="getAll" resultMap="AlertConfigResult">
        <include refid="alertConfigSQL"></include>
    </select>
    
    <select id="query" resultMap="AlertConfigResult" parameterType="Integer">
        <include refid="alertConfigSQL"></include>
        WHERE id= #{id}
    </select>
    
     <insert id="insert" parameterType="com.yssh.entity.AlertConfig">
        insert into alert_config (
            jcyj, jcbj, pfyj, pfbj
        )
        values (
            #{jcyj},#{jcbj},#{pfyj},#{pfbj}
        )
    </insert>
     
     <update id="update" parameterType="com.yssh.entity.AlertConfig">
        update alert_config
        <set >
            <if test="jcyj != null and jcyj != ''">
                jcyj = #{jcyj},
            </if>
            <if test="jcbj != null and jcbj != ''">
                jcbj = #{jcbj},
            </if>
            <if test="pfbj != null and pfbj != ''">
                pfbj = #{pfbj},
            </if>
            <if test="pfyj != null and pfyj != ''">
                pfyj = #{pfyj},
            </if>
        </set>
        where id = #{id}
    </update>
    
    <delete id="delete" parameterType="Integer">
        DELETE FROM alert_config WHERE id = #{id}
    </delete>
</mapper>