|
@@ -65,6 +65,7 @@
|
|
|
<id column="xt_user_id" property="xtUserId"/>
|
|
|
<id column="xt_eid" property="xtEid"/>
|
|
|
<id column="customer_user_id" property="customerUserId"/>
|
|
|
+ <id column="cert_no" property="certNo"/>
|
|
|
</resultMap>
|
|
|
<sql id="Base_Column_List">
|
|
|
amount_total
|
|
@@ -144,12 +145,12 @@
|
|
|
left join vendor_entity v on v.entity_no = t.entity_no
|
|
|
left join trading_platform p on t.agency_cert_no = p.cert_no
|
|
|
left join sales_order s on t.sales_order_id = s.id
|
|
|
- left join purchase_contract pc on t.purchase_contract_no = pc.contract_no
|
|
|
+ left join purchase_contract pc on (t.purchase_contract_no = pc.contract_no and pc.customer_user_id = t.customer_user_id)
|
|
|
where t.id = #{id}
|
|
|
</select>
|
|
|
|
|
|
<select id="selectCustTaxNum" resultMap="VoInvoiceResultMap">
|
|
|
- SELECT e.tax_no as tax_num, p.xt_user_id, p.xt_eid, t.customer_user_id, t.id, t.order_no, t.amount_total
|
|
|
+ SELECT e.tax_no as tax_num, e.cert_no, p.xt_user_id, p.xt_eid, t.customer_user_id, t.id, t.order_no, t.amount_total
|
|
|
FROM purchase_order t
|
|
|
left join enterprise e on t.customer_user_id = e.customer_id
|
|
|
left join trading_platform p on t.agency_cert_no = p.cert_no
|
|
@@ -167,9 +168,11 @@
|
|
|
</select>
|
|
|
|
|
|
<select id="selectClientTaxNum" resultMap="VoInvoiceResultMap">
|
|
|
- SELECT e.tax_no as tax_num, c.xt_uid as xt_user_id, e.xt_eid, t.customer_user_id, t.id, t.order_no, t.amount_total
|
|
|
+ SELECT v.vat_no as tax_num, v.cert_no, c.xt_uid as xt_user_id, e.xt_eid, t.customer_user_id, t.id, t.order_no, t.amount_total
|
|
|
FROM purchase_order t
|
|
|
left join enterprise e on t.customer_user_id = e.customer_id
|
|
|
+ left join purchase_contract pc on (t.purchase_contract_no = pc.contract_no and pc.customer_user_id = t.customer_user_id)
|
|
|
+ left join vendor_entity v on v.entity_no = pc.vendor_entity_no
|
|
|
left join customer_user c on t.customer_user_id = c.id
|
|
|
WHERE (t.agency_cert_no is null or t.agency_cert_no = '')
|
|
|
AND t.deleted = 0
|