ProcurementContractLineMapper.xml
2.54 KB
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
<?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.lframework.xingyun.sc.procurement.mappers.contract.ProcurementContractLineMapper">
<resultMap id="ProcurementContractLineResult" type="com.lframework.xingyun.sc.procurement.entity.contract.ProcurementContractLine">
<id column="id" property="id"/>
<result column="contract_id" property="contractId"/>
<result column="plan_line_id" property="planLineId"/>
<result column="invoice_product_name" property="invoiceProductName"/>
<result column="product_id" property="productId"/>
<result column="product_name" property="productName"/>
<result column="quantity" property="quantity"/>
<result column="unit_price" property="unitPrice"/>
<result column="excluding_tax_amount" property="excludingTaxAmount"/>
<result column="tax_amount" property="taxAmount"/>
<result column="total_amount" property="totalAmount"/>
<result column="delivery_time" property="deliveryTime"/>
<result column="item_id" property="itemId"/>
<result column="create_by_id" property="createById"/>
<result column="create_by" property="createBy"/>
<result column="update_by_id" property="updateById"/>
<result column="update_by" property="updateBy"/>
<result column="create_time" property="createTime"/>
<result column="update_time" property="updateTime"/>
</resultMap>
<sql id="PCL_sql">
SELECT
pcl.id,
pcl.contract_id,
pcl.plan_line_id,
pcl.invoice_product_name,
pcl.product_id,
bbr.product_name,
pcl.quantity,
pcl.unit_price,
pcl.excluding_tax_amount,
pcl.tax_amount,
pcl.total_amount,
pcl.delivery_time,
pcl.item_id,
pcl.create_by_id,
pcl.create_by,
pcl.update_by_id,
pcl.update_by,
pcl.create_time,
pcl.update_time
FROM procurement_contract_line AS pcl
LEFT JOIN base_data_breed_relationship bbr ON bbr.id = pcl.product_id
</sql>
<select id="getByContractId" resultMap="ProcurementContractLineResult">
<include refid="PCL_sql"/>
WHERE pcl.contract_id = #{contractId}
</select>
<delete id="deleteByContractId">
DELETE FROM procurement_contract_line WHERE contract_id = #{contractId}
</delete>
</mapper>