zm
2020-05-18 a18bfacbf56b401f6e0fdae8710fbca4df8cff77
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
<?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.changhong.epc.form.mapper.tenant.contract.FormContractMapper">
    
    <resultMap type="com.changhong.epc.bean.form.contract.FormContractExtend" id="contractResult">
    
    </resultMap>
    
    <sql id="contractFields">
        e.id,
        e.number,
        e. NAME,
        e. NAME,
        e.org,
        e.project,
        e.supplier,
        e.customer,
        e.signing_date,
        e.currency,
        e.tax_amount,
        e.rate,
        e.not_tax_amount
    </sql>
    
    <select id="selectAllContract" resultType="com.changhong.epc.bean.form.contract.FormContract">
        SELECT
            <include refid="contractFields"></include>
        FROM
            epc_form_contract_{rule} e
        ORDER BY
            e.id DESC
    </select>
    
    
    <select id="selectById" resultMap="contractResult">
        SELECT epc_form_contract.*,
        epc_form_contract_phase_{rule} .*
        FROM 
        epc_form_contract_{rule}
        JOIN 
        epc_form_contract_phase_{rule}
        ON 
        epc_form_contract.id=epc_form_contract_phase_{rule} .contract_id
    </select>
    
     
    
    <insert id="formContractSave" useGeneratedKeys="true" keyProperty="cont.id">
        insert into EPC_FORM_CONTRACT
        (id,number,`name`,org,project,supplier,customer,signing_date,currency,tax_amount,rate,not_tax_amount)
        VALUES
        (null,#{cont.number},#{cont.name},#{cont.org},#{cont.project},#{cont.supplier},#{cont.customer},#{cont.signingDate},#{cont.currency},#{cont.taxAmount},#{cont.rate},#{cont.notTaxAmount})
    </insert>
    
    
</mapper>