|
|
@@ -304,6 +304,12 @@
|
|
|
<if test="logisticsOrderParam.endTime != null and logisticsOrderParam.endTime !=''">
|
|
|
AND a.end_time <= #{logisticsOrderParam.endTime}
|
|
|
</if>
|
|
|
+ <if test="orderStatusList != null and orderStatusList.size()>0">
|
|
|
+ and a.status in
|
|
|
+ <foreach collection="orderStatusList" separator="," open="(" close=")" item="item" >
|
|
|
+ #{item,jdbcType=INTEGER}
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
</where>
|
|
|
ORDER BY a.create_time DESC
|
|
|
<if test="logisticsOrderParam.page != null and logisticsOrderParam.pageSize != null ">
|
|
|
@@ -350,6 +356,12 @@
|
|
|
<if test="logisticsOrderParam.endTime != null and logisticsOrderParam.endTime !=''">
|
|
|
AND a.end_time <= #{logisticsOrderParam.endTime}
|
|
|
</if>
|
|
|
+ <if test="orderStatusList != null and orderStatusList.size()>0">
|
|
|
+ and a.status in
|
|
|
+ <foreach collection="orderStatusList" item="item" close=")" open="(" separator=",">
|
|
|
+ #{item,jdbcType=INTEGER}
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
</where>
|
|
|
ORDER BY a.create_time DESC
|
|
|
</select>
|
|
|
@@ -632,6 +644,7 @@
|
|
|
</foreach>
|
|
|
</if>
|
|
|
</where>
|
|
|
+ and a.status = #{status,jdbcType=INTEGER}
|
|
|
ORDER BY a.create_time DESC
|
|
|
</select>
|
|
|
|
|
|
@@ -868,6 +881,8 @@
|
|
|
d.top_ent_id AS consignTopEntId,
|
|
|
d.firm_name AS consignCompany,
|
|
|
d.contacts AS consignContacts,
|
|
|
+ d.contacts_id AS consignContactsId,
|
|
|
+ e.contacts_id AS carrierContactsId,
|
|
|
d.phone AS consignPhone,
|
|
|
e.ent_id AS carrierCompanyId,
|
|
|
e.firm_name AS carrierCompany,
|
|
|
@@ -892,15 +907,237 @@
|
|
|
c.lat AS unloadLat,
|
|
|
c.lng AS unloadLng,
|
|
|
f.contract_name as contract
|
|
|
- <!-- ,-->
|
|
|
- <!-- a.del_flag,-->
|
|
|
- <!-- b.del_flag,-->
|
|
|
- <!-- c.del_flag,-->
|
|
|
- <!-- d.del_flag,-->
|
|
|
- <!-- e.del_flag,-->
|
|
|
- <!-- f.del_flag,-->
|
|
|
- <!-- g.del_flag-->
|
|
|
+ ,a.del_flag as delFlag
|
|
|
+ </sql>
|
|
|
+
|
|
|
+ <sql id="Query_Column_List_Accept_Carriage">
|
|
|
+ a.id AS lOrderId,
|
|
|
+ a.l_order_no AS lOrderNo,
|
|
|
+ a.t_order_id AS tOrderId,
|
|
|
+ a.t_order_no AS tOrderNo,
|
|
|
+ a.loss AS loss,
|
|
|
+ a.loss_unit AS lossUnit,
|
|
|
+ a.settlement_cycle AS accountsCycle,
|
|
|
+ a.billing_mode AS billingMode,
|
|
|
+ a.amount AS carryingCapacity,
|
|
|
+ a.goods_price AS goodsPrice,
|
|
|
+ a.goods_price_unit AS goodsPriceUnit,
|
|
|
+ a.`status` AS status,
|
|
|
+ a.settlement_cycle AS settlementCycle,
|
|
|
+ a.price AS price,
|
|
|
+ a.price_type AS priceType,
|
|
|
+ a.type AS type,
|
|
|
+ a.unit AS unit,
|
|
|
+ a.subcontract_amount AS subcontractAmount,
|
|
|
+ a.entrust_amount AS entrustAmount,
|
|
|
+ a.unload_amount AS unloadAmount,
|
|
|
+ a.load_amount AS loadAmount,
|
|
|
+ a.ignore_amount AS ignoreAmount,
|
|
|
+ a.deficit_amount AS deficitAmount,
|
|
|
+ a.deficit_price AS deficitPrice,
|
|
|
+ a.total_load_amount AS totalLoadAmount,
|
|
|
+ a.total_unload_amount AS totalUnloadAmount,
|
|
|
+ a.payment AS payment,
|
|
|
+ a.tax_rate AS taxRate,
|
|
|
+ a.ent_id AS entId,
|
|
|
+ a.create_by AS createBy,
|
|
|
+ a.create_time AS createTime,
|
|
|
+ a.update_by AS updateBy,
|
|
|
+ a.update_time AS updateTime,
|
|
|
+ a.start_time AS shipmentsDateTime,
|
|
|
+ a.end_time AS receiveGoodsDateTime,
|
|
|
+ a.remark AS remark,
|
|
|
+ g.goods_id AS goodsId,
|
|
|
+ g.goods_name AS goodsName,
|
|
|
+ g.goods_type AS goodsType,
|
|
|
+ f.contract_id AS contractId,
|
|
|
+ f.contract_no AS contractNo,
|
|
|
+ f.signing_way AS signing,
|
|
|
+ d.ent_id AS consignCompanyId,
|
|
|
+ d.top_ent_id AS consignTopEntId,
|
|
|
+ d.firm_name AS consignCompany,
|
|
|
+ d.contacts AS consignContacts,
|
|
|
+ d.contacts_id AS consignContactsId,
|
|
|
+ e.contacts_id AS carrierContactsId,
|
|
|
+ d.phone AS consignPhone,
|
|
|
+ e.ent_id AS carrierCompanyId,
|
|
|
+ e.firm_name AS carrierCompany,
|
|
|
+ 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.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
|
|
|
+ ,a.del_flag as delFlag,
|
|
|
+ case when a.ent_id = e.top_ent_id then 1 ELSE 2 end as createType
|
|
|
+ </sql>
|
|
|
+
|
|
|
+ <sql id="Query_Column_List_Cogsign">
|
|
|
+ a.id AS lOrderId,
|
|
|
+ a.l_order_no AS lOrderNo,
|
|
|
+ a.t_order_id AS tOrderId,
|
|
|
+ a.t_order_no AS tOrderNo,
|
|
|
+ a.loss AS loss,
|
|
|
+ a.loss_unit AS lossUnit,
|
|
|
+ a.settlement_cycle AS accountsCycle,
|
|
|
+ a.billing_mode AS billingMode,
|
|
|
+ a.amount AS carryingCapacity,
|
|
|
+ a.goods_price AS goodsPrice,
|
|
|
+ a.goods_price_unit AS goodsPriceUnit,
|
|
|
+ a.`status` AS status,
|
|
|
+ a.settlement_cycle AS settlementCycle,
|
|
|
+ a.price AS price,
|
|
|
+ a.price_type AS priceType,
|
|
|
+ a.type AS type,
|
|
|
+ a.unit AS unit,
|
|
|
+ a.subcontract_amount AS subcontractAmount,
|
|
|
+ a.entrust_amount AS entrustAmount,
|
|
|
+ a.unload_amount AS unloadAmount,
|
|
|
+ a.load_amount AS loadAmount,
|
|
|
+ a.ignore_amount AS ignoreAmount,
|
|
|
+ a.deficit_amount AS deficitAmount,
|
|
|
+ a.deficit_price AS deficitPrice,
|
|
|
+ a.total_load_amount AS totalLoadAmount,
|
|
|
+ a.total_unload_amount AS totalUnloadAmount,
|
|
|
+ a.payment AS payment,
|
|
|
+ a.tax_rate AS taxRate,
|
|
|
+ a.ent_id AS entId,
|
|
|
+ a.create_by AS createBy,
|
|
|
+ a.create_time AS createTime,
|
|
|
+ a.update_by AS updateBy,
|
|
|
+ a.update_time AS updateTime,
|
|
|
+ a.start_time AS shipmentsDateTime,
|
|
|
+ a.end_time AS receiveGoodsDateTime,
|
|
|
+ a.remark AS remark,
|
|
|
+ g.goods_id AS goodsId,
|
|
|
+ g.goods_name AS goodsName,
|
|
|
+ g.goods_type AS goodsType,
|
|
|
+ f.contract_id AS contractId,
|
|
|
+ f.contract_no AS contractNo,
|
|
|
+ f.signing_way AS signing,
|
|
|
+ d.ent_id AS consignCompanyId,
|
|
|
+ d.top_ent_id AS consignTopEntId,
|
|
|
+ d.firm_name AS consignCompany,
|
|
|
+ d.contacts AS consignContacts,
|
|
|
+ d.contacts_id AS consignContactsId,
|
|
|
+ e.contacts_id AS carrierContactsId,
|
|
|
+ d.phone AS consignPhone,
|
|
|
+ e.ent_id AS carrierCompanyId,
|
|
|
+ e.firm_name AS carrierCompany,
|
|
|
+ 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.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
|
|
|
+ ,a.del_flag as delFlag,
|
|
|
+ case when a.ent_id = d.top_ent_id then 1 ELSE 2 end as createType
|
|
|
+ </sql>
|
|
|
+
|
|
|
+ <sql id="New_Query_Column_List">
|
|
|
+ lOrderId,
|
|
|
+ lOrderNo,
|
|
|
+ tOrderId,
|
|
|
+ tOrderNo,
|
|
|
+ loss,
|
|
|
+ lossUnit,
|
|
|
+ accountsCycle,
|
|
|
+ billingMode,
|
|
|
+ carryingCapacity,
|
|
|
+ goodsPrice,
|
|
|
+ goodsPriceUnit,
|
|
|
+ STATUS,
|
|
|
+ settlementCycle,
|
|
|
+ price,
|
|
|
+ priceType,
|
|
|
+ type,
|
|
|
+ unit,
|
|
|
+ subcontractAmount,
|
|
|
+ entrustAmount,
|
|
|
+ unloadAmount,
|
|
|
+ loadAmount,
|
|
|
+ ignoreAmount,
|
|
|
+ deficitAmount,
|
|
|
+ deficitPrice,
|
|
|
+ totalLoadAmount,
|
|
|
+ totalUnloadAmount,
|
|
|
+ payment,
|
|
|
+ taxRate,
|
|
|
+ entId,
|
|
|
+ createBy,
|
|
|
+ createTime,
|
|
|
+ updateBy,
|
|
|
+ updateTime,
|
|
|
+ shipmentsDateTime,
|
|
|
+ receiveGoodsDateTime,
|
|
|
+ remark,
|
|
|
+ goodsId,
|
|
|
+ goodsName,
|
|
|
+ goodsType,
|
|
|
+ contractId,
|
|
|
+ contractNo,
|
|
|
+ signing,
|
|
|
+ consignCompanyId,
|
|
|
+ consignTopEntId,
|
|
|
+ consignCompany,
|
|
|
+ consignContacts,
|
|
|
+ consignPhone,
|
|
|
+ carrierCompanyId,
|
|
|
+ carrierCompany,
|
|
|
+ carrierTopEntId,
|
|
|
+ carrierContacts,
|
|
|
+ carrierPhone,
|
|
|
+ loadName,
|
|
|
+ loadType,
|
|
|
+ loadCityName,
|
|
|
+ loadCityCode,
|
|
|
+ loadAddress,
|
|
|
+ shipmentsContacts,
|
|
|
+ shipmentsPhone,
|
|
|
+ loadLat,
|
|
|
+ loadLng,
|
|
|
+ unloadType,
|
|
|
+ receiveGoodsContacts,
|
|
|
+ receiveGoodsPhone,
|
|
|
+ unloadCityName,
|
|
|
+ unloadCityCode,
|
|
|
+ unloadAddress,
|
|
|
+ unloadLat,
|
|
|
+ unloadLng,
|
|
|
+ contract,
|
|
|
+ createType
|
|
|
</sql>
|
|
|
+
|
|
|
<select id="selectLogisticsOrderList" resultType="com.sckw.transport.model.vo.AcceptCarriageOrderVO">
|
|
|
SELECT
|
|
|
<include refid="Query_Column_List">
|
|
|
@@ -1811,4 +2048,471 @@
|
|
|
) B
|
|
|
ON A.date= B.date_time;
|
|
|
</select>
|
|
|
+ <select id="selectLogisticsOrderListByAcceptCarriage"
|
|
|
+ resultType="com.sckw.transport.model.vo.AcceptCarriageOrderVO">
|
|
|
+ SELECT <include refid="New_Query_Column_List"></include> 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 = #{query.loadAddressCode}
|
|
|
+ </if>
|
|
|
+ <if test="query.unloadAddressCode != null and query.unloadAddressCode != ''">
|
|
|
+ and c.city_code = #{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
|
|
|
+ ) 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>
|
|
|
+ )
|
|
|
+ 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>
|
|
|
+ ))
|
|
|
+ </where>
|
|
|
+ </select>
|
|
|
+ <select id="selectLogisticsOrderListByConsign" resultType="com.sckw.transport.model.vo.AcceptCarriageOrderVO">
|
|
|
+ SELECT <include refid="New_Query_Column_List"></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
|
|
|
+ <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}
|
|
|
+ </if>
|
|
|
+ <if test="query.unloadAddressCode != null and query.unloadAddressCode != ''">
|
|
|
+ and c.city_code = #{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
|
|
|
+ ) 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>
|
|
|
+ )
|
|
|
+ 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>
|
|
|
+ ))
|
|
|
+ </where>
|
|
|
+ ORDER BY tab.createTime DESC
|
|
|
+ </select>
|
|
|
+ <select id="countLogisticsOrderListByConsignStatus" resultType="com.sckw.mongo.model.TableTops">
|
|
|
+ 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}
|
|
|
+ </if>
|
|
|
+ <if test="query.unloadAddressCode != null and query.unloadAddressCode != ''">
|
|
|
+ and c.city_code = #{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
|
|
|
+ ) 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>
|
|
|
+ )
|
|
|
+ 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>
|
|
|
+ ))
|
|
|
+ </where>
|
|
|
+ group by status
|
|
|
+ </select>
|
|
|
+ <select id="countLogisticsOrderListByAcceptCarriageStatus" resultType="com.sckw.mongo.model.TableTops">
|
|
|
+ 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 = #{query.loadAddressCode}
|
|
|
+ </if>
|
|
|
+ <if test="query.unloadAddressCode != null and query.unloadAddressCode != ''">
|
|
|
+ and c.city_code = #{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
|
|
|
+ ) 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>
|
|
|
+ )
|
|
|
+ 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>
|
|
|
+ ))
|
|
|
+ </where>
|
|
|
+ group by status
|
|
|
+ </select>
|
|
|
+ <select id="selectConsignLogisticsOrderListByConsign" resultType="com.sckw.transport.model.vo.ConsignOrderVO">
|
|
|
+ SELECT <include refid="New_Query_Column_List"></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
|
|
|
+ <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}
|
|
|
+ </if>
|
|
|
+ <if test="query.unloadAddressCode != null and query.unloadAddressCode != ''">
|
|
|
+ and c.city_code = #{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
|
|
|
+ ) 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>
|
|
|
+ )
|
|
|
+ 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>
|
|
|
+ ))
|
|
|
+ </where>
|
|
|
+ ORDER BY tab.createTime DESC
|
|
|
+ </select>
|
|
|
</mapper>
|