|
@@ -52,8 +52,8 @@
|
|
|
e.ent_id AS supplyEntId,
|
|
e.ent_id AS supplyEntId,
|
|
|
e.firm_name AS supplyFirmName,
|
|
e.firm_name AS supplyFirmName,
|
|
|
a.trading AS trading,
|
|
a.trading AS trading,
|
|
|
- a.deliveryType AS deliveryType,
|
|
|
|
|
- a.pickupType AS pickupType,
|
|
|
|
|
|
|
+ a.delivery_type AS deliveryType,
|
|
|
|
|
+ a.pickup_type AS pickupType,
|
|
|
a.source AS source,
|
|
a.source AS source,
|
|
|
f.contract_id AS contractId,
|
|
f.contract_id AS contractId,
|
|
|
f.contract_no AS contractNo,
|
|
f.contract_no AS contractNo,
|
|
@@ -77,12 +77,12 @@
|
|
|
a.create_time AS createTime,
|
|
a.create_time AS createTime,
|
|
|
b.id AS loadAddressId,
|
|
b.id AS loadAddressId,
|
|
|
b.name AS loadName,
|
|
b.name AS loadName,
|
|
|
- b.cityName AS loadCityName,
|
|
|
|
|
- b.detailAddress AS loadDetailAddress,
|
|
|
|
|
|
|
+ b.city_name AS loadCityName,
|
|
|
|
|
+ b.detail_address AS loadDetailAddress,
|
|
|
c.id AS unloadAddressId,
|
|
c.id AS unloadAddressId,
|
|
|
c.name AS unloadName,
|
|
c.name AS unloadName,
|
|
|
- c.cityName AS unloadCityName,
|
|
|
|
|
- c.detailAddress AS unloadDetailAddress
|
|
|
|
|
|
|
+ c.city_name AS unloadCityName,
|
|
|
|
|
+ c.detail_address AS unloadDetailAddress
|
|
|
</sql>
|
|
</sql>
|
|
|
|
|
|
|
|
<select id="tradeOrderSelect"
|
|
<select id="tradeOrderSelect"
|
|
@@ -188,11 +188,11 @@
|
|
|
</if>
|
|
</if>
|
|
|
)
|
|
)
|
|
|
</if>
|
|
</if>
|
|
|
- <if test="query.createStartTime != null ">
|
|
|
|
|
- and a.create_time >= #{query.createStartTime}
|
|
|
|
|
|
|
+ <if test="query.startCreateTime != null ">
|
|
|
|
|
+ and a.create_time >= #{query.startCreateTime}
|
|
|
</if>
|
|
</if>
|
|
|
- <if test="query.createEndTime != null ">
|
|
|
|
|
- and a.create_time <= #{query.createEndTime}
|
|
|
|
|
|
|
+ <if test="query.endCreateTime != null ">
|
|
|
|
|
+ and a.create_time <= #{query.endCreateTime}
|
|
|
</if>
|
|
</if>
|
|
|
<if test="query.loadAddressCode != null and query.loadAddressCode != ''">
|
|
<if test="query.loadAddressCode != null and query.loadAddressCode != ''">
|
|
|
and b.city_code LIKE CONCAT(#{query.loadAddressCode}
|
|
and b.city_code LIKE CONCAT(#{query.loadAddressCode}
|
|
@@ -235,7 +235,7 @@
|
|
|
LEFT JOIN kwo_trade_order_contract f ON a.id = f.t_order_id AND f.del_flag = 0
|
|
LEFT JOIN kwo_trade_order_contract f ON a.id = f.t_order_id AND f.del_flag = 0
|
|
|
<where>
|
|
<where>
|
|
|
a.del_flag = 0
|
|
a.del_flag = 0
|
|
|
- --数据权限匹配
|
|
|
|
|
|
|
+-- 数据权限匹配
|
|
|
<if test="query.isMain == 0">
|
|
<if test="query.isMain == 0">
|
|
|
and ((
|
|
and ((
|
|
|
<if test="query.entId != null">
|
|
<if test="query.entId != null">
|
|
@@ -290,22 +290,22 @@
|
|
|
</if>)
|
|
</if>)
|
|
|
)
|
|
)
|
|
|
</if>
|
|
</if>
|
|
|
- --状态匹配
|
|
|
|
|
|
|
+-- 状态匹配
|
|
|
<if test="query.status != null">
|
|
<if test="query.status != null">
|
|
|
and a.status =#{query.status}
|
|
and a.status =#{query.status}
|
|
|
<if test="query.status == 0">
|
|
<if test="query.status == 0">
|
|
|
- --草稿状态只能创建订单的人能看
|
|
|
|
|
|
|
+-- 草稿状态只能创建订单的人能看
|
|
|
and a.create_by = #{query.userId}
|
|
and a.create_by = #{query.userId}
|
|
|
</if>
|
|
</if>
|
|
|
</if>
|
|
</if>
|
|
|
<if test="query.status == null">
|
|
<if test="query.status == null">
|
|
|
- -- 非草稿状态or草稿状态且是当前人
|
|
|
|
|
|
|
+-- 非草稿状态or草稿状态且是当前人
|
|
|
and (
|
|
and (
|
|
|
a.status != 0
|
|
a.status != 0
|
|
|
or (a.status = 0 and a.create_by = #{query.userId})
|
|
or (a.status = 0 and a.create_by = #{query.userId})
|
|
|
)
|
|
)
|
|
|
</if>
|
|
</if>
|
|
|
- --关键词匹配
|
|
|
|
|
|
|
+-- 关键词匹配
|
|
|
<if test="query.keywords != null and query.keywords != ''">
|
|
<if test="query.keywords != null and query.keywords != ''">
|
|
|
and (
|
|
and (
|
|
|
a.t_order_no like concat('%', #{query.keywords}, '%')
|
|
a.t_order_no like concat('%', #{query.keywords}, '%')
|
|
@@ -320,11 +320,11 @@
|
|
|
</if>
|
|
</if>
|
|
|
)
|
|
)
|
|
|
</if>
|
|
</if>
|
|
|
- <if test="query.createStartTime != null ">
|
|
|
|
|
- and a.create_time >= #{query.createStartTime}
|
|
|
|
|
|
|
+ <if test="query.startCreateTime != null ">
|
|
|
|
|
+ and a.create_time >= #{query.startCreateTime}
|
|
|
</if>
|
|
</if>
|
|
|
- <if test="query.createEndTime != null ">
|
|
|
|
|
- and a.create_time <= #{query.createEndTime}
|
|
|
|
|
|
|
+ <if test="query.endCreateTime != null ">
|
|
|
|
|
+ and a.create_time <= #{query.endCreateTime}
|
|
|
</if>
|
|
</if>
|
|
|
<if test="query.loadAddressCode != null and query.loadAddressCode != ''">
|
|
<if test="query.loadAddressCode != null and query.loadAddressCode != ''">
|
|
|
and b.city_code LIKE CONCAT(#{query.loadAddressCode}
|
|
and b.city_code LIKE CONCAT(#{query.loadAddressCode}
|
|
@@ -473,7 +473,7 @@
|
|
|
LEFT JOIN kwo_trade_order_goods g ON a.id = g.t_order_id AND g.del_flag = 0
|
|
LEFT JOIN kwo_trade_order_goods g ON a.id = g.t_order_id AND g.del_flag = 0
|
|
|
<where>
|
|
<where>
|
|
|
a.del_flag = 0
|
|
a.del_flag = 0
|
|
|
- --数据权限匹配
|
|
|
|
|
|
|
+-- 数据权限匹配
|
|
|
<if test="query.isMain == 0">
|
|
<if test="query.isMain == 0">
|
|
|
and ((
|
|
and ((
|
|
|
<if test="query.entId != null">
|
|
<if test="query.entId != null">
|
|
@@ -528,22 +528,22 @@
|
|
|
</if>)
|
|
</if>)
|
|
|
)
|
|
)
|
|
|
</if>
|
|
</if>
|
|
|
- --状态匹配
|
|
|
|
|
|
|
+-- 状态匹配
|
|
|
<if test="query.status != null">
|
|
<if test="query.status != null">
|
|
|
and a.status =#{query.status}
|
|
and a.status =#{query.status}
|
|
|
<if test="query.status == 0">
|
|
<if test="query.status == 0">
|
|
|
- --草稿状态只能创建订单的人能看
|
|
|
|
|
|
|
+-- 草稿状态只能创建订单的人能看
|
|
|
and a.create_by = #{query.userId}
|
|
and a.create_by = #{query.userId}
|
|
|
</if>
|
|
</if>
|
|
|
</if>
|
|
</if>
|
|
|
<if test="query.status == null">
|
|
<if test="query.status == null">
|
|
|
- --非草稿状态or草稿状态且是当前人
|
|
|
|
|
|
|
+-- 非草稿状态or草稿状态且是当前人
|
|
|
and (
|
|
and (
|
|
|
a.status != 0
|
|
a.status != 0
|
|
|
or (a.status = 0 and a.create_by = #{query.userId})
|
|
or (a.status = 0 and a.create_by = #{query.userId})
|
|
|
)
|
|
)
|
|
|
</if>
|
|
</if>
|
|
|
- -- 关键词匹配
|
|
|
|
|
|
|
+-- 关键词匹配
|
|
|
<if test="query.keywords != null and query.keywords != ''">
|
|
<if test="query.keywords != null and query.keywords != ''">
|
|
|
and (
|
|
and (
|
|
|
a.t_order_no like concat('%', #{query.keywords}, '%')
|
|
a.t_order_no like concat('%', #{query.keywords}, '%')
|
|
@@ -557,11 +557,11 @@
|
|
|
</if>
|
|
</if>
|
|
|
)
|
|
)
|
|
|
</if>
|
|
</if>
|
|
|
- <if test="query.createStartTime != null ">
|
|
|
|
|
- and a.create_time >= #{query.createStartTime}
|
|
|
|
|
|
|
+ <if test="query.startCreateTime != null ">
|
|
|
|
|
+ and a.create_time >= #{query.startCreateTime}
|
|
|
</if>
|
|
</if>
|
|
|
- <if test="query.createEndTime != null ">
|
|
|
|
|
- and a.create_time <= #{query.createEndTime}
|
|
|
|
|
|
|
+ <if test="query.endCreateTime != null ">
|
|
|
|
|
+ and a.create_time <= #{query.endCreateTime}
|
|
|
</if>
|
|
</if>
|
|
|
<if test="query.loadAddressCode != null and query.loadAddressCode != ''">
|
|
<if test="query.loadAddressCode != null and query.loadAddressCode != ''">
|
|
|
and b.city_code LIKE CONCAT(#{query.loadAddressCode}
|
|
and b.city_code LIKE CONCAT(#{query.loadAddressCode}
|
|
@@ -596,7 +596,7 @@
|
|
|
AND e.unit_type = "2" AND e.del_flag = 0
|
|
AND e.unit_type = "2" AND e.del_flag = 0
|
|
|
<where>
|
|
<where>
|
|
|
a.del_flag = 0
|
|
a.del_flag = 0
|
|
|
- --数据权限匹配
|
|
|
|
|
|
|
+-- 数据权限匹配
|
|
|
<if test="query.isMain == 0">
|
|
<if test="query.isMain == 0">
|
|
|
and ((
|
|
and ((
|
|
|
<if test="query.entId != null">
|
|
<if test="query.entId != null">
|
|
@@ -661,7 +661,7 @@
|
|
|
and e.top_ent_id = #{query.entId}
|
|
and e.top_ent_id = #{query.entId}
|
|
|
</if>
|
|
</if>
|
|
|
</if>
|
|
</if>
|
|
|
- --状态匹配
|
|
|
|
|
|
|
+-- 状态匹配
|
|
|
<if test="statuses != null and statuses.size() > 0">
|
|
<if test="statuses != null and statuses.size() > 0">
|
|
|
and a.status in
|
|
and a.status in
|
|
|
<foreach collection="statuses" item="item" open="(" close=")" separator=",">
|
|
<foreach collection="statuses" item="item" open="(" close=")" separator=",">
|