liulingling.177216
2024-08-26 349f1cfc5fa77fbc636d542df0d8050fddec48c2
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
<?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.dingzhuo.energy.basic.data.energy.mapper.EnergyProjectAnnexMapper">
    
    <resultMap type="EnergyProjectAnnex" id="EnergyProjectAnnexResult">
        <result property="id"    column="id"    />
        <result property="projectId"    column="project_id"    />
        <result property="fileName"    column="file_name"    />
        <result property="fileSuffix"    column="file_suffix"    />
        <result property="filePath"    column="file_path"    />
        <result property="delFlage"    column="del_flage"    />
        <result property="createTime"    column="create_time"    />
        <result property="createOperator"    column="create_operator"    />
        <result property="updateTime"    column="update_time"    />
        <result property="updateOperator"    column="update_operator"    />
    </resultMap>
 
    <sql id="selectEnergyProjectAnnexVo">
        select id, project_id, file_name, file_suffix, file_path, del_flage, create_time, create_operator, update_time, update_operator from energy_project_annex
    </sql>
 
    <select id="selectEnergyProjectAnnexList" parameterType="EnergyProjectAnnex" resultMap="EnergyProjectAnnexResult">
        <include refid="selectEnergyProjectAnnexVo"/>
        <where>
            <if test="projectId != null  and projectId != ''"> and project_id=#{projectId}</if>
            <if test="fileName != null  and fileName != ''"> and file_name like concat('%', #{fileName}, '%')</if>
            <if test="fileSuffix != null  and fileSuffix != ''"> and file_suffix like concat('%', #{fileSuffix}, '%')</if>
            <if test="filePath != null  and filePath != ''"> and file_path like concat('%', #{filePath}, '%')</if>
            <if test="delFlage != null  and delFlage != ''"> and del_flage like concat('%', #{delFlage}, '%')</if>
            <if test="createOperator != null  and createOperator != ''"> and create_operator like concat('%', #{createOperator}, '%')</if>
            <if test="updateOperator != null  and updateOperator != ''"> and update_operator like concat('%', #{updateOperator}, '%')</if>
        </where>
    </select>
    
    <select id="selectEnergyProjectAnnexById" parameterType="String" resultMap="EnergyProjectAnnexResult">
        <include refid="selectEnergyProjectAnnexVo"/>
        where id = #{id}
    </select>
        
    <insert id="insertEnergyProjectAnnex" parameterType="EnergyProjectAnnex">
        insert into energy_project_annex
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="id != null  and id != ''">id,</if>
            <if test="projectId != null  and projectId != ''">project_id,</if>
            <if test="fileName != null  and fileName != ''">file_name,</if>
            <if test="fileSuffix != null  and fileSuffix != ''">file_suffix,</if>
            <if test="filePath != null  and filePath != ''">file_path,</if>
            <if test="delFlage != null  and delFlage != ''">del_flage,</if>
            <if test="createTime != null ">create_time,</if>
            <if test="createOperator != null  and createOperator != ''">create_operator,</if>
            <if test="updateTime != null ">update_time,</if>
            <if test="updateOperator != null  and updateOperator != ''">update_operator,</if>
         </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
            <if test="id != null  and id != ''">#{id},</if>
            <if test="projectId != null  and projectId != ''">#{projectId},</if>
            <if test="fileName != null  and fileName != ''">#{fileName},</if>
            <if test="fileSuffix != null  and fileSuffix != ''">#{fileSuffix},</if>
            <if test="filePath != null  and filePath != ''">#{filePath},</if>
            <if test="delFlage != null  and delFlage != ''">#{delFlage},</if>
            <if test="createTime != null ">#{createTime},</if>
            <if test="createOperator != null  and createOperator != ''">#{createOperator},</if>
            <if test="updateTime != null ">#{updateTime},</if>
            <if test="updateOperator != null  and updateOperator != ''">#{updateOperator},</if>
         </trim>
    </insert>
 
    <update id="updateEnergyProjectAnnex" parameterType="EnergyProjectAnnex">
        update energy_project_annex
        <trim prefix="SET" suffixOverrides=",">
            <if test="projectId != null  and projectId != ''">project_id = #{projectId},</if>
            <if test="fileName != null  and fileName != ''">file_name = #{fileName},</if>
            <if test="fileSuffix != null  and fileSuffix != ''">file_suffix = #{fileSuffix},</if>
            <if test="filePath != null  and filePath != ''">file_path = #{filePath},</if>
            <if test="delFlage != null  and delFlage != ''">del_flage = #{delFlage},</if>
            <if test="createTime != null ">create_time = #{createTime},</if>
            <if test="createOperator != null  and createOperator != ''">create_operator = #{createOperator},</if>
            <if test="updateTime != null ">update_time = #{updateTime},</if>
            <if test="updateOperator != null  and updateOperator != ''">update_operator = #{updateOperator},</if>
        </trim>
        where id = #{id}
    </update>
 
    <delete id="deleteEnergyProjectAnnexById" parameterType="String">
        delete from energy_project_annex where id = #{id}
    </delete>
 
    <delete id="deleteEnergyProjectAnnexByIds" parameterType="String">
        delete from energy_project_annex where id in 
        <foreach item="id" collection="array" open="(" separator="," close=")">
            #{id}
        </foreach>
    </delete>
    
</mapper>