ContractDistributorStandardMapper.xml
5.4 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
<?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.ContractDistributorStandardMapper">
<resultMap id="ContractDistributorStandard" type="com.lframework.xingyun.sc.entity.ContractDistributorStandard">
<id column="id" property="id"/>
<result column="code" property="code"/>
<result column="supplier" property="supplier"/>
<result column="buyer" property="buyer"/>
<result column="dept_id" property="deptId"/>
<result column="order_date" property="orderDate"/>
<result column="unit" property="unit"/>
<result column="total_amount_capital" property="totalAmountCapital"/>
<result column="deposit_info" property="depositInfo"/>
<result column="packaging_requirements" property="packagingRequirements"/>
<result column="payment_terms" property="paymentTerms"/>
<result column="execution_standard" property="executionStandard"/>
<result column="execution_standard_remarks" property="executionStandardRemarks"/>
<result column="transport_mode" property="transportMode"/>
<result column="destination" property="destination"/>
<result column="includes_packaging_fee" property="includesPackagingFee"/>
<result column="includes_transport_fee" property="includesTransportFee"/>
<result column="piece_weight_head" property="pieceWeightHead"/>
<result column="surface" property="surface"/>
<result column="tolerance" property="tolerance"/>
<result column="performance" property="performance"/>
<result column="packaging" property="packaging"/>
<result column="special_terms" property="specialTerms"/>
<result column="designated_consignee" property="designatedConsignee"/>
<result column="special_instructions" property="specialInstructions"/>
<result column="remarks" property="remarks"/>
<result column="status" property="status"/>
<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"/>
<result column="total_quantity" property="totalQuantity"/>
<result column="total_amount_excluding_tax" property="totalAmountExcludingTax"/>
<result column="total_amount_including_tax" property="totalAmountIncludingTax"/>
<result column="type" property="type"/>
<result column="parent_id" property="parentId"/>
</resultMap>
<sql id="ContractDistributorStandard_sql">
SELECT
tb.id,
tb.code,
tb.supplier,
tb.buyer,
tb.dept_id,
tb.order_date,
tb.unit,
tb.total_amount_capital,
tb.deposit_info,
tb.packaging_requirements,
tb.payment_terms,
tb.execution_standard,
tb.execution_standard_remarks,
tb.transport_mode,
tb.destination,
tb.includes_packaging_fee,
tb.includes_transport_fee,
tb.piece_weight_head,
tb.surface,
tb.tolerance,
tb.performance,
tb.packaging,
tb.special_terms,
tb.designated_consignee,
tb.special_instructions,
tb.remarks,
tb.status,
tb.create_by_id,
tb.create_by,
tb.update_by_id,
tb.update_by,
tb.create_time,
tb.update_time,
tb.total_quantity,
tb.total_amount_excluding_tax,
tb.total_amount_including_tax,
tb.type,
tb.parent_id
FROM tbl_contract_distributor_standard AS tb
</sql>
<select id="query" resultMap="ContractDistributorStandard">
<include refid="ContractDistributorStandard_sql"/>
<where>
<if test="vo.code != null and vo.code != ''">
AND code like CONCAT('%', #{vo.code}, '%')
</if>
<if test="vo.buyerList != null and vo.buyerList.size() > 0">
AND tb.buyer IN
<foreach collection="vo.buyerList" open="(" separator="," close=")" item="item">
#{item}
</foreach>
</if>
<if test="vo.deptIdList != null and vo.deptIdList.size() > 0">
AND tb.dept_id IN
<foreach collection="vo.deptIdList" open="(" separator="," close=")" item="item">
#{item}
</foreach>
</if>
<if test="vo.orderDate != null">
AND tb.order_date IN (#{vo.orderDate})
</if>
<if test="vo.orderDateStart != null">
AND tb.order_date >= #{vo.orderDateStart}
</if>
<if test="vo.orderDateEnd != null">
AND tb.order_date <= #{vo.orderDateEnd}
</if>
<if test="vo.status != null">
AND tb.status LIKE CONCAT(#{vo.status}, '%')
</if>
<if test="vo.type != null">
AND tb.type = #{vo.type}
</if>
</where>
</select>
</mapper>