heheng
2024-11-20 44819a81b566a504554780afd4dd64fee0be7bb5
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
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
<?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.gkhy.system.mapper.ProjectManagementMapper">
    
    <resultMap type="ProjectManagement" id="ProjectManagementResult">
        <result property="id"    column="id"    />
        <result property="projectName"    column="project_name"    />
        <result property="deptId"    column="dept_id"    />
        <result property="deptName"    column="dept_name"    />
        <result property="companyName"    column="company_name"    />
        <result property="projectAddress"    column="project_address"    />
        <result property="deptUserName"    column="dept_user_name"    />
        <result property="version"    column="version"    />
        <result property="state"    column="state"    />
        <result property="remark"    column="remark"    />
        <result property="projectDateStart"    column="project_date_start"    />
        <result property="projectDateEnd"    column="project_date_end"    />
        <result property="expertCertificate"    column="expert_certificate"    />
        <result property="envaluationState"    column="envaluation_state"    />
        <result property="expertNum"    column="expert_num"    />
        <result property="delFlag"    column="del_flag"    />
        <result property="createBy"    column="create_by"    />
        <result property="createTime"    column="create_time"    />
        <result property="updateBy"    column="update_by"    />
        <result property="updateTime"    column="update_time"    />
    </resultMap>
 
    <sql id="selectProjectManagementVo">
        select id, project_name, dept_id, dept_name, company_name, project_address, dept_user_name, version, state, remark, project_date_start, project_date_end, expert_certificate, envaluation_state, expert_num, del_flag, create_by, create_time, update_by, update_time from project_management
    </sql>
 
    <select id="selectProjectManagementList" parameterType="ProjectManagement" resultMap="ProjectManagementResult">
        <include refid="selectProjectManagementVo"/>
        <where>  
            <if test="projectName != null  and projectName != ''"> and project_name like concat('%', #{projectName}, '%')</if>
            <if test="deptId != null "> and dept_id = #{deptId}</if>
            <if test="deptName != null  and deptName != ''"> and dept_name like concat('%', #{deptName}, '%')</if>
            <if test="companyName != null  and companyName != ''"> and company_name like concat('%', #{companyName}, '%')</if>
            <if test="projectAddress != null  and projectAddress != ''"> and project_address = #{projectAddress}</if>
            <if test="deptUserName != null  and deptUserName != ''"> and dept_user_name like concat('%', #{deptUserName}, '%')</if>
            <if test="version != null "> and version = #{version}</if>
            <if test="state != null "> and state = #{state}</if>
            <if test="projectDateStart != null "> and project_date_start = #{projectDateStart}</if>
            <if test="projectDateEnd != null "> and project_date_end = #{projectDateEnd}</if>
            <if test="expertCertificate != null  and expertCertificate != ''"> and expert_certificate = #{expertCertificate}</if>
            <if test="envaluationState != null "> and envaluation_state = #{envaluationState}</if>
            <if test="expertNum != null "> and expert_num = #{expertNum}</if>
        </where>
    </select>
    
    <select id="selectProjectManagementById" parameterType="Long" resultMap="ProjectManagementResult">
        <include refid="selectProjectManagementVo"/>
        where id = #{id}
    </select>
 
    <insert id="insertProjectManagement" parameterType="ProjectManagement" useGeneratedKeys="true" keyProperty="id">
        insert into project_management
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="projectName != null and projectName != ''">project_name,</if>
            <if test="deptId != null">dept_id,</if>
            <if test="deptName != null and deptName != ''">dept_name,</if>
            <if test="companyName != null and companyName != ''">company_name,</if>
            <if test="projectAddress != null and projectAddress != ''">project_address,</if>
            <if test="deptUserName != null and deptUserName != ''">dept_user_name,</if>
            <if test="version != null">version,</if>
            <if test="state != null">state,</if>
            <if test="remark != null">remark,</if>
            <if test="projectDateStart != null">project_date_start,</if>
            <if test="projectDateEnd != null">project_date_end,</if>
            <if test="expertCertificate != null">expert_certificate,</if>
            <if test="envaluationState != null">envaluation_state,</if>
            <if test="expertNum != null">expert_num,</if>
            <if test="delFlag != null">del_flag,</if>
            <if test="createBy != null">create_by,</if>
            <if test="createTime != null">create_time,</if>
            <if test="updateBy != null">update_by,</if>
            <if test="updateTime != null">update_time,</if>
         </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
            <if test="projectName != null and projectName != ''">#{projectName},</if>
            <if test="deptId != null">#{deptId},</if>
            <if test="deptName != null and deptName != ''">#{deptName},</if>
            <if test="companyName != null and companyName != ''">#{companyName},</if>
            <if test="projectAddress != null and projectAddress != ''">#{projectAddress},</if>
            <if test="deptUserName != null and deptUserName != ''">#{deptUserName},</if>
            <if test="version != null">#{version},</if>
            <if test="state != null">#{state},</if>
            <if test="remark != null">#{remark},</if>
            <if test="projectDateStart != null">#{projectDateStart},</if>
            <if test="projectDateEnd != null">#{projectDateEnd},</if>
            <if test="expertCertificate != null">#{expertCertificate},</if>
            <if test="envaluationState != null">#{envaluationState},</if>
            <if test="expertNum != null">#{expertNum},</if>
            <if test="delFlag != null">#{delFlag},</if>
            <if test="createBy != null">#{createBy},</if>
            <if test="createTime != null">#{createTime},</if>
            <if test="updateBy != null">#{updateBy},</if>
            <if test="updateTime != null">#{updateTime},</if>
         </trim>
    </insert>
 
    <update id="updateProjectManagement" parameterType="ProjectManagement">
        update project_management
        <trim prefix="SET" suffixOverrides=",">
            <if test="projectName != null and projectName != ''">project_name = #{projectName},</if>
            <if test="deptId != null">dept_id = #{deptId},</if>
            <if test="deptName != null and deptName != ''">dept_name = #{deptName},</if>
            <if test="companyName != null and companyName != ''">company_name = #{companyName},</if>
            <if test="projectAddress != null and projectAddress != ''">project_address = #{projectAddress},</if>
            <if test="deptUserName != null and deptUserName != ''">dept_user_name = #{deptUserName},</if>
            <if test="version != null">version = #{version},</if>
            <if test="state != null">state = #{state},</if>
            <if test="remark != null">remark = #{remark},</if>
            <if test="projectDateStart != null">project_date_start = #{projectDateStart},</if>
            <if test="projectDateEnd != null">project_date_end = #{projectDateEnd},</if>
            <if test="expertCertificate != null">expert_certificate = #{expertCertificate},</if>
            <if test="envaluationState != null">envaluation_state = #{envaluationState},</if>
            <if test="expertNum != null">expert_num = #{expertNum},</if>
            <if test="delFlag != null">del_flag = #{delFlag},</if>
            <if test="createBy != null">create_by = #{createBy},</if>
            <if test="createTime != null">create_time = #{createTime},</if>
            <if test="updateBy != null">update_by = #{updateBy},</if>
            <if test="updateTime != null">update_time = #{updateTime},</if>
        </trim>
        where id = #{id}
    </update>
 
    <delete id="deleteProjectManagementById" parameterType="Long">
        delete from project_management where id = #{id}
    </delete>
 
    <delete id="deleteProjectManagementByIds" parameterType="String">
        delete from project_management where id in 
        <foreach item="id" collection="array" open="(" separator="," close=")">
            #{id}
        </foreach>
    </delete>
</mapper>