PurchaseOrderInfoMapper.xml
5.59 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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
<?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.mappers.PurchaseOrderInfoMapper">
<resultMap id="PurchaseOrderInfo" type="com.lframework.xingyun.sc.entity.PurchaseOrderInfo">
<id column="id" property="id"/>
<result column="order_no" property="orderNo"/>
<result column="supply_unit" property="supplyUnit"/>
<result column="ordering_unit" property="orderingUnit"/>
<result column="ordering_unit_name" property="orderingUnitName"/>
<result column="order_date" property="orderDate"/>
<result column="settlement_terms" property="settlementTerms"/>
<result column="delivery_method" property="deliveryMethod"/>
<result column="price_list_no" property="priceListNo"/>
<result column="execution_standard" property="executionStandard"/>
<result column="invoicing_status" property="invoicingStatus"/>
<result column="shipping_cost" property="shippingCost"/>
<result column="piece_weight_header" property="pieceWeightHeader"/>
<result column="surface" property="surface"/>
<result column="tolerance" property="tolerance"/>
<result column="performance" property="performance"/>
<result column="element" property="element"/>
<result column="packaging" property="packaging"/>
<result column="remarks" property="remarks"/>
<result column="status" property="status"/>
<result column="examine_status" property="examineStatus"/>
<result column="revoke_status" property="revokeStatus"/>
<result column="production_process" property="productionProcess"/>
<result column="dept_id" property="deptId"/>
<result column="dept_name" property="deptName"/>
<result column="workshop_id" property="workshopId"/>
<result column="workshop_name" property="workshopName"/>
<result column="customer_credit_id" property="customerCreditId"/>
<result column="customer_tier" property="customerTier"/>
<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="PurchaseOrderInfo_sql">
SELECT
tb.id,
tb.order_no,
tb.supply_unit,
tb.ordering_unit,
cu.name AS ordering_unit_name,
tb.order_date,
tb.settlement_terms,
tb.delivery_method,
tb.price_list_no,
tb.execution_standard,
tb.invoicing_status,
tb.shipping_cost,
tb.piece_weight_header,
tb.surface,
tb.tolerance,
tb.performance,
tb.element,
tb.packaging,
tb.remarks,
tb.status,
tb.examine_status,
tb.revoke_status,
tb.production_process,
tb.dept_id,
sd.name AS dept_name,
tb.workshop_id,
ws.name AS workshop_name,
tb.customer_credit_id,
cc.company_suggested_category AS customer_tier,
tb.create_by_id,
tb.create_by,
tb.update_by_id,
tb.update_by,
tb.create_time,
tb.update_time
FROM purchase_order_info AS tb
left join base_data_customer as cu on cu.id = tb.ordering_unit
left join sys_dept as sd on sd.id = tb.dept_id
left join base_data_workshop as ws on ws.id = tb.workshop_id
left join customer_credit as cc on cc.id = tb.customer_credit_id
</sql>
<select id="query" resultMap="PurchaseOrderInfo">
<include refid="PurchaseOrderInfo_sql"/>
<where>
<if test="vo.orderNo != null and vo.orderNo != ''">
AND tb.order_no = #{vo.orderNo}
</if>
<if test="vo.orderingUnitName != null and vo.orderingUnitName != ''">
AND cu.name LIKE CONCAT('%', #{vo.orderingUnitName},'%')
</if>
<if test="vo.orderDateStart != null">
AND tb.order_date >= #{vo.orderDateStart}
</if>
<if test="vo.orderDateEnd != null">
<![CDATA[
AND tb.order_date <= #{vo.orderDateEnd}
]]>
</if>
<if test="vo.status != null and vo.status != ''">
AND tb.status = #{vo.status}
</if>
<if test="vo.examineStatus != null and vo.examineStatus != ''">
AND tb.examine_status = #{vo.examineStatus}
</if>
<if test="vo.revokeStatus != null and vo.revokeStatus != ''">
AND tb.revoke_status = #{vo.revokeStatus}
</if>
<if test="vo.deptId != null and vo.deptId != ''">
AND tb.dept_id = #{vo.deptId}
</if>
<if test="vo.workshopId != null and vo.workshopId != ''">
AND tb.workshop_id = #{vo.workshopId}
</if>
</where>
ORDER BY tb.update_time DESC
</select>
<select id="findById" resultType="com.lframework.xingyun.sc.entity.PurchaseOrderInfo">
<include refid="PurchaseOrderInfo_sql"/>
<where>
<if test="id != null and id != ''">
AND tb.id = #{id}
</if>
</where>
</select>
</mapper>