使用oracle做的数据上传系统后台
kongdeqiang
2026-03-23 bdeb03a42dace46b1211bf12f3ad66837814035d
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
<?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.example.mapper.DataExcelMapper">
 
    <resultMap id="dataExcelResultMap" type="com.example.entity.DataExcel">
        <id column="id" property="id"/>
        <result column="seq_no" property="seqNo"/>
        <result column="sort_no" property="sortNo"/>
        <result column="secondary_unit" property="secondaryUnit"/>
        <result column="unit_code" property="unitCode"/>
        <result column="unit_name" property="unitName"/>
        <result column="transaction_no" property="transactionNo"/>
        <result column="summary" property="summary"/>
        <result column="amount" property="amount"/>
        <result column="accounting_period" property="accountingPeriod"/>
        <result column="voucher_no" property="voucherNo"/>
        <result column="bp_contract_no" property="bpContractNo"/>
        <result column="contract_center_no" property="contractCenterNo"/>
        <result column="bp_invoice_no" property="bpInvoiceNo"/>
        <result column="gk_invoice_no" property="gkInvoiceNo"/>
        <result column="business_relation" property="businessRelation"/>
        <result column="remark" property="remark"/>
        <result column="status" property="status"/>
        <result column="create_time" property="createTime"/>
        <result column="update_time" property="updateTime"/>
        <result column="create_by" property="createBy"/>
        <result column="update_by" property="updateBy"/>
        <result column="deleted" property="deleted"/>
        <result column="version" property="version"/>
    </resultMap>
 
    <select id="selectDataExcelPage" resultMap="dataExcelResultMap">
        SELECT *
        FROM data_excel
        WHERE deleted = 0
        <if test="unitName != null and unitName != ''">
            AND unit_name LIKE '%' || #{unitName} || '%'
        </if>
        <if test="transactionNo != null and transactionNo != ''">
            AND transaction_no LIKE '%' || #{transactionNo} || '%'
        </if>
        <if test="accountingPeriod != null and accountingPeriod != ''">
            AND accounting_period = #{accountingPeriod}
        </if>
        <if test="permissionDeptCodes != null and permissionDeptCodes.size() > 0">
            AND unit_code IN
            <foreach collection="permissionDeptCodes" item="deptCode" open="(" separator="," close=")">
                #{deptCode}
            </foreach>
        </if>
        ORDER BY id DESC
    </select>
 
    <select id="selectBySortNo" resultMap="dataExcelResultMap">
        SELECT *
        FROM data_excel
        WHERE deleted = 0 AND sort_no = #{sortNo}
    </select>
 
    <insert id="insert" parameterType="com.example.entity.DataExcel" useGeneratedKeys="false">
        <selectKey keyProperty="id" resultType="java.lang.Long" order="BEFORE">
            SELECT seq_data_excel.NEXTVAL FROM DUAL
        </selectKey>
        INSERT INTO data_excel (
            id,
            <if test="seqNo != null">seq_no,</if>
            <if test="sortNo != null">sort_no,</if>
            <if test="secondaryUnit != null and secondaryUnit != ''">secondary_unit,</if>
            <if test="unitCode != null and unitCode != ''">unit_code,</if>
            <if test="unitName != null and unitName != ''">unit_name,</if>
            <if test="transactionNo != null and transactionNo != ''">transaction_no,</if>
            <if test="summary != null and summary != ''">summary,</if>
            <if test="amount != null">amount,</if>
            <if test="accountingPeriod != null and accountingPeriod != ''">accounting_period,</if>
            <if test="voucherNo != null and voucherNo != ''">voucher_no,</if>
            <if test="bpContractNo != null and bpContractNo != ''">bp_contract_no,</if>
            <if test="contractCenterNo != null and contractCenterNo != ''">contract_center_no,</if>
            <if test="bpInvoiceNo != null and bpInvoiceNo != ''">bp_invoice_no,</if>
            <if test="gkInvoiceNo != null and gkInvoiceNo != ''">gk_invoice_no,</if>
            <if test="businessRelation != null and businessRelation != ''">business_relation,</if>
            <if test="remark != null and remark != ''">remark,</if>
            <if test="status != null">status,</if>
            create_time,
            update_time,
            create_by,
            update_by,
            deleted,
            version
        ) VALUES (
            #{id},
            <if test="seqNo != null">#{seqNo},</if>
            <if test="sortNo != null">#{sortNo},</if>
            <if test="secondaryUnit != null and secondaryUnit != ''">#{secondaryUnit},</if>
            <if test="unitCode != null and unitCode != ''">#{unitCode},</if>
            <if test="unitName != null and unitName != ''">#{unitName},</if>
            <if test="transactionNo != null and transactionNo != ''">#{transactionNo},</if>
            <if test="summary != null and summary != ''">#{summary},</if>
            <if test="amount != null">#{amount},</if>
            <if test="accountingPeriod != null and accountingPeriod != ''">#{accountingPeriod},</if>
            <if test="voucherNo != null and voucherNo != ''">#{voucherNo},</if>
            <if test="bpContractNo != null and bpContractNo != ''">#{bpContractNo},</if>
            <if test="contractCenterNo != null and contractCenterNo != ''">#{contractCenterNo},</if>
            <if test="bpInvoiceNo != null and bpInvoiceNo != ''">#{bpInvoiceNo},</if>
            <if test="gkInvoiceNo != null and gkInvoiceNo != ''">#{gkInvoiceNo},</if>
            <if test="businessRelation != null and businessRelation != ''">#{businessRelation},</if>
            <if test="remark != null and remark != ''">#{remark},</if>
            <if test="status != null">#{status},</if>
            SYSDATE,
            SYSDATE,
            #{createBy},
            #{updateBy},
            0,
            1
        )
    </insert>
</mapper>