Commit 20499a13 by levphon

指定组织授权-车辆监控

1 parent 71058442
......@@ -402,16 +402,31 @@
tv.vin,
tv.owner_name ownerName,
tvd.sn sns,
tvp.receiver_id creatorId,
${loginUserId} AS creatorId,
td.source,
td.device_type deviceType
from t_vehicle tv
left join t_vehicle_device tvd on tv.id = tvd.vehicle_id
left join t_device td on td.sn = tvd.sn
left join t_vehicle_permit tvp on tvp.content_id = tv.id
where tv.del_flag = 0 and tvd.del_flag = 0 and tvp.del_flag = 0
where tv.del_flag = 0 and tvd.del_flag = 0
and tvd.bind_status = 1
and tvp.receiver_id = #{loginUserId}
AND (
tv.id in (select tvp.content_id
from t_vehicle_permit tvp
where tvp.del_flag = 0
AND tvp.receiver_id IN (#{loginUserId})
AND tvp.content_type = 0)
OR
tv.created_by IN (SELECT tu2.id
FROM t_user tu2
WHERE tu2.del_flag = 0
AND tu2.department_id IN
(SELECT tvp.content_id
FROM t_vehicle_permit tvp
WHERE tvp.del_flag = 0
AND tvp.receiver_id IN (#{loginUserId})
AND tvp.content_type = 2))
)
<if test="term != null and term != ''">
<choose>
<when test="termType == 1">
......@@ -447,7 +462,7 @@
</foreach>
</select>
<select id="getVehicleByVin" resultMap="BaseResultMap">
<select id="getVehicleByVin" resultMap="BaseResultMap">
select
<include refid="Base_Column_List"/>
from t_vehicle tv where tv.vin = #{vin} and del_flag = 0
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!