|
|
@@ -1267,26 +1267,7 @@
|
|
|
e.top_ent_id AS carrierTopEntId,
|
|
|
e.contacts AS carrierContacts,
|
|
|
e.phone AS carrierPhone,
|
|
|
- b.`name` AS loadName,
|
|
|
- b.address_type AS loadType,
|
|
|
- b.city_name AS loadCityName,
|
|
|
- b.city_code AS loadCityCode,
|
|
|
- b.detail_address AS loadAddress,
|
|
|
- b.contacts AS shipmentsContacts,
|
|
|
- b.phone AS shipmentsPhone,
|
|
|
- b.lat AS loadLat,
|
|
|
- b.lng AS loadLng,
|
|
|
- c.`name` AS unloadName,
|
|
|
- c.address_type AS unloadType,
|
|
|
- c.contacts AS receiveGoodsContacts,
|
|
|
- c.phone AS receiveGoodsPhone,
|
|
|
- c.city_name AS unloadCityName,
|
|
|
- c.city_code AS unloadCityCode,
|
|
|
- c.detail_address AS unloadAddress,
|
|
|
- c.lat AS unloadLat,
|
|
|
- c.lng AS unloadLng,
|
|
|
- f.contract_name as contract
|
|
|
- ,
|
|
|
+ f.contract_name as contract,
|
|
|
a.del_flag as delFlag,
|
|
|
case when a.ent_id = e.top_ent_id then 1 ELSE 2 end as createType
|
|
|
</sql>
|
|
|
@@ -1346,26 +1327,7 @@
|
|
|
e.top_ent_id AS carrierTopEntId,
|
|
|
e.contacts AS carrierContacts,
|
|
|
e.phone AS carrierPhone,
|
|
|
-<!-- b.`name` AS loadName,-->
|
|
|
-<!-- b.address_type AS loadType,-->
|
|
|
-<!-- b.city_name AS loadCityName,-->
|
|
|
-<!-- b.city_code AS loadCityCode,-->
|
|
|
-<!-- b.detail_address AS loadAddress,-->
|
|
|
-<!-- b.contacts AS shipmentsContacts,-->
|
|
|
-<!-- b.phone AS shipmentsPhone,-->
|
|
|
-<!-- b.lat AS loadLat,-->
|
|
|
-<!-- b.lng AS loadLng,-->
|
|
|
-<!-- c.`name` AS unloadName,-->
|
|
|
-<!-- c.address_type AS unloadType,-->
|
|
|
-<!-- c.contacts AS receiveGoodsContacts,-->
|
|
|
-<!-- c.phone AS receiveGoodsPhone,-->
|
|
|
-<!-- c.city_name AS unloadCityName,-->
|
|
|
-<!-- c.city_code AS unloadCityCode,-->
|
|
|
-<!-- c.detail_address AS unloadAddress,-->
|
|
|
-<!-- c.lat AS unloadLat,-->
|
|
|
-<!-- c.lng AS unloadLng,-->
|
|
|
- f.contract_name as contract
|
|
|
- ,
|
|
|
+ f.contract_name as contract,
|
|
|
a.del_flag as delFlag,
|
|
|
case when a.ent_id = e.top_ent_id then 1 ELSE 2 end as createType
|
|
|
</sql>
|
|
|
@@ -1425,26 +1387,7 @@
|
|
|
e.top_ent_id AS carrierTopEntId,
|
|
|
e.contacts AS carrierContacts,
|
|
|
e.phone AS carrierPhone,
|
|
|
- b.`name` AS loadName,
|
|
|
- b.address_type AS loadType,
|
|
|
- b.city_name AS loadCityName,
|
|
|
- b.city_code AS loadCityCode,
|
|
|
- b.detail_address AS loadAddress,
|
|
|
- b.contacts AS shipmentsContacts,
|
|
|
- b.phone AS shipmentsPhone,
|
|
|
- b.lat AS loadLat,
|
|
|
- b.lng AS loadLng,
|
|
|
- c.`name` AS unloadName,
|
|
|
- c.address_type AS unloadType,
|
|
|
- c.contacts AS receiveGoodsContacts,
|
|
|
- c.phone AS receiveGoodsPhone,
|
|
|
- c.city_name AS unloadCityName,
|
|
|
- c.city_code AS unloadCityCode,
|
|
|
- c.detail_address AS unloadAddress,
|
|
|
- c.lat AS unloadLat,
|
|
|
- c.lng AS unloadLng,
|
|
|
- f.contract_name as contract
|
|
|
- ,
|
|
|
+ f.contract_name as contract,
|
|
|
a.del_flag as delFlag,
|
|
|
case when a.ent_id = d.top_ent_id then 1 ELSE 2 end as createType
|
|
|
</sql>
|
|
|
@@ -2361,8 +2304,7 @@
|
|
|
) t1
|
|
|
</select>
|
|
|
|
|
|
- <select id="workbenchLogisticsOrderStatisticsByMonth"
|
|
|
- resultType="com.sckw.transport.model.vo.LogisticsOrderStatisticsVO">
|
|
|
+ <select id="workbenchLogisticsOrderStatisticsByMonth" resultType="com.sckw.transport.model.vo.LogisticsOrderStatisticsVO">
|
|
|
SELECT A.date_time as dateTime,
|
|
|
COALESCE(B.num, 0) as num,
|
|
|
IFNULL(B.typeOne, 0) AS typeOne,
|
|
|
@@ -2414,8 +2356,7 @@
|
|
|
ON A.date_time = B.date_time
|
|
|
</select>
|
|
|
|
|
|
- <select id="workbenchLogisticsOrderStatisticsByDays"
|
|
|
- resultType="com.sckw.transport.model.vo.LogisticsOrderStatisticsVO">
|
|
|
+ <select id="workbenchLogisticsOrderStatisticsByDays" resultType="com.sckw.transport.model.vo.LogisticsOrderStatisticsVO">
|
|
|
SELECT A.date as dateTime,
|
|
|
COALESCE(B.num, 0) as num,
|
|
|
IFNULL(B.typeOne, 0) AS typeOne,
|
|
|
@@ -2466,83 +2407,79 @@
|
|
|
) B
|
|
|
ON A.date = B.date_time;
|
|
|
</select>
|
|
|
- <select id="selectLogisticsOrderListByAcceptCarriage"
|
|
|
- resultType="com.sckw.transport.model.vo.AcceptCarriageOrderVO">
|
|
|
+
|
|
|
+ <select id="selectLogisticsOrderListByAcceptCarriage" resultType="com.sckw.transport.model.vo.AcceptCarriageOrderVO">
|
|
|
SELECT
|
|
|
-<!-- <include refid="New_Query_Column_List">-->
|
|
|
-<!-- </include>-->
|
|
|
<include refid="New_Query_Column_List_v42">
|
|
|
</include>
|
|
|
FROM (
|
|
|
- SELECT
|
|
|
-<!-- <include refid="Query_Column_List_Accept_Carriage">-->
|
|
|
-<!-- </include>-->
|
|
|
- <include refid="Query_Column_List_Accept_Carriage_v42">
|
|
|
- </include>
|
|
|
- FROM kwt_logistics_order a
|
|
|
- LEFT JOIN kwt_logistics_order_address b ON a.id = b.l_order_id
|
|
|
- AND b.address_type = 1 AND b.del_flag = 0
|
|
|
- LEFT JOIN kwt_logistics_order_address c ON a.id = c.l_order_id
|
|
|
- AND c.address_type = 2 AND c.del_flag = 0
|
|
|
- LEFT JOIN kwt_logistics_order_unit d ON a.id = d.l_order_id
|
|
|
- AND d.unit_type = 1 AND d.del_flag = 0
|
|
|
- LEFT JOIN kwt_logistics_order_unit e ON a.id = e.l_order_id
|
|
|
- AND e.unit_type = 2
|
|
|
- LEFT JOIN kwt_logistics_order_goods g ON a.id = g.l_order_id AND g.del_flag = 0
|
|
|
- LEFT JOIN kwt_logistics_order_contract f ON a.id = f.l_order_id AND f.del_flag = 0
|
|
|
- <where>
|
|
|
- a.del_flag = 0 and f.del_flag = 0
|
|
|
- <if test="query.keywords != null and query.keywords != ''">
|
|
|
- and (
|
|
|
+ SELECT
|
|
|
+ <include refid="Query_Column_List_Accept_Carriage_v42">
|
|
|
+ </include>
|
|
|
+ FROM kwt_logistics_order a
|
|
|
+ LEFT JOIN kwt_logistics_order_unit d ON a.id = d.l_order_id AND d.unit_type = 1 AND d.del_flag = 0
|
|
|
+ LEFT JOIN kwt_logistics_order_unit e ON a.id = e.l_order_id AND e.unit_type = 2
|
|
|
+ LEFT JOIN kwt_logistics_order_goods g ON a.id = g.l_order_id AND g.del_flag = 0
|
|
|
+ LEFT JOIN kwt_logistics_order_contract f ON a.id = f.l_order_id AND f.del_flag = 0
|
|
|
+ <where>
|
|
|
+ a.del_flag = 0 and f.del_flag = 0
|
|
|
+ <if test="query.keywords != null and query.keywords != ''">
|
|
|
+ and (
|
|
|
a.t_order_no like concat('%', #{query.keywords}, '%')
|
|
|
- or a.l_order_no like concat('%', #{query.keywords}, '%')
|
|
|
- or d.firm_name like concat('%', #{query.keywords}, '%')
|
|
|
- or e.firm_name like concat('%', #{query.keywords}, '%')
|
|
|
- or g.goods_name like concat('%', #{query.keywords}, '%'))
|
|
|
- </if>
|
|
|
- <if test="orderList != null and orderList.size() > 0">
|
|
|
- and a.status in
|
|
|
- <foreach collection="orderList" item="status" open="(" close=")" separator=",">
|
|
|
- #{status}
|
|
|
- </foreach>
|
|
|
- </if>
|
|
|
- <if test="idsList != null and idsList.size() > 0">
|
|
|
- and a.id in
|
|
|
- <foreach collection="idsList" close=")" open="(" separator="," item="item">
|
|
|
- #{item}
|
|
|
- </foreach>
|
|
|
- </if>
|
|
|
- <if test="query.endBeginDateTime != null and query.endBeginDateTime != ''">
|
|
|
- and DATE ( a.end_time) <![CDATA[ >= ]]> #{query.endBeginDateTime}
|
|
|
- </if>
|
|
|
- <if test="query.endOverDateTime != null and query.endOverDateTime != ''">
|
|
|
- and DATE ( a.end_time ) <![CDATA[ <= ]]> #{query.endOverDateTime}
|
|
|
- </if>
|
|
|
- <if test="query.startBeginDateTime != null and query.startBeginDateTime != ''">
|
|
|
- and DATE ( a.start_time) <![CDATA[ >= ]]> #{query.startBeginDateTime}
|
|
|
- </if>
|
|
|
- <if test="query.startOverDateTime != null and query.startOverDateTime != ''">
|
|
|
- and DATE ( a.start_time ) <![CDATA[ <= ]]> #{query.startOverDateTime}
|
|
|
- </if>
|
|
|
- <if test="query.createStartTime != null and query.createStartTime != ''">
|
|
|
- and a.create_time >=#{query.createStartTime}
|
|
|
- </if>
|
|
|
- <if test="query.createEndTime != null and query.createEndTime != ''">
|
|
|
- and a.create_time <=#{query.createEndTime}
|
|
|
- </if>
|
|
|
- <if test="query.loadAddressCode != null and query.loadAddressCode != ''">
|
|
|
- and b.city_code LIKE CONCAT(#{query.loadAddressCode}
|
|
|
- , '%')
|
|
|
- </if>
|
|
|
- <if test="query.unloadAddressCode != null and query.unloadAddressCode != ''">
|
|
|
- and c.city_code LIKE CONCAT(#{query.unloadAddressCode}
|
|
|
- , '%')
|
|
|
- </if>
|
|
|
- <if test="query.billingMode != null and query.billingMode != ''">
|
|
|
- and a.billing_mode =#{query.billingMode}
|
|
|
- </if>
|
|
|
- </where>
|
|
|
- ORDER BY a.create_time DESC
|
|
|
+ or a.l_order_no like concat('%', #{query.keywords}, '%')
|
|
|
+ or d.firm_name like concat('%', #{query.keywords}, '%')
|
|
|
+ or e.firm_name like concat('%', #{query.keywords}, '%')
|
|
|
+ or g.goods_name like concat('%', #{query.keywords}, '%')
|
|
|
+ )
|
|
|
+ </if>
|
|
|
+ <if test="orderList != null and orderList.size() > 0">
|
|
|
+ and a.status in
|
|
|
+ <foreach collection="orderList" item="status" open="(" close=")" separator=",">
|
|
|
+ #{status}
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ <if test="idsList != null and idsList.size() > 0">
|
|
|
+ and a.id in
|
|
|
+ <foreach collection="idsList" close=")" open="(" separator="," item="item">
|
|
|
+ #{item}
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ <if test="query.endBeginDateTime != null and query.endBeginDateTime != ''">
|
|
|
+ and DATE ( a.end_time) <![CDATA[ >= ]]> #{query.endBeginDateTime}
|
|
|
+ </if>
|
|
|
+ <if test="query.endOverDateTime != null and query.endOverDateTime != ''">
|
|
|
+ and DATE ( a.end_time ) <![CDATA[ <= ]]> #{query.endOverDateTime}
|
|
|
+ </if>
|
|
|
+ <if test="query.startBeginDateTime != null and query.startBeginDateTime != ''">
|
|
|
+ and DATE ( a.start_time) <![CDATA[ >= ]]> #{query.startBeginDateTime}
|
|
|
+ </if>
|
|
|
+ <if test="query.startOverDateTime != null and query.startOverDateTime != ''">
|
|
|
+ and DATE ( a.start_time ) <![CDATA[ <= ]]> #{query.startOverDateTime}
|
|
|
+ </if>
|
|
|
+ <if test="query.createStartTime != null and query.createStartTime != ''">
|
|
|
+ and a.create_time >=#{query.createStartTime}
|
|
|
+ </if>
|
|
|
+ <if test="query.createEndTime != null and query.createEndTime != ''">
|
|
|
+ and a.create_time <=#{query.createEndTime}
|
|
|
+ </if>
|
|
|
+ <if test="(query.loadAddressCode != null and query.loadAddressCode != '') or (query.unloadAddressCode != null and query.unloadAddressCode != '')">
|
|
|
+ and a.id in (
|
|
|
+ SELECT DISTINCT l_order_id from kwt_logistics_order_address where del_flag = 0
|
|
|
+ <if test="query.loadAddressCode != null and query.loadAddressCode != ''">
|
|
|
+ and address_type = 1
|
|
|
+ and left(city_code, #{query.loadAddressLevel, jdbcType=INTEGER}) = left( #{query.loadAddressCode, jdbcType=INTEGER}, #{query.loadAddressLevel, jdbcType=INTEGER} )
|
|
|
+ </if>
|
|
|
+ <if test="unloadAddressCode != null and unloadAddressCode != ''">
|
|
|
+ and address_type = 2
|
|
|
+ and left(city_code, #{query.unloadAddressLevel, jdbcType=INTEGER}) = left( #{query.unloadAddressCode, jdbcType=INTEGER}, #{query.unloadAddressLevel, jdbcType=INTEGER} )
|
|
|
+ </if>
|
|
|
+ )
|
|
|
+ </if>
|
|
|
+ <if test="query.billingMode != null and query.billingMode != ''">
|
|
|
+ and a.billing_mode =#{query.billingMode}
|
|
|
+ </if>
|
|
|
+ </where>
|
|
|
+ ORDER BY a.create_time DESC
|
|
|
) tab
|
|
|
<where>
|
|
|
tab.delFlag = 0
|
|
|
@@ -2569,36 +2506,29 @@
|
|
|
))
|
|
|
</where>
|
|
|
</select>
|
|
|
+
|
|
|
<select id="selectLogisticsOrderListByConsign" resultType="com.sckw.transport.model.vo.AcceptCarriageOrderVO">
|
|
|
SELECT
|
|
|
-<!-- <include refid="New_Query_Column_List">-->
|
|
|
-<!-- </include>-->
|
|
|
<include refid="New_Query_Column_List_v42">
|
|
|
</include>
|
|
|
FROM (
|
|
|
SELECT
|
|
|
<include refid="Query_Column_List_Cogsign">
|
|
|
</include>
|
|
|
- FROM kwt_logistics_order a
|
|
|
- LEFT JOIN kwt_logistics_order_address b ON a.id = b.l_order_id
|
|
|
- AND b.address_type = 1 AND b.del_flag = 0
|
|
|
- LEFT JOIN kwt_logistics_order_address c ON a.id = c.l_order_id
|
|
|
- AND c.address_type = 2 AND c.del_flag = 0
|
|
|
- LEFT JOIN kwt_logistics_order_unit d ON a.id = d.l_order_id
|
|
|
- AND d.unit_type = 1 AND d.del_flag = 0
|
|
|
- LEFT JOIN kwt_logistics_order_unit e ON a.id = e.l_order_id
|
|
|
- AND e.unit_type = 2
|
|
|
- LEFT JOIN kwt_logistics_order_goods g ON a.id = g.l_order_id AND g.del_flag = 0
|
|
|
- LEFT JOIN kwt_logistics_order_contract f ON a.id = f.l_order_id AND f.del_flag = 0
|
|
|
+ FROM kwt_logistics_order a
|
|
|
+ LEFT JOIN kwt_logistics_order_unit d ON a.id = d.l_order_id AND d.unit_type = 1 AND d.del_flag = 0
|
|
|
+ LEFT JOIN kwt_logistics_order_unit e ON a.id = e.l_order_id AND e.unit_type = 2
|
|
|
+ LEFT JOIN kwt_logistics_order_goods g ON a.id = g.l_order_id AND g.del_flag = 0
|
|
|
+ LEFT JOIN kwt_logistics_order_contract f ON a.id = f.l_order_id AND f.del_flag = 0
|
|
|
<where>
|
|
|
a.del_flag = 0
|
|
|
<if test="query.keywords != null and query.keywords != ''">
|
|
|
and (
|
|
|
- a.t_order_no like concat('%', #{query.keywords}, '%')
|
|
|
- or a.l_order_no like concat('%', #{query.keywords}, '%')
|
|
|
- or d.firm_name like concat('%', #{query.keywords}, '%')
|
|
|
- or e.firm_name like concat('%', #{query.keywords}, '%')
|
|
|
- or g.goods_name like concat('%', #{query.keywords}, '%'))
|
|
|
+ a.t_order_no like concat('%', #{query.keywords}, '%')
|
|
|
+ or a.l_order_no like concat('%', #{query.keywords}, '%')
|
|
|
+ or d.firm_name like concat('%', #{query.keywords}, '%')
|
|
|
+ or e.firm_name like concat('%', #{query.keywords}, '%')
|
|
|
+ or g.goods_name like concat('%', #{query.keywords}, '%'))
|
|
|
</if>
|
|
|
<if test="orderList != null and orderList.size() > 0">
|
|
|
and a.status in
|
|
|
@@ -2630,14 +2560,18 @@
|
|
|
<if test="query.createEndTime != null and query.createEndTime != ''">
|
|
|
and a.create_time <=#{query.createEndTime}
|
|
|
</if>
|
|
|
- <if test="query.loadAddressCode != null and query.loadAddressCode != ''">
|
|
|
- <!-- and b.city_code = #{query.loadAddressCode}-->
|
|
|
- and b.city_code LIKE CONCAT(#{query.loadAddressCode}
|
|
|
- , '%')
|
|
|
- </if>
|
|
|
- <if test="query.unloadAddressCode != null and query.unloadAddressCode != ''">
|
|
|
- and c.city_code LIKE CONCAT(#{query.unloadAddressCode}
|
|
|
- , '%')
|
|
|
+ <if test="(query.loadAddressCode != null and query.loadAddressCode != '') or (query.unloadAddressCode != null and query.unloadAddressCode != '')">
|
|
|
+ and a.id in (
|
|
|
+ SELECT DISTINCT l_order_id from kwt_logistics_order_address where del_flag = 0
|
|
|
+ <if test="query.loadAddressCode != null and query.loadAddressCode != ''">
|
|
|
+ and address_type = 1
|
|
|
+ and left(city_code, #{query.loadAddressLevel, jdbcType=INTEGER}) = left( #{query.loadAddressCode, jdbcType=INTEGER}, #{query.loadAddressLevel, jdbcType=INTEGER} )
|
|
|
+ </if>
|
|
|
+ <if test="unloadAddressCode != null and unloadAddressCode != ''">
|
|
|
+ and address_type = 2
|
|
|
+ and left(city_code, #{query.unloadAddressLevel, jdbcType=INTEGER}) = left( #{query.unloadAddressCode, jdbcType=INTEGER}, #{query.unloadAddressLevel, jdbcType=INTEGER} )
|
|
|
+ </if>
|
|
|
+ )
|
|
|
</if>
|
|
|
<if test="query.billingMode != null and query.billingMode != ''">
|
|
|
and a.billing_mode =#{query.billingMode}
|
|
|
@@ -2672,195 +2606,201 @@
|
|
|
</select>
|
|
|
|
|
|
<select id="countLogisticsOrderListByConsignStatus" resultType="com.sckw.mongo.model.TableTops">
|
|
|
- select status AS value ,
|
|
|
- COUNT(status) AS total FROM (
|
|
|
+ select
|
|
|
+ status AS value ,
|
|
|
+ COUNT(status) AS total
|
|
|
+ FROM (
|
|
|
SELECT
|
|
|
- <include refid="Query_Column_List_Cogsign">
|
|
|
- </include>
|
|
|
- FROM
|
|
|
- kwt_logistics_order a
|
|
|
- LEFT JOIN kwt_logistics_order_address b ON a.id = b.l_order_id
|
|
|
- AND b.address_type = 1 AND b.del_flag = 0
|
|
|
- LEFT JOIN kwt_logistics_order_address c ON a.id = c.l_order_id
|
|
|
- AND c.address_type = 2 AND c.del_flag = 0
|
|
|
- LEFT JOIN kwt_logistics_order_unit d ON a.id = d.l_order_id
|
|
|
- AND d.unit_type = 1 AND d.del_flag = 0
|
|
|
- LEFT JOIN kwt_logistics_order_unit e ON a.id = e.l_order_id
|
|
|
- AND e.unit_type = 2
|
|
|
- LEFT JOIN kwt_logistics_order_goods g ON a.id = g.l_order_id AND g.del_flag = 0
|
|
|
- LEFT JOIN kwt_logistics_order_contract f ON a.id = f.l_order_id AND f.del_flag = 0
|
|
|
- <where>
|
|
|
- a.del_flag = 0
|
|
|
- <if test="query.keywords != null and query.keywords != ''">
|
|
|
- and (
|
|
|
- a.t_order_no like concat('%', #{query.keywords}, '%')
|
|
|
- or a.l_order_no like concat('%', #{query.keywords}, '%')
|
|
|
- or d.firm_name like concat('%', #{query.keywords}, '%')
|
|
|
- or e.firm_name like concat('%', #{query.keywords}, '%')
|
|
|
- or g.goods_name like concat('%', #{query.keywords}, '%'))
|
|
|
- </if>
|
|
|
- <if test="orderList != null and orderList.size() > 0">
|
|
|
- and a.status in
|
|
|
- <foreach collection="orderList" item="status" open="(" close=")" separator=",">
|
|
|
- #{status}
|
|
|
- </foreach>
|
|
|
- </if>
|
|
|
- <if test="idsList != null and idsList.size() > 0">
|
|
|
- and a.id in
|
|
|
- <foreach collection="idsList" close=")" open="(" separator="," item="item">
|
|
|
- #{item}
|
|
|
- </foreach>
|
|
|
- </if>
|
|
|
- <if test="query.endBeginDateTime != null and query.endBeginDateTime != ''">
|
|
|
- and DATE ( a.end_time) <![CDATA[ >= ]]> #{query.endBeginDateTime}
|
|
|
- </if>
|
|
|
- <if test="query.endOverDateTime != null and query.endOverDateTime != ''">
|
|
|
- and DATE ( a.end_time ) <![CDATA[ <= ]]> #{query.endOverDateTime}
|
|
|
- </if>
|
|
|
- <if test="query.startBeginDateTime != null and query.startBeginDateTime != ''">
|
|
|
- and DATE ( a.start_time) <![CDATA[ >= ]]> #{query.startBeginDateTime}
|
|
|
- </if>
|
|
|
- <if test="query.startOverDateTime != null and query.startOverDateTime != ''">
|
|
|
- and DATE ( a.start_time ) <![CDATA[ <= ]]> #{query.startOverDateTime}
|
|
|
- </if>
|
|
|
- <if test="query.createStartTime != null and query.createStartTime != ''">
|
|
|
- and a.create_time >=#{query.createStartTime}
|
|
|
- </if>
|
|
|
- <if test="query.createEndTime != null and query.createEndTime != ''">
|
|
|
- and a.create_time <=#{query.createEndTime}
|
|
|
- </if>
|
|
|
- <if test="query.loadAddressCode != null and query.loadAddressCode != ''">
|
|
|
- <!-- and b.city_code = #{query.loadAddressCode}-->
|
|
|
- and b.city_code LIKE CONCAT(#{query.loadAddressCode}, '%')
|
|
|
- </if>
|
|
|
- <if test="query.unloadAddressCode != null and query.unloadAddressCode != ''">
|
|
|
- <!-- and c.city_code = #{query.unloadAddressCode}-->
|
|
|
- and c.city_code LIKE CONCAT(#{query.unloadAddressCode}, '%')
|
|
|
- </if>
|
|
|
- <if test="query.billingMode != null and query.billingMode != ''">
|
|
|
- and a.billing_mode =#{query.billingMode}
|
|
|
- </if>
|
|
|
- </where>
|
|
|
- ORDER BY a.create_time DESC
|
|
|
+ <include refid="Query_Column_List_Cogsign">
|
|
|
+ </include>
|
|
|
+ FROM
|
|
|
+ kwt_logistics_order a
|
|
|
+ LEFT JOIN kwt_logistics_order_unit d ON a.id = d.l_order_id AND d.unit_type = 1 AND d.del_flag = 0
|
|
|
+ LEFT JOIN kwt_logistics_order_unit e ON a.id = e.l_order_id AND e.unit_type = 2
|
|
|
+ LEFT JOIN kwt_logistics_order_goods g ON a.id = g.l_order_id AND g.del_flag = 0
|
|
|
+ LEFT JOIN kwt_logistics_order_contract f ON a.id = f.l_order_id AND f.del_flag = 0
|
|
|
+ <where>
|
|
|
+ a.del_flag = 0
|
|
|
+ <if test="query.keywords != null and query.keywords != ''">
|
|
|
+ and (
|
|
|
+ a.t_order_no like concat('%', #{query.keywords}, '%')
|
|
|
+ or a.l_order_no like concat('%', #{query.keywords}, '%')
|
|
|
+ or d.firm_name like concat('%', #{query.keywords}, '%')
|
|
|
+ or e.firm_name like concat('%', #{query.keywords}, '%')
|
|
|
+ or g.goods_name like concat('%', #{query.keywords}, '%'))
|
|
|
+ </if>
|
|
|
+ <if test="orderList != null and orderList.size() > 0">
|
|
|
+ and a.status in
|
|
|
+ <foreach collection="orderList" item="status" open="(" close=")" separator=",">
|
|
|
+ #{status}
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ <if test="idsList != null and idsList.size() > 0">
|
|
|
+ and a.id in
|
|
|
+ <foreach collection="idsList" close=")" open="(" separator="," item="item">
|
|
|
+ #{item}
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ <if test="query.endBeginDateTime != null and query.endBeginDateTime != ''">
|
|
|
+ and DATE ( a.end_time) <![CDATA[ >= ]]> #{query.endBeginDateTime}
|
|
|
+ </if>
|
|
|
+ <if test="query.endOverDateTime != null and query.endOverDateTime != ''">
|
|
|
+ and DATE ( a.end_time ) <![CDATA[ <= ]]> #{query.endOverDateTime}
|
|
|
+ </if>
|
|
|
+ <if test="query.startBeginDateTime != null and query.startBeginDateTime != ''">
|
|
|
+ and DATE ( a.start_time) <![CDATA[ >= ]]> #{query.startBeginDateTime}
|
|
|
+ </if>
|
|
|
+ <if test="query.startOverDateTime != null and query.startOverDateTime != ''">
|
|
|
+ and DATE ( a.start_time ) <![CDATA[ <= ]]> #{query.startOverDateTime}
|
|
|
+ </if>
|
|
|
+ <if test="query.createStartTime != null and query.createStartTime != ''">
|
|
|
+ and a.create_time >=#{query.createStartTime}
|
|
|
+ </if>
|
|
|
+ <if test="query.createEndTime != null and query.createEndTime != ''">
|
|
|
+ and a.create_time <=#{query.createEndTime}
|
|
|
+ </if>
|
|
|
+ <if test="(query.loadAddressCode != null and query.loadAddressCode != '') or (query.unloadAddressCode != null and query.unloadAddressCode != '')">
|
|
|
+ and a.id in (
|
|
|
+ SELECT DISTINCT l_order_id from kwt_logistics_order_address where del_flag = 0
|
|
|
+ <if test="query.loadAddressCode != null and query.loadAddressCode != ''">
|
|
|
+ and address_type = 1
|
|
|
+ and left(city_code, #{query.loadAddressLevel, jdbcType=INTEGER}) = left( #{query.loadAddressCode, jdbcType=INTEGER}, #{query.loadAddressLevel, jdbcType=INTEGER} )
|
|
|
+ </if>
|
|
|
+ <if test="unloadAddressCode != null and unloadAddressCode != ''">
|
|
|
+ and address_type = 2
|
|
|
+ and left(city_code, #{query.unloadAddressLevel, jdbcType=INTEGER}) = left( #{query.unloadAddressCode, jdbcType=INTEGER}, #{query.unloadAddressLevel, jdbcType=INTEGER} )
|
|
|
+ </if>
|
|
|
+ )
|
|
|
+ </if>
|
|
|
+ <if test="query.billingMode != null and query.billingMode != ''">
|
|
|
+ and a.billing_mode =#{query.billingMode}
|
|
|
+ </if>
|
|
|
+ </where>
|
|
|
+ ORDER BY a.create_time DESC
|
|
|
) tab
|
|
|
<where>
|
|
|
tab.delFlag = 0
|
|
|
AND ((
|
|
|
tab.createType = 1
|
|
|
- and tab.entId = #{entId}
|
|
|
- <if test="userIds != null and userIds.size() > 0">
|
|
|
- AND tab.createBy IN
|
|
|
- <foreach collection="userIds" open="(" close=")" item="item" separator=",">
|
|
|
- #{item}
|
|
|
- </foreach>
|
|
|
- </if>
|
|
|
- )
|
|
|
+ and tab.entId = #{entId}
|
|
|
+ <if test="userIds != null and userIds.size() > 0">
|
|
|
+ AND tab.createBy IN
|
|
|
+ <foreach collection="userIds" open="(" close=")" item="item" separator=",">
|
|
|
+ #{item}
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ )
|
|
|
OR (
|
|
|
tab.consignTopEntId = #{entId}
|
|
|
- <if test="contactsIds != null and contactsIds.size() > 0">
|
|
|
- AND tab.consignContactsId IN
|
|
|
- <foreach collection="contactsIds" separator="," item="item" close=")" open="(">
|
|
|
- #{item}
|
|
|
- </foreach>
|
|
|
- </if>
|
|
|
+ <if test="contactsIds != null and contactsIds.size() > 0">
|
|
|
+ AND tab.consignContactsId IN
|
|
|
+ <foreach collection="contactsIds" separator="," item="item" close=")" open="(">
|
|
|
+ #{item}
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
))
|
|
|
</where>
|
|
|
group by status
|
|
|
</select>
|
|
|
+
|
|
|
<select id="countLogisticsOrderListByAcceptCarriageStatus" resultType="com.sckw.mongo.model.TableTops">
|
|
|
- SELECT status as value,
|
|
|
- COUNT( status ) AS total FROM (
|
|
|
+ SELECT
|
|
|
+ status as value,
|
|
|
+ COUNT( status ) AS total
|
|
|
+ FROM (
|
|
|
SELECT
|
|
|
- <include refid="Query_Column_List_Accept_Carriage">
|
|
|
- </include>
|
|
|
- FROM
|
|
|
- kwt_logistics_order a
|
|
|
- LEFT JOIN kwt_logistics_order_address b ON a.id = b.l_order_id
|
|
|
- AND b.address_type = 1 AND b.del_flag = 0
|
|
|
- LEFT JOIN kwt_logistics_order_address c ON a.id = c.l_order_id
|
|
|
- AND c.address_type = 2 AND c.del_flag = 0
|
|
|
- LEFT JOIN kwt_logistics_order_unit d ON a.id = d.l_order_id
|
|
|
- AND d.unit_type = 1 AND d.del_flag = 0
|
|
|
- LEFT JOIN kwt_logistics_order_unit e ON a.id = e.l_order_id
|
|
|
- AND e.unit_type = 2
|
|
|
- LEFT JOIN kwt_logistics_order_goods g ON a.id = g.l_order_id AND g.del_flag = 0
|
|
|
- LEFT JOIN kwt_logistics_order_contract f ON a.id = f.l_order_id AND f.del_flag = 0
|
|
|
- <where>
|
|
|
- a.del_flag = 0
|
|
|
- <if test="query.keywords != null and query.keywords != ''">
|
|
|
- and (
|
|
|
- a.t_order_no like concat('%', #{query.keywords}, '%')
|
|
|
- or a.l_order_no like concat('%', #{query.keywords}, '%')
|
|
|
- or d.firm_name like concat('%', #{query.keywords}, '%')
|
|
|
- or e.firm_name like concat('%', #{query.keywords}, '%')
|
|
|
- or g.goods_name like concat('%', #{query.keywords}, '%'))
|
|
|
- </if>
|
|
|
- <if test="orderList != null and orderList.size() > 0">
|
|
|
- and a.status in
|
|
|
- <foreach collection="orderList" item="status" open="(" close=")" separator=",">
|
|
|
- #{status}
|
|
|
- </foreach>
|
|
|
- </if>
|
|
|
- <if test="idsList != null and idsList.size() > 0">
|
|
|
- and a.id in
|
|
|
- <foreach collection="idsList" close=")" open="(" separator="," item="item">
|
|
|
- #{item}
|
|
|
- </foreach>
|
|
|
- </if>
|
|
|
- <if test="query.endBeginDateTime != null and query.endBeginDateTime != ''">
|
|
|
- and DATE ( a.end_time) <![CDATA[ >= ]]> #{query.endBeginDateTime}
|
|
|
- </if>
|
|
|
- <if test="query.endOverDateTime != null and query.endOverDateTime != ''">
|
|
|
- and DATE ( a.end_time ) <![CDATA[ <= ]]> #{query.endOverDateTime}
|
|
|
- </if>
|
|
|
- <if test="query.startBeginDateTime != null and query.startBeginDateTime != ''">
|
|
|
- and DATE ( a.start_time) <![CDATA[ >= ]]> #{query.startBeginDateTime}
|
|
|
- </if>
|
|
|
- <if test="query.startOverDateTime != null and query.startOverDateTime != ''">
|
|
|
- and DATE ( a.start_time ) <![CDATA[ <= ]]> #{query.startOverDateTime}
|
|
|
- </if>
|
|
|
- <if test="query.createStartTime != null and query.createStartTime != ''">
|
|
|
- and a.create_time >=#{query.createStartTime}
|
|
|
- </if>
|
|
|
- <if test="query.createEndTime != null and query.createEndTime != ''">
|
|
|
- and a.create_time <=#{query.createEndTime}
|
|
|
- </if>
|
|
|
- <if test="query.loadAddressCode != null and query.loadAddressCode != ''">
|
|
|
- and b.city_code LIKE CONCAT(#{query.loadAddressCode}, '%')
|
|
|
- </if>
|
|
|
- <if test="query.unloadAddressCode != null and query.unloadAddressCode != ''">
|
|
|
- and c.city_code LIKE CONCAT(#{query.unloadAddressCode}, '%')
|
|
|
- </if>
|
|
|
- <if test="query.billingMode != null and query.billingMode != ''">
|
|
|
- and a.billing_mode =#{query.billingMode}
|
|
|
- </if>
|
|
|
- </where>
|
|
|
- ORDER BY a.create_time DESC
|
|
|
+ <include refid="Query_Column_List_Accept_Carriage">
|
|
|
+ </include>
|
|
|
+ FROM
|
|
|
+ kwt_logistics_order a
|
|
|
+ LEFT JOIN kwt_logistics_order_unit d ON a.id = d.l_order_id AND d.unit_type = 1 AND d.del_flag = 0
|
|
|
+ LEFT JOIN kwt_logistics_order_unit e ON a.id = e.l_order_id AND e.unit_type = 2
|
|
|
+ LEFT JOIN kwt_logistics_order_goods g ON a.id = g.l_order_id AND g.del_flag = 0
|
|
|
+ LEFT JOIN kwt_logistics_order_contract f ON a.id = f.l_order_id AND f.del_flag = 0
|
|
|
+ <where>
|
|
|
+ a.del_flag = 0
|
|
|
+ <if test="query.keywords != null and query.keywords != ''">
|
|
|
+ and (
|
|
|
+ a.t_order_no like concat('%', #{query.keywords}, '%')
|
|
|
+ or a.l_order_no like concat('%', #{query.keywords}, '%')
|
|
|
+ or d.firm_name like concat('%', #{query.keywords}, '%')
|
|
|
+ or e.firm_name like concat('%', #{query.keywords}, '%')
|
|
|
+ or g.goods_name like concat('%', #{query.keywords}, '%'))
|
|
|
+ </if>
|
|
|
+ <if test="orderList != null and orderList.size() > 0">
|
|
|
+ and a.status in
|
|
|
+ <foreach collection="orderList" item="status" open="(" close=")" separator=",">
|
|
|
+ #{status}
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ <if test="idsList != null and idsList.size() > 0">
|
|
|
+ and a.id in
|
|
|
+ <foreach collection="idsList" close=")" open="(" separator="," item="item">
|
|
|
+ #{item}
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ <if test="query.endBeginDateTime != null and query.endBeginDateTime != ''">
|
|
|
+ and DATE ( a.end_time) <![CDATA[ >= ]]> #{query.endBeginDateTime}
|
|
|
+ </if>
|
|
|
+ <if test="query.endOverDateTime != null and query.endOverDateTime != ''">
|
|
|
+ and DATE ( a.end_time ) <![CDATA[ <= ]]> #{query.endOverDateTime}
|
|
|
+ </if>
|
|
|
+ <if test="query.startBeginDateTime != null and query.startBeginDateTime != ''">
|
|
|
+ and DATE ( a.start_time) <![CDATA[ >= ]]> #{query.startBeginDateTime}
|
|
|
+ </if>
|
|
|
+ <if test="query.startOverDateTime != null and query.startOverDateTime != ''">
|
|
|
+ and DATE ( a.start_time ) <![CDATA[ <= ]]> #{query.startOverDateTime}
|
|
|
+ </if>
|
|
|
+ <if test="query.createStartTime != null and query.createStartTime != ''">
|
|
|
+ and a.create_time >=#{query.createStartTime}
|
|
|
+ </if>
|
|
|
+ <if test="query.createEndTime != null and query.createEndTime != ''">
|
|
|
+ and a.create_time <=#{query.createEndTime}
|
|
|
+ </if>
|
|
|
+ <if test="(query.loadAddressCode != null and query.loadAddressCode != '') or (query.unloadAddressCode != null and query.unloadAddressCode != '')">
|
|
|
+ and a.id in (
|
|
|
+ SELECT DISTINCT l_order_id from kwt_logistics_order_address where del_flag = 0
|
|
|
+ <if test="query.loadAddressCode != null and query.loadAddressCode != ''">
|
|
|
+ and address_type = 1
|
|
|
+ and left(city_code, #{query.loadAddressLevel, jdbcType=INTEGER}) = left( #{query.loadAddressCode, jdbcType=INTEGER}, #{query.loadAddressLevel, jdbcType=INTEGER} )
|
|
|
+ </if>
|
|
|
+ <if test="unloadAddressCode != null and unloadAddressCode != ''">
|
|
|
+ and address_type = 2
|
|
|
+ and left(city_code, #{query.unloadAddressLevel, jdbcType=INTEGER}) = left( #{query.unloadAddressCode, jdbcType=INTEGER}, #{query.unloadAddressLevel, jdbcType=INTEGER} )
|
|
|
+ </if>
|
|
|
+ )
|
|
|
+ </if>
|
|
|
+ <if test="query.billingMode != null and query.billingMode != ''">
|
|
|
+ and a.billing_mode =#{query.billingMode}
|
|
|
+ </if>
|
|
|
+ </where>
|
|
|
+ ORDER BY a.create_time DESC
|
|
|
) tab
|
|
|
<where>
|
|
|
tab.delFlag = 0
|
|
|
AND ((
|
|
|
tab.createType = 1
|
|
|
- and tab.entId = #{entId}
|
|
|
- <if test="userIds != null and userIds.size() > 0">
|
|
|
- AND tab.createBy IN
|
|
|
- <foreach collection="userIds" open="(" close=")" item="item" separator=",">
|
|
|
- #{item}
|
|
|
- </foreach>
|
|
|
- </if>
|
|
|
+ and tab.entId = #{entId}
|
|
|
+ <if test="userIds != null and userIds.size() > 0">
|
|
|
+ AND tab.createBy IN
|
|
|
+ <foreach collection="userIds" open="(" close=")" item="item" separator=",">
|
|
|
+ #{item}
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
)
|
|
|
OR (
|
|
|
tab.carrierTopEntId = #{entId}
|
|
|
- <if test="contactsIds != null and contactsIds.size() > 0">
|
|
|
- AND tab.carrierContactsId IN
|
|
|
- <foreach collection="contactsIds" separator="," item="item" close=")" open="(">
|
|
|
- #{item}
|
|
|
- </foreach>
|
|
|
- </if>
|
|
|
+ <if test="contactsIds != null and contactsIds.size() > 0">
|
|
|
+ AND tab.carrierContactsId IN
|
|
|
+ <foreach collection="contactsIds" separator="," item="item" close=")" open="(">
|
|
|
+ #{item}
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
))
|
|
|
</where>
|
|
|
group by status
|
|
|
</select>
|
|
|
+
|
|
|
<select id="selectConsignLogisticsOrderListByConsign" resultType="com.sckw.transport.model.vo.ConsignOrderVO">
|
|
|
SELECT
|
|
|
<include refid="New_Query_Column_List">
|