Commit 399f516c by levphon

围栏设备使用vdid关联修改

1 parent 129963bc
...@@ -68,10 +68,12 @@ ...@@ -68,10 +68,12 @@
tef.created_by createdBy, tef.created_by createdBy,
tu.username creator tu.username creator
from t_electric_fence tef from t_electric_fence tef
left join t_electric_fence_sns tefs on tefs.fence_id = tef.id and tefs.del_flag = 0 left join t_electric_fence_sns tefs on tefs.fence_id = tef.id
left join t_vehicle_device tvd on tvd.id = tefs.vd_id
left join t_vehicle tv on tv.id = tvd.vehicle_id
left join t_user tu on tu.id = tef.created_by left join t_user tu on tu.id = tef.created_by
where tef.del_flag = 0 where tef.del_flag = 0 and tefs.del_flag = 0 and tvd.del_flag = 0
and tef.biz_fence_type not in (12, 13) and tef.biz_fence_type in (14)
<if test="beginDate != null and beginDate != '' and endDate != null and endDate != ''"> <if test="beginDate != null and beginDate != '' and endDate != null and endDate != ''">
<choose> <choose>
<when test="timeType == 1"> <when test="timeType == 1">
...@@ -92,7 +94,9 @@ ...@@ -92,7 +94,9 @@
and ( and (
tef.fence_name like CONCAT('%',#{term},'%') tef.fence_name like CONCAT('%',#{term},'%')
or or
tefs.vin like CONCAT('%',#{term},'%') tv.vin like CONCAT('%',#{term},'%')
or
tv.owner_name like CONCAT('%',#{term},'%')
or or
tefs.sn like CONCAT('%',#{term},'%') tefs.sn like CONCAT('%',#{term},'%')
) )
...@@ -118,10 +122,12 @@ ...@@ -118,10 +122,12 @@
tef.created_by createdBy, tef.created_by createdBy,
tu.username creator tu.username creator
from t_electric_fence tef from t_electric_fence tef
left join t_electric_fence_sns tefs on tefs.fence_id = tef.id and tefs.del_flag = 0 left join t_electric_fence_sns tefs on tefs.fence_id = tef.id
left join t_vehicle_device tvd on tvd.id = tefs.vd_id
left join t_vehicle tv on tv.id = tvd.vehicle_id
left join t_user tu on tu.id = tef.created_by left join t_user tu on tu.id = tef.created_by
where tef.del_flag = 0 where tef.del_flag = 0 and tefs.del_flag = 0 and tvd.del_flag = 0
and tef.biz_fence_type not in (12, 13) and tef.biz_fence_type in (14)
<if test="beginDate != null and beginDate != '' and endDate != null and endDate != ''"> <if test="beginDate != null and beginDate != '' and endDate != null and endDate != ''">
<choose> <choose>
<when test="timeType == 1"> <when test="timeType == 1">
...@@ -142,7 +148,9 @@ ...@@ -142,7 +148,9 @@
and ( and (
tef.fence_name like CONCAT('%',#{term},'%') tef.fence_name like CONCAT('%',#{term},'%')
or or
tefs.vin like CONCAT('%',#{term},'%') tv.vin like CONCAT('%',#{term},'%')
or
tv.owner_name like CONCAT('%',#{term},'%')
or or
tefs.sn like CONCAT('%',#{term},'%') tefs.sn like CONCAT('%',#{term},'%')
) )
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!