地质所 沉降监测网建设项目
zmk
2024-05-15 9e3afc6d0fa514f986d3fea40fa23124e6fb5070
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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
<?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.javaweb.geo.mapper.HandleOpinionMapper">
    
    <resultMap type="HandleOpinion" id="HandleOpinionResult">
        <result property="ids"    column="ids"    />
        <result property="exceptionId"    column="exception_id"    />
        <result property="projectId"    column="project_id"    />
        <result property="companyId"    column="company_id"    />
        <result property="groupname"    column="groupName"    />
        <result property="opinion"    column="opinion"    />
        <result property="username"    column="userName"    />
        <result property="isDelete"    column="is_delete"    />
    </resultMap>
 
    <sql id="selectHandleOpinionVo">
        select ids, exception_id, project_id, company_id, groupName, opinion, userName, is_delete from js_handle_opinion
    </sql>
 
    <select id="selectHandleOpinionList" parameterType="HandleOpinion" resultMap="HandleOpinionResult">
        <include refid="selectHandleOpinionVo"/>
        <where>  
            <if test="exceptionId != null  and exceptionId != ''"> and exception_id = #{exceptionId}</if>
            <if test="projectId != null  and projectId != ''"> and project_id = #{projectId}</if>
            <if test="companyId != null  and companyId != ''"> and company_id = #{companyId}</if>
            <if test="groupname != null  and groupname != ''"> and groupName like concat('%', #{groupname}, '%')</if>
            <if test="opinion != null  and opinion != ''"> and opinion = #{opinion}</if>
            <if test="username != null  and username != ''"> and userName like concat('%', #{username}, '%')</if>
            <if test="isDelete != null  and isDelete != ''"> and is_delete = #{isDelete}</if>
        </where>
    </select>
    
    <select id="selectHandleOpinionById" parameterType="String" resultMap="HandleOpinionResult">
        <include refid="selectHandleOpinionVo"/>
        where ids = #{ids}
    </select>
        
    <insert id="insertHandleOpinion" parameterType="HandleOpinion">
        insert into js_handle_opinion
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="ids != null  and ids != ''">ids,</if>
            <if test="exceptionId != null  and exceptionId != ''">exception_id,</if>
            <if test="projectId != null  and projectId != ''">project_id,</if>
            <if test="companyId != null  and companyId != ''">company_id,</if>
            <if test="groupname != null  and groupname != ''">groupName,</if>
            <if test="opinion != null  and opinion != ''">opinion,</if>
            <if test="username != null  and username != ''">userName,</if>
            <if test="isDelete != null  and isDelete != ''">is_delete,</if>
         </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
            <if test="ids != null  and ids != ''">#{ids},</if>
            <if test="exceptionId != null  and exceptionId != ''">#{exceptionId},</if>
            <if test="projectId != null  and projectId != ''">#{projectId},</if>
            <if test="companyId != null  and companyId != ''">#{companyId},</if>
            <if test="groupname != null  and groupname != ''">#{groupname},</if>
            <if test="opinion != null  and opinion != ''">#{opinion},</if>
            <if test="username != null  and username != ''">#{username},</if>
            <if test="isDelete != null  and isDelete != ''">#{isDelete},</if>
         </trim>
    </insert>
 
    <update id="updateHandleOpinion" parameterType="HandleOpinion">
        update js_handle_opinion
        <trim prefix="SET" suffixOverrides=",">
            <if test="exceptionId != null  and exceptionId != ''">exception_id = #{exceptionId},</if>
            <if test="projectId != null  and projectId != ''">project_id = #{projectId},</if>
            <if test="companyId != null  and companyId != ''">company_id = #{companyId},</if>
            <if test="groupname != null  and groupname != ''">groupName = #{groupname},</if>
            <if test="opinion != null  and opinion != ''">opinion = #{opinion},</if>
            <if test="username != null  and username != ''">userName = #{username},</if>
            <if test="isDelete != null  and isDelete != ''">is_delete = #{isDelete},</if>
        </trim>
        where ids = #{ids}
    </update>
 
    <delete id="deleteHandleOpinionById" parameterType="String">
        delete from js_handle_opinion where ids = #{ids}
    </delete>
 
    <delete id="deleteHandleOpinionByIds" parameterType="String">
        delete from js_handle_opinion where ids in 
        <foreach item="ids" collection="array" open="(" separator="," close=")">
            #{ids}
        </foreach>
    </delete>
    
</mapper>