SupplierQuotationProjectQuoteMapper.xml
2.74 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
61
62
63
64
65
66
<?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.quotation.SupplierQuotationProjectQuoteMapper">
<resultMap id="SupplierQuotationProjectQuote" type="com.lframework.xingyun.sc.procurement.entity.SupplierQuotationProjectQuote">
<id column="id" property="id"/>
<result column="project_id" property="projectId"/>
<result column="supplier_id" property="supplierId"/>
<result column="supplier_name" property="supplierName"/>
<result column="quote_time" property="quoteTime"/>
<result column="product_id" property="productId"/>
<result column="product_name" property="productName"/>
<result column="product_code" property="productCode"/>
<result column="quantity" property="quantity"/>
<result column="price" property="price"/>
<result column="bid_status" property="bidStatus"/>
<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="SupplierQuotationProjectQuoteSql">
SELECT
tb.id,
tb.project_id,
tb.supplier_id,
tb.supplier_name,
tb.quote_time,
tb.product_id,
br.product_name,
br.code AS product_code,
tb.quantity,
tb.price,
tb.bid_status,
tb.create_by_id,
tb.create_by,
tb.update_by_id,
tb.update_by,
tb.create_time,
tb.update_time
FROM procurement_supplier_quotation_project_quote tb
LEFT JOIN base_data_breed_relationship br ON br.id = tb.product_id
</sql>
<select id="findByProjectAndSupplier" resultMap="SupplierQuotationProjectQuote">
<include refid="SupplierQuotationProjectQuoteSql"/>
WHERE tb.project_id = #{projectId}
AND tb.supplier_id = #{supplierId}
</select>
<select id="listByProject" resultMap="SupplierQuotationProjectQuote">
<include refid="SupplierQuotationProjectQuoteSql"/>
WHERE tb.project_id = #{projectId}
<choose>
<when test="orderBy == 'PRICE_ASC'">
ORDER BY tb.price ASC, tb.quote_time DESC, tb.id DESC
</when>
<otherwise>
ORDER BY tb.create_time DESC, tb.id DESC
</otherwise>
</choose>
</select>
</mapper>