Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
eshiled-new
/
ne-shield-trialdrive-admin
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit dd774514
authored
Mar 30, 2022
by
levphon
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
车辆监控搜索条件空判断
1 parent
880627c2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
49 additions
and
41 deletions
src/main/resources/mapper/VehicleMapper.xml
src/main/resources/mapper/VehicleMapper.xml
View file @
dd77451
...
...
@@ -126,14 +126,16 @@
left join t_device td on tvd.sn = td.sn
where tv.del_flag = 0 and tvd.del_flag = 0
and tvd.bind_status = 1
<choose>
<when
test=
"termType == 1"
>
and tvd.sn like concat('%',#{term},'%')
</when>
<when
test=
"termType == 2"
>
and tv.vin like concat('%',#{term},'%')
</when>
</choose>
<if
test=
"term != null and term != ''"
>
<choose>
<when
test=
"termType == 1"
>
and tvd.sn like concat('%',#{term},'%')
</when>
<when
test=
"termType == 2"
>
and tv.vin like concat('%',#{term},'%')
</when>
</choose>
</if>
<if
test=
"shopId != null"
>
and tv.created_by = #{shopId}
</if>
...
...
@@ -275,17 +277,19 @@
#{item}
</foreach>
</if>
<choose>
<when
test=
"termType == 1"
>
and tvd.sn like concat('%',#{term},'%')
</when>
<when
test=
"termType == 2"
>
and tv.vin like concat('%',#{term},'%')
</when>
<when
test=
"termType == 3"
>
and tv.owner_name like concat('%',#{term},'%')
</when>
</choose>
<if
test=
"term != null and term != ''"
>
<choose>
<when
test=
"termType == 1"
>
and tvd.sn like concat('%',#{term},'%')
</when>
<when
test=
"termType == 2"
>
and tv.vin like concat('%',#{term},'%')
</when>
<when
test=
"termType == 3"
>
and tv.owner_name like concat('%',#{term},'%')
</when>
</choose>
</if>
group by tv.id
order by tv.id desc
</select>
...
...
@@ -311,17 +315,19 @@
#{item}
</foreach>
</if>
<choose>
<when
test=
"termType == 1"
>
and tvd.sn like concat('%',#{term},'%')
</when>
<when
test=
"termType == 2"
>
and tv.vin like concat('%',#{term},'%')
</when>
<when
test=
"termType == 3"
>
and tv.owner_name like concat('%',#{term},'%')
</when>
</choose>
<if
test=
"term != null and term != ''"
>
<choose>
<when
test=
"termType == 1"
>
and tvd.sn like concat('%',#{term},'%')
</when>
<when
test=
"termType == 2"
>
and tv.vin like concat('%',#{term},'%')
</when>
<when
test=
"termType == 3"
>
and tv.owner_name like concat('%',#{term},'%')
</when>
</choose>
</if>
order by tv.id desc
<if
test=
"threshold != null and threshold gt 0"
>
limit #{threshold}
...
...
@@ -347,17 +353,19 @@
<foreach
collection=
"userIds"
separator=
","
open=
"("
close=
")"
item=
"item"
>
#{item}
</foreach>
<choose>
<when
test=
"termType == 1"
>
and tvd.sn like concat('%',#{term},'%')
</when>
<when
test=
"termType == 2"
>
and tv.vin like concat('%',#{term},'%')
</when>
<when
test=
"termType == 3"
>
and tv.owner_name like concat('%',#{term},'%')
</when>
</choose>
<if
test=
"term != null and term != ''"
>
<choose>
<when
test=
"termType == 1"
>
and tvd.sn like concat('%',#{term},'%')
</when>
<when
test=
"termType == 2"
>
and tv.vin like concat('%',#{term},'%')
</when>
<when
test=
"termType == 3"
>
and tv.owner_name like concat('%',#{term},'%')
</when>
</choose>
</if>
order by tv.id desc
<if
test=
"threshold != null and threshold gt 0"
>
limit #{threshold}
...
...
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment