Commit dd774514 by levphon

车辆监控搜索条件空判断

1 parent 880627c2
......@@ -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}
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!