Commit bae1d847 authored by jiaorz's avatar jiaorz

Merge branch 'master-background-bug' into dev

parents 28037675 d72078a1
...@@ -41,4 +41,7 @@ public class BgOrderListVo { ...@@ -41,4 +41,7 @@ public class BgOrderListVo {
private Integer vehicleCode; private Integer vehicleCode;
private Integer userId; private Integer userId;
//员工身份
private String positionName;
} }
...@@ -241,85 +241,58 @@ ...@@ -241,85 +241,58 @@
</select> </select>
<select id="getAllOrderList" parameterType="Map" resultType="com.xxfc.platform.order.pojo.bg.BgOrderListVo"> <select id="getAllOrderList" parameterType="Map" resultType="com.xxfc.platform.order.pojo.bg.BgOrderListVo">
SELECT SELECT * from order_list_info
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
<where> <where>
<if test="userIds != null and userIds.size() > 0"> <if test="userIds != null and userIds.size() > 0">
and b1.user_id in and userId in
<foreach collection="userIds" item="item" open="(" separator="," close=")"> <foreach collection="userIds" item="item" open="(" separator="," close=")">
#{item} #{item}
</foreach> </foreach>
</if> </if>
<if test="phone != null and phone != ''"> <if test="phone != null and phone != ''">
and a2.username like CONCAT ("%", #{phone}, "%") and telephone like CONCAT ("%", #{phone}, "%")
</if> </if>
<if test="realName != null and realName != ''"> <if test="realName != null and realName != ''">
and a1.name like CONCAT ("%", #{realName}, "%") and username like CONCAT ("%", #{realName}, "%")
</if> </if>
<if test="userId != null"> <if test="userId != null">
and b1.user_id = #{userId} and userId = #{userId}
</if> </if>
<if test="status != null"> <if test="status != null">
and b1.status = #{status} and status = #{status}
</if> </if>
<if test="type != null"> <if test="type != null">
and b1.type = #{type} and type = #{type}
</if> </if>
<if test="no != null and no != '' "> <if test="no != null and no != '' ">
and b1.no like CONCAT ("%", #{no}, "%") and orderNo like CONCAT ("%", #{no}, "%")
</if> </if>
<if test="plateNumber != null and plateNumber != '' "> <if test="plateNumber != null and plateNumber != '' ">
and v1.number_plate like CONCAT ("%", #{plateNumber}, "%") and numberPlate like CONCAT ("%", #{plateNumber}, "%")
</if> </if>
<if test="vehicleCode != null"> <if test="vehicleCode != null">
and v1.code = #{vehicleCode} and vehicleCode = #{vehicleCode}
</if> </if>
<if test="startTime != null"> <if test="startTime != null">
and o1.start_time between #{startTime} and #{endTime} and startTime between #{startTime} and #{endTime}
</if> </if>
<if test="companyIds != null and companyIds.size > 0"> <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=")"> <foreach collection="companyIds" item="id" open="(" separator="," close=")">
#{id} #{id}
</foreach> </foreach>
or or
o1.end_company_id in endCompanyId in
<foreach collection="companyIds" item="id" open="(" separator="," close=")"> <foreach collection="companyIds" item="id" open="(" separator="," close=")">
#{id} #{id}
</foreach> </foreach>
) )
</if> </if>
<if test="zoneId != null"> <if test="zoneId != null">
and (bc1.zone_id = #{zoneId} or bc2.zone_id = #{zoneId}) and (startZoneId = #{zoneId} or endZoneId = #{zoneId})
</if> </if>
</where> </where>
order by b1.crt_time desc order by crtTime desc
</select> </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