吉安感知网项目-后端
linwei
2026-02-05 08d4bb2bf4bfadc9ab5fcf6b0a2bfb543d22b2a0
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
<?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="org.sxkj.gd.orderdata.mapper.GdSupplyDemandAuditAttachmentMapper">
 
    <!-- 通用查询映射结果 -->
    <resultMap id="gdSupplyDemandAuditAttachmentResultMap" type="org.sxkj.gd.orderdata.entity.GdSupplyDemandAuditAttachmentEntity">
        <result column="id" property="id"/>
        <result column="demand_id" property="demandId"/>
        <result column="attach_id" property="attachId"/>
        <result column="area_code" property="areaCode"/>
        <result column="create_user" property="createUser"/>
        <result column="create_dept" property="createDept"/>
        <result column="create_time" property="createTime"/>
        <result column="update_user" property="updateUser"/>
        <result column="update_time" property="updateTime"/>
        <result column="status" property="status"/>
        <result column="is_deleted" property="isDeleted"/>
    </resultMap>
 
    <resultMap id="gdSupplyDemandAuditAttachmentVOResultMap" type="org.sxkj.gd.orderdata.vo.GdSupplyDemandAuditAttachmentVO" extends="gdSupplyDemandAuditAttachmentResultMap">
        <result column="file_url" property="fileUrl"/>
        <result column="file_size" property="fileSize"/>
        <result column="file_original_name" property="fileOriginalName"/>
    </resultMap>
 
 
    <select id="selectGdSupplyDemandAuditAttachmentPage" resultMap="gdSupplyDemandAuditAttachmentVOResultMap">
        select * from ja_gd_supply_demand_audit_attachment where is_deleted = 0
    </select>
 
    <insert id="insertSupplyDemandAuditAttachments">
        insert into ja_gd_supply_demand_audit_attachment (
            demand_id,
            attach_id,
            area_code,
            create_user,
            create_dept
        ) values
        <foreach collection="attachments" item="item" separator=",">
            (
                #{item.demandId},
                #{item.attachId},
                #{item.areaCode},
                #{item.createUser},
                #{item.createDept}
            )
        </foreach>
    </insert>
 
    <select id="selectSupplyDemandAuditAttachmentList" resultMap="gdSupplyDemandAuditAttachmentVOResultMap">
        select
            audit_attachment.*,
            attach.link as file_url,
            round(attach.attach_size / 1024 / 1024, 2) as file_size,
            attach.original_name as file_original_name
        from ja_gd_supply_demand_audit_attachment audit_attachment
        left join blade_attach attach on attach.id = audit_attachment.attach_id and attach.is_deleted = 0
        <where>
            audit_attachment.is_deleted = 0
            <if test="demandId != null">
                AND audit_attachment.demand_id = #{demandId}
            </if>
        </where>
    </select>
 
 
    <select id="exportGdSupplyDemandAuditAttachment" resultType="org.sxkj.gd.orderdata.excel.GdSupplyDemandAuditAttachmentExcel">
        SELECT * FROM ja_gd_supply_demand_audit_attachment ${ew.customSqlSegment}
    </select>
 
</mapper>