|
|
@ -3,25 +3,34 @@ |
|
|
|
<mapper namespace="com.yxt.anrui.buscenter.biz.bussalesvehicle.BusSalesVehicleMapper"> |
|
|
|
<select id="selectPageVo" resultType="com.yxt.anrui.buscenter.api.bussalesvehicle.BusSalesVehicleVo"> |
|
|
|
select bv.useOrgName, |
|
|
|
bvoa.orgName deptName, |
|
|
|
bvoa.orgName deptName, |
|
|
|
bvoa.staffName, |
|
|
|
bvoa.customerName, |
|
|
|
bvoa.contractNo, |
|
|
|
bv.modelName, |
|
|
|
bv.vinNo, |
|
|
|
bvoa.saleTypeValue saleType, |
|
|
|
bvoa.saleDate, |
|
|
|
if(length(bh.closingDate) > 0, '已交付', '未交付') as handoverState, |
|
|
|
bh.closingDate as handoverDate |
|
|
|
bvoa.saleTypeValue saleType, |
|
|
|
DATE_FORMAT(bvoa.saleDate, '%Y-%m-%d') as saleDate, |
|
|
|
if(length(bh.closingDate) > 0, '已交付', '未交付') |
|
|
|
as handoverState, |
|
|
|
DATE_FORMAT(bh.closingDate, '%Y-%m-%d') as handoverDate |
|
|
|
from anrui_base.base_vehicle_out bvo |
|
|
|
left join anrui_base.base_vehicle_out_apply bvoa on bvoa.sid = bvo.mainSid |
|
|
|
left join anrui_base.base_vehicle bv on bvo.vinSid = bv.sid |
|
|
|
left join anrui_buscenter.bus_handover_items bi on bi.vinSid = bv.sid |
|
|
|
left join anrui_buscenter.bus_handover bh on bh.sid = bi.handoverSid |
|
|
|
|
|
|
|
|
|
|
|
<where> |
|
|
|
${ew.sqlSegment} |
|
|
|
and length(bv.salesDate) > 0 |
|
|
|
and length |
|
|
|
( |
|
|
|
bv |
|
|
|
. |
|
|
|
salesDate |
|
|
|
) |
|
|
|
> |
|
|
|
0 |
|
|
|
<if test="state != null and state != ''"> |
|
|
|
<if test="state == '已交付'"> |
|
|
|
and length(bh.closingDate) |
|
|
@ -33,6 +42,7 @@ |
|
|
|
</if> |
|
|
|
</if> |
|
|
|
</where> |
|
|
|
|
|
|
|
order by bv.useOrgName desc,bvoa.orgName desc,bvoa.staffName desc,bvoa.customerName desc,bvoa.contractNo desc |
|
|
|
</select> |
|
|
|
|
|
|
@ -47,11 +57,10 @@ |
|
|
|
bvoa.saleTypeValue saleType, |
|
|
|
bvoa.saleDate, |
|
|
|
if(length(bh.closingDate) > 0, '已交付', '未交付') as handoverState, |
|
|
|
bh.closingDate as handoverDate, |
|
|
|
<!--序号--> |
|
|
|
(@rank := @rank + 1) rankNo |
|
|
|
from anrui_base.base_vehicle_out bvo, |
|
|
|
(SELECT @rank := 0) t |
|
|
|
DATE_FORMAT(bh.closingDate, '%Y-%m-%d') as handoverDate, |
|
|
|
(@rank := @rank + 1) rankNo |
|
|
|
from (SELECT @rank := 0) t, |
|
|
|
anrui_base.base_vehicle_out bvo |
|
|
|
left join anrui_base.base_vehicle_out_apply bvoa on bvoa.sid = bvo.mainSid |
|
|
|
left join anrui_base.base_vehicle bv on bvo.vinSid = bv.sid |
|
|
|
left join anrui_buscenter.bus_handover_items bi on bi.vinSid = bv.sid |
|
|
|