|
|
|
@ -40,13 +40,15 @@ |
|
|
|
<result column="image_path" jdbcType="VARCHAR" property="imagePath" /> |
|
|
|
<result column="payment_for_goods" jdbcType="VARCHAR" property="paymentForGoods" /> |
|
|
|
<result column="transfer_addition" jdbcType="VARCHAR" property="transferAddition" /> |
|
|
|
<result column="order_status" jdbcType="VARCHAR" property="orderStatus" /> |
|
|
|
</resultMap> |
|
|
|
|
|
|
|
<sql id="Base_Column_List"> |
|
|
|
id, create_by, create_by_name, create_time, del_flag, update_by, update_time,company_id, company_name, circuit_id, circuit_name, |
|
|
|
shipper_name, shipper_mobile, shipper_address, receiver_name, receiver_mobile, receiver_address, |
|
|
|
go_station_id, go_station_name, arrival_station_id, arrival_station_name, weight, count, freight, premium, |
|
|
|
transit_fee, tips, method_of_settlement, cost, all_cost, order_number, object_name, remark, receiving_user_id, receiving_user_name,image_path, payment_for_goods, transfer_addition |
|
|
|
transit_fee, tips, method_of_settlement, cost, all_cost, order_number, object_name, remark, receiving_user_id, |
|
|
|
receiving_user_name,image_path, payment_for_goods, transfer_addition,order_status |
|
|
|
</sql> |
|
|
|
|
|
|
|
<select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="BaseResultMap"> |
|
|
|
@ -66,7 +68,8 @@ |
|
|
|
(id, create_by, create_by_name, create_time, del_flag, update_by, update_time,company_id, company_name, circuit_id, circuit_name, |
|
|
|
shipper_name, shipper_mobile, shipper_address, receiver_name, receiver_mobile, receiver_address, |
|
|
|
go_station_id, go_station_name, arrival_station_id, arrival_station_name, weight, count, freight, premium, |
|
|
|
transit_fee, tips, method_of_settlement, cost, all_cost, order_number, object_name, remark, receiving_user_id, receiving_user_name,image_path, payment_for_goods, transfer_addition) |
|
|
|
transit_fee, tips, method_of_settlement, cost, all_cost, order_number, object_name, remark, receiving_user_id, receiving_user_name, |
|
|
|
image_path, payment_for_goods, transfer_addition,order_status) |
|
|
|
values (#{id,jdbcType=VARCHAR}, #{createBy,jdbcType=VARCHAR}, #{createByName,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, |
|
|
|
#{delFlag,jdbcType=INTEGER}, #{updateBy,jdbcType=VARCHAR}, #{updateTime,jdbcType=TIMESTAMP}, |
|
|
|
#{companyId,jdbcType=VARCHAR}, #{companyName,jdbcType=VARCHAR}, #{circuitId,jdbcType=VARCHAR}, #{circuitName,jdbcType=VARCHAR}, |
|
|
|
@ -77,72 +80,102 @@ |
|
|
|
#{transitFee,jdbcType=DECIMAL}, #{tips,jdbcType=DECIMAL}, #{methodOfSettlement,jdbcType=VARCHAR}, #{cost,jdbcType=DECIMAL}, |
|
|
|
#{allCost,jdbcType=DECIMAL}, #{orderNumber,jdbcType=VARCHAR}, #{objectName,jdbcType=VARCHAR}, #{remark,jdbcType=VARCHAR}, |
|
|
|
#{receivingUserId,jdbcType=VARCHAR}, #{receivingUserName,jdbcType=VARCHAR},#{imagePath,jdbcType=VARCHAR}, #{paymentForGoods,jdbcType=VARCHAR}, |
|
|
|
#{transferAddition,jdbcType=VARCHAR}) |
|
|
|
#{transferAddition,jdbcType=VARCHAR},#{orderStatus,jdbcType=VARCHAR}) |
|
|
|
</insert> |
|
|
|
|
|
|
|
<!--管理商品分页列表--> |
|
|
|
<select id="getLogisticsOrderPageList" resultMap="BaseResultMap" parameterType="cc.hiver.core.logisticsorder.vo.LogisticsOrderQueryVo"> |
|
|
|
|
|
|
|
WITH OrderChangeCount AS ( |
|
|
|
SELECT |
|
|
|
order_id, |
|
|
|
COUNT(*) AS change_count |
|
|
|
FROM |
|
|
|
t_logistics_order_change_log |
|
|
|
GROUP BY |
|
|
|
order_id |
|
|
|
) |
|
|
|
|
|
|
|
select |
|
|
|
<include refid="Base_Column_List" /> |
|
|
|
from t_logistics_order |
|
|
|
t.id, t.create_by, |
|
|
|
t.create_by_name, t.create_time, t.del_flag, t.update_by, t.update_time, t.company_id, t.company_name, t.circuit_id, t.circuit_name, |
|
|
|
t.shipper_name, t.shipper_mobile, t.shipper_address, t.receiver_name, t.receiver_mobile, t.receiver_address, |
|
|
|
t.go_station_id, t.go_station_name, t.arrival_station_id, t.arrival_station_name, t.weight, t.count, t.freight, t.premium, |
|
|
|
t.transit_fee, t.tips, t.method_of_settlement, t.cost, t.all_cost, t.order_number, t.object_name, t.remark, t.receiving_user_id, |
|
|
|
t.receiving_user_name,t.image_path, t.payment_for_goods, t.transfer_addition,t.order_status, |
|
|
|
COALESCE(occ.change_count, 0) AS change_count |
|
|
|
from t_logistics_order t |
|
|
|
LEFT JOIN |
|
|
|
OrderChangeCount occ |
|
|
|
ON |
|
|
|
t.id = occ.order_id |
|
|
|
<where> |
|
|
|
<!-- 根据物流公司id、线路id、出发站id、到达站id查 精准查询--> |
|
|
|
<if test='queryParams.companyId!=null and queryParams.companyId.trim() neq ""'> |
|
|
|
AND company_id = #{queryParams.companyId} |
|
|
|
AND t.company_id = #{queryParams.companyId} |
|
|
|
</if> |
|
|
|
<if test='queryParams.circuitId!=null and queryParams.circuitId.trim() neq ""'> |
|
|
|
AND circuit_id = #{queryParams.circuitId} |
|
|
|
AND t.circuit_id = #{queryParams.circuitId} |
|
|
|
</if> |
|
|
|
<if test='queryParams.goStationId!=null and queryParams.goStationId.trim() neq ""'> |
|
|
|
AND go_station_id = #{queryParams.goStationId} |
|
|
|
AND t.go_station_id = #{queryParams.goStationId} |
|
|
|
</if> |
|
|
|
<if test='queryParams.arrivalStationId!=null and queryParams.arrivalStationId.trim() neq ""'> |
|
|
|
AND arrival_station_id = #{queryParams.arrivalStationId} |
|
|
|
AND t.arrival_station_id = #{queryParams.arrivalStationId} |
|
|
|
</if> |
|
|
|
<if test='queryParams.shipperId!=null and queryParams.shipperId.trim() neq ""'> |
|
|
|
AND t.shipper_id = #{queryParams.shipperId} |
|
|
|
</if> |
|
|
|
<if test='queryParams.receiverId!=null and queryParams.receiverId.trim() neq ""'> |
|
|
|
AND t.receiver_id = #{queryParams.receiverId} |
|
|
|
</if> |
|
|
|
<!--模糊查询项:收货人电话、收货人名称、发货人电话、发货人名称、站点名、操作人名、线路名--> |
|
|
|
<if test='queryParams.companyName!=null and queryParams.companyName.trim() neq ""'> |
|
|
|
AND company_name like concat('%',#{queryParams.companyName},'%') |
|
|
|
AND t.company_name like concat('%',#{queryParams.companyName},'%') |
|
|
|
</if> |
|
|
|
<if test='queryParams.circuitName!=null and queryParams.circuitName.trim() neq ""'> |
|
|
|
AND circuit_name like concat('%',#{queryParams.circuitName},'%') |
|
|
|
AND t.circuit_name like concat('%',#{queryParams.circuitName},'%') |
|
|
|
</if> |
|
|
|
<if test='queryParams.shipperName!=null and queryParams.shipperName.trim() neq ""'> |
|
|
|
AND shipper_name like concat('%',#{queryParams.shipperName},'%') |
|
|
|
AND t.shipper_name like concat('%',#{queryParams.shipperName},'%') |
|
|
|
</if> |
|
|
|
<if test='queryParams.shipperMobile!=null and queryParams.shipperMobile.trim() neq ""'> |
|
|
|
AND shipper_mobile like concat('%',#{queryParams.shipperMobile},'%') |
|
|
|
AND t.shipper_mobile like concat('%',#{queryParams.shipperMobile},'%') |
|
|
|
</if> |
|
|
|
<if test='queryParams.shipperAddress!=null and queryParams.shipperAddress.trim() neq ""'> |
|
|
|
AND shipper_address like concat('%',#{queryParams.shipperAddress},'%') |
|
|
|
AND t.shipper_address like concat('%',#{queryParams.shipperAddress},'%') |
|
|
|
</if> |
|
|
|
<if test='queryParams.receiverName!=null and queryParams.receiverName.trim() neq ""'> |
|
|
|
AND receiver_name like concat('%',#{queryParams.receiverName},'%') |
|
|
|
AND t.receiver_name like concat('%',#{queryParams.receiverName},'%') |
|
|
|
</if> |
|
|
|
<if test='queryParams.receiverMobile!=null and queryParams.receiverMobile.trim() neq ""'> |
|
|
|
AND receiver_mobile like concat('%',#{queryParams.receiverMobile},'%') |
|
|
|
AND t.receiver_mobile like concat('%',#{queryParams.receiverMobile},'%') |
|
|
|
</if> |
|
|
|
<if test='queryParams.goStationName!=null and queryParams.goStationName.trim() neq ""'> |
|
|
|
AND go_station_name like concat('%',#{queryParams.goStationName},'%') |
|
|
|
AND t.go_station_name like concat('%',#{queryParams.goStationName},'%') |
|
|
|
</if> |
|
|
|
<if test='queryParams.arrivalStationName!=null and queryParams.arrivalStationName.trim() neq ""'> |
|
|
|
AND arrival_station_name like concat('%',#{queryParams.arrivalStationName},'%') |
|
|
|
AND t.arrival_station_name like concat('%',#{queryParams.arrivalStationName},'%') |
|
|
|
</if> |
|
|
|
<if test='queryParams.orderNumber!=null and queryParams.orderNumber.trim() neq ""'> |
|
|
|
AND order_number like concat('%',#{queryParams.orderNumber},'%') |
|
|
|
AND t.order_number like concat('%',#{queryParams.orderNumber},'%') |
|
|
|
</if> |
|
|
|
<!--开始时间、结束时间--> |
|
|
|
<if test="queryParams.startDate!=null and queryParams.endDate!=null"> |
|
|
|
AND create_time BETWEEN #{queryParams.startDate} AND #{queryParams.endDate} |
|
|
|
AND t.create_time BETWEEN #{queryParams.startDate} AND #{queryParams.endDate} |
|
|
|
</if> |
|
|
|
<!-- 开单模糊搜索前台应该传一个字段,搜几个条件 --> |
|
|
|
<if test="queryParams.searchStr != null and queryParams.searchStr != ''"> |
|
|
|
and ( |
|
|
|
company_name like concat('%',#{queryParams.searchStr},'%') |
|
|
|
or circuit_name like concat('%',#{queryParams.searchStr},'%') |
|
|
|
or shipper_name like concat('%',#{queryParams.searchStr},'%') |
|
|
|
or shipper_mobile like concat('%',#{queryParams.searchStr},'%') |
|
|
|
or receiver_name like concat('%',#{queryParams.searchStr},'%') |
|
|
|
or receiver_mobile like concat('%',#{queryParams.searchStr},'%') |
|
|
|
t.company_name like concat('%',#{queryParams.searchStr},'%') |
|
|
|
or t.circuit_name like concat('%',#{queryParams.searchStr},'%') |
|
|
|
or t.shipper_id like concat('%',#{queryParams.searchStr},'%') |
|
|
|
or t.shipper_name like concat('%',#{queryParams.searchStr},'%') |
|
|
|
or t.shipper_mobile like concat('%',#{queryParams.searchStr},'%') |
|
|
|
or t.receiver_id like concat('%',#{queryParams.searchStr},'%') |
|
|
|
or t.receiver_name like concat('%',#{queryParams.searchStr},'%') |
|
|
|
or t.receiver_mobile like concat('%',#{queryParams.searchStr},'%') |
|
|
|
or t.order_status like concat('%',#{queryParams.searchStr},'%') |
|
|
|
) |
|
|
|
</if> |
|
|
|
<!--是否有修改记录的筛选--> |
|
|
|
@ -150,12 +183,13 @@ |
|
|
|
and exists ( |
|
|
|
select 1 |
|
|
|
from t_logistics_order_change_log tloc |
|
|
|
where id = tloc.order_id |
|
|
|
where t.id = tloc.order_id |
|
|
|
) |
|
|
|
</if> |
|
|
|
</where> |
|
|
|
ORDER BY |
|
|
|
create_time desc |
|
|
|
change_count desc, |
|
|
|
t.create_time desc |
|
|
|
</select> |
|
|
|
|
|
|
|
|
|
|
|
@ -212,4 +246,14 @@ |
|
|
|
AND arrival_station_id = #{logisticsOrderQueryVo.arrivalStationId} |
|
|
|
</if> |
|
|
|
</select> |
|
|
|
|
|
|
|
|
|
|
|
<update id="batchUpdateOrderStatus" > |
|
|
|
update t_logistics_order |
|
|
|
set order_status = #{orderStatus,jdbcType=VARCHAR} |
|
|
|
where id in |
|
|
|
<foreach close=")" collection="orderIdList" item="listItem" open="(" separator=","> |
|
|
|
#{listItem} |
|
|
|
</foreach> |
|
|
|
</update> |
|
|
|
</mapper> |