|
|
@ -47,24 +47,33 @@ |
|
|
|
</select> |
|
|
|
|
|
|
|
<select id="exportList" resultType="com.yxt.anrui.buscenter.api.bussalesvehicle.BusSalesVehicleExportVo"> |
|
|
|
select bv.useOrgName, |
|
|
|
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, |
|
|
|
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 |
|
|
|
left join anrui_buscenter.bus_handover bh on bh.sid = bi.handoverSid |
|
|
|
select t1.useOrgName, |
|
|
|
t1.deptName, |
|
|
|
t1.staffName, |
|
|
|
t1.customerName, |
|
|
|
t1.contractNo, |
|
|
|
t1.modelName, |
|
|
|
t1.vinNo, |
|
|
|
t1.saleType, |
|
|
|
t1.saleDate, |
|
|
|
t1.handoverState, |
|
|
|
t1.handoverDate, |
|
|
|
(@rank := @rank + 1) rankNo from (SELECT @rank := 0) t,(select bv.useOrgName, |
|
|
|
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, |
|
|
|
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} |
|
|
@ -80,6 +89,6 @@ |
|
|
|
</if> |
|
|
|
</if> |
|
|
|
</where> |
|
|
|
order by bv.useOrgName desc,bvoa.orgName desc,bvoa.staffName desc,bvoa.customerName desc,bvoa.contractNo desc |
|
|
|
order by bv.useOrgName desc, bvoa.orgName desc, bvoa.staffName desc, bvoa.customerName desc, bvoa.contractNo desc) t1 |
|
|
|
</select> |
|
|
|
</mapper> |