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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
<?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.bill.BillInfoMapper">
    
    <resultMap id="billInfoMapperResultMap" type="com.changhong.epc.bean.parsing.BillInfo">
        <result property="orderCode" column="order_code"/>
        <result property="formId" column="form_id"/><!-- 表单Id -->
        <result property="formDataId" column="form_data_id"/><!-- 表单数据Id -->
        <result property="info" column="info"/><!-- 原始数据 -->
        <result property="infoLast" column="info_last"/><!-- 转换后数据 -->
        <result property="verify" column="verify"/><!-- 主数据是否缺失 2:不缺失 1:缺失 -->
        <result property="msg" column="msg"/>
        <result property="info" column="info"/>
        <result property="infoLast" column="info_last"/>
    </resultMap>
    
    <select id="selectBillByOrderCode" resultType="java.lang.Integer">
    select count(1) from epc_bill_info_{rule}
        WHERE
            order_code = #{orderCode}
    </select>
    
    <update id="updateBill"  >
        UPDATE epc_bill_info_{rule}
        SET form_id = #{formId},
         form_data_id = #{formDataId}
        WHERE
            order_code = #{orderCode}
    </update>
    
    
    <!-- <insert id="addBill" parameterType="com.changhong.epc.bean.parsing.BillInfo">
            INSERT INTO
                 epc_bill_info_{rule}
                     (
                     data_start
                     ,order_code
                     ,info
                     ,info_last
                     )
            VALUES        (
                        #{dataStart}
                        ,#{orderCode}
                        ,#{info}
                        ,#{infoLast}
                        ) 
    </insert> -->
    
    <select id="queryBillInfoByForm" resultType="com.changhong.epc.bean.parsing.BillInfo">
        SELECT
            `info`,
            `info_last` infoLast
        FROM
            `epc_bill_info_{rule}`
        WHERE
            `data_start` != 99
        AND `order_code`    = #{orgerCode}
        AND `form_id`       = #{formId}
        AND `form_data_id`  = #{dataRowNum}
    </select>
 
    <update id="updateJourney" >
 
        UPDATE epc_bill_data_{rule}
        SET j_id = #{reJid}
        WHERE
            order_code = #{orderCode}
            and
            j_id = #{jId}
 
    </update>
</mapper>