Commit 318a2227 authored by jiaorz's avatar jiaorz

后台订单列表修改

parent d962307e
......@@ -241,85 +241,58 @@
</select>
<select id="getAllOrderList" parameterType="Map" resultType="com.xxfc.platform.order.pojo.bg.BgOrderListVo">
SELECT
DISTINCT(b1.id),
bc1.`name` AS startCompanyName,
bc2. NAME AS endCompanyName,
v1.number_plate AS numberPlate,
v1.code AS vehicleCode,
a1. NAME AS username,
a2.username AS telephone,
a2.id As userId,
b1.id AS orderId,
b1.`no` AS orderNo,
b1.`status` as status,
b1.`name` as vehicleName,
b1.crt_time as crtTime,
o1.start_time as startTime,
o1.end_time as endTime,
b1.real_amount as realAmount,
b1.pay_way as payWay,
o1.id as detailId,
b1.pay_time as payTime
FROM
base_order b1
LEFT JOIN order_rent_vehicle_detail o1 ON b1.detail_id = o1.id
LEFT JOIN vehicle.branch_company bc1 ON bc1.id = o1.start_company_id
LEFT JOIN vehicle.branch_company bc2 ON bc2.id = o1.end_company_id
LEFT JOIN vehicle.vehicle v1 ON v1.id = o1.vehicle_id
LEFT JOIN xxfc_third_platform.id_information a1 ON b1.user_id = a1.user_login_id
LEFT JOIN ag_admin_v1.app_user_login a2 ON a2.id = b1.user_id
SELECT * from order_list_info
<where>
<if test="userIds != null and userIds.size() > 0">
and b1.user_id in
and userId in
<foreach collection="userIds" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<if test="phone != null and phone != ''">
and a2.username like CONCAT ("%", #{phone}, "%")
and telephone like CONCAT ("%", #{phone}, "%")
</if>
<if test="realName != null and realName != ''">
and a1.name like CONCAT ("%", #{realName}, "%")
and username like CONCAT ("%", #{realName}, "%")
</if>
<if test="userId != null">
and b1.user_id = #{userId}
and userId = #{userId}
</if>
<if test="status != null">
and b1.status = #{status}
and status = #{status}
</if>
<if test="type != null">
and b1.type = #{type}
and type = #{type}
</if>
<if test="no != null and no != '' ">
and b1.no like CONCAT ("%", #{no}, "%")
and orderNo like CONCAT ("%", #{no}, "%")
</if>
<if test="plateNumber != null and plateNumber != '' ">
and v1.number_plate like CONCAT ("%", #{plateNumber}, "%")
and numberPlate like CONCAT ("%", #{plateNumber}, "%")
</if>
<if test="vehicleCode != null">
and v1.code = #{vehicleCode}
and vehicleCode = #{vehicleCode}
</if>
<if test="startTime != null">
and o1.start_time between #{startTime} and #{endTime}
and startTime between #{startTime} and #{endTime}
</if>
<if test="companyIds != null and companyIds.size > 0">
and (o1.start_company_id in
and (startCompanyId in
<foreach collection="companyIds" item="id" open="(" separator="," close=")">
#{id}
</foreach>
or
o1.end_company_id in
endCompanyId in
<foreach collection="companyIds" item="id" open="(" separator="," close=")">
#{id}
</foreach>
)
</if>
<if test="zoneId != null">
and (bc1.zone_id = #{zoneId} or bc2.zone_id = #{zoneId})
and (startZoneId = #{zoneId} or endZoneId = #{zoneId})
</if>
</where>
order by b1.crt_time desc
order by crtTime desc
</select>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment