地质所 沉降监测网建设项目
chenhuan
2024-05-16 0fdd42e318f51f9e3c6581473416af1cca69877f
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
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
<?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.platform.mapper.ProjectApplyMapper">
    
    <resultMap type="ProjectApply" id="ProjectApplyResult">
        <result property="id"    column="id"    />
        <result property="projectName"    column="project_name"    />
        <result property="contacts"    column="contacts"    />
        <result property="tel"    column="tel"    />
        <result property="email"    column="email"    />
        <result property="remark"    column="remark"    />
        <result property="applyType"    column="apply_type"    />
        <result property="resource"    column="resource"    />
        <result property="createTime"    column="create_time"    />
        <result property="createBy"    column="create_by"    />
        <result property="status"    column="status"    />
        <result property="url"    column="url"    />
        <result property="onProjectName"    column="on_project_name"    />
        <result property="onProjectAddr"    column="on_project_addr"    />
        <result property="onProjectDept"    column="on_project_dept"    />
        <result property="files"    column="files"    />
    </resultMap>
 
    <sql id="selectProjectApplyVo">
        select id, project_name, contacts, tel, email, remark, apply_type, resource, create_time, create_by,
         status, url,on_project_name ,on_project_addr,on_project_dept,files from js_project_apply
    </sql>
 
    <select id="selectProjectApplyList" parameterType="ProjectApply" resultMap="ProjectApplyResult">
        <include refid="selectProjectApplyVo"/>
        <where>  
            <if test="projectName != null  and projectName != ''"> and project_name like concat('%', #{projectName}, '%')</if>
            <if test="contacts != null  and contacts != ''"> and contacts = #{contacts}</if>
            <if test="tel != null  and tel != ''"> and tel = #{tel}</if>
            <if test="email != null  and email != ''"> and email = #{email}</if>
            <if test="applyType != null  and applyType != ''"> and apply_type = #{applyType}</if>
            <if test="resource != null  and resource != ''"> and resource = #{resource}</if>
            <if test="status != null  and status != ''"> and status = #{status}</if>
            <if test="url != null  and url != ''"> and url = #{url}</if>
            <if test="createBy != null  and createBy != ''"> and create_by = #{createBy}</if>
            <if test="onProjectName != null  and onProjectName != ''"> and on_project_name like concat('%', #{onProjectName}, '%')</if>
        </where>
    </select>
    
    <select id="selectProjectApplyById" parameterType="String" resultMap="ProjectApplyResult">
        <include refid="selectProjectApplyVo"/>
        where id = #{id}
    </select>
        
    <insert id="insertProjectApply" parameterType="ProjectApply">
        insert into js_project_apply
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="id != null  and id != ''">id,</if>
            <if test="projectName != null  and projectName != ''">project_name,</if>
            <if test="contacts != null  and contacts != ''">contacts,</if>
            <if test="tel != null  and tel != ''">tel,</if>
            <if test="email != null  and email != ''">email,</if>
            <if test="remark != null  and remark != ''">remark,</if>
            <if test="applyType != null  and applyType != ''">apply_type,</if>
            <if test="resource != null  and resource != ''">resource,</if>
            <if test="createTime != null ">create_time,</if>
            <if test="createBy != null  and createBy != ''">create_by,</if>
            <if test="status != null  and status != ''">status,</if>
            <if test="url != null  and url != ''">url,</if>
            <if test="onProjectName != null  and onProjectName != ''">on_project_name,</if>
            <if test="onProjectAddr != null  and onProjectAddr != ''">on_project_addr,</if>
            <if test="onProjectDept != null  and onProjectDept != ''">on_project_dept,</if>
            <if test="files != null  and files != ''">files,</if>
         </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
            <if test="id != null  and id != ''">#{id},</if>
            <if test="projectName != null  and projectName != ''">#{projectName},</if>
            <if test="contacts != null  and contacts != ''">#{contacts},</if>
            <if test="tel != null  and tel != ''">#{tel},</if>
            <if test="email != null  and email != ''">#{email},</if>
            <if test="remark != null  and remark != ''">#{remark},</if>
            <if test="applyType != null  and applyType != ''">#{applyType},</if>
            <if test="resource != null  and resource != ''">#{resource},</if>
            <if test="createTime != null ">#{createTime},</if>
            <if test="createBy != null  and createBy != ''">#{createBy},</if>
            <if test="status != null  and status != ''">#{status},</if>
            <if test="url != null  and url != ''">#{url},</if>
            <if test="onProjectName != null  and onProjectName != ''">#{onProjectName},</if>
            <if test="onProjectAddr != null  and onProjectAddr != ''">#{onProjectAddr},</if>
            <if test="onProjectDept != null  and onProjectDept != ''">#{onProjectDept},</if>
            <if test="files != null  and files != ''">#{files},</if>
         </trim>
    </insert>
 
    <update id="updateProjectApply" parameterType="ProjectApply">
        update js_project_apply
        <trim prefix="SET" suffixOverrides=",">
            <if test="projectName != null  and projectName != ''">project_name = #{projectName},</if>
            <if test="contacts != null  and contacts != ''">contacts = #{contacts},</if>
            <if test="tel != null  and tel != ''">tel = #{tel},</if>
            <if test="email != null  and email != ''">email = #{email},</if>
            <if test="remark != null  and remark != ''">remark = #{remark},</if>
            <if test="applyType != null  and applyType != ''">apply_type = #{applyType},</if>
            <if test="resource != null  and resource != ''">resource = #{resource},</if>
            <if test="createTime != null ">create_time = #{createTime},</if>
            <if test="createBy != null  and createBy != ''">create_by = #{createBy},</if>
            <if test="status != null  and status != ''">status = #{status},</if>
            <if test="url != null  and url != ''">url = #{url},</if>
            <if test="onProjectName != null  and onProjectName != ''">on_project_name = #{onProjectName},</if>
            <if test="onProjectAddr != null  and onProjectAddr != ''">on_project_addr = #{onProjectAddr},</if>
            <if test="onProjectDept != null  and onProjectDept != ''">on_project_dept = #{onProjectDept},</if>
            <if test="files != null  and files != ''">files = #{files},</if>
        </trim>
        where id = #{id}
    </update>
 
    <delete id="deleteProjectApplyById" parameterType="String">
        delete from js_project_apply where id = #{id}
    </delete>
 
    <delete id="deleteProjectApplyByIds" parameterType="String">
        delete from js_project_apply where id in 
        <foreach item="id" collection="array" open="(" separator="," close=")">
            #{id}
        </foreach>
    </delete>
    
</mapper>