zk 2 лет назад
Родитель
Сommit
ccacd340ea

+ 3 - 3
sckw-modules/sckw-fleet/src/main/resources/mapper/KwfDriverMapper.xml

@@ -131,7 +131,7 @@
             and DATE( dr.create_time ) <![CDATA[ <= ]]> #{endTime,jdbcType=TIMESTAMP}
         </if>
         <choose>
-            <when test="ids != null and ids != '' ">
+            <when test="ids != null and ids != '' and ids.size() > 0">
                 and dr.id in
                 <foreach collection="ids" item="id" open="(" close=")" separator=",">
                     #{id,jdbcType=BIGINT}
@@ -200,7 +200,7 @@
             )
         </if>
         <choose>
-            <when test="ids != null and ids != '' ">
+            <when test="ids != null and ids != '' and ids.size() > 0">
                 and dr.id in
                 <foreach collection="ids" item="id" open="(" close=")" separator=",">
                     #{id,jdbcType=BIGINT}
@@ -250,7 +250,7 @@
             )
         </if>
         <choose>
-            <when test="ids != null and ids != '' ">
+            <when test="ids != null and ids != '' and ids.size() > 0">
                 and dr.id in
                 <foreach collection="ids" item="id" open="(" close=")" separator=",">
                     #{id,jdbcType=BIGINT}

+ 8 - 0
sckw-modules/sckw-fleet/src/main/resources/mapper/KwfFleetMapper.xml

@@ -29,6 +29,14 @@
         <if test="endTime != null and endTime != '' " >
             and DATE( fl.create_time ) <![CDATA[ <= ]]> #{endTime,jdbcType=TIMESTAMP}
         </if>
+        <choose>
+            <when test="ids != null and ids != '' and ids.size() > 0">
+                and fl.id in
+                <foreach collection="ids" item="id" open="(" close=")" separator=",">
+                    #{id,jdbcType=BIGINT}
+                </foreach>
+            </when>
+        </choose>
         <if test="keywords != null and keywords != ''">
             and (
                 fl.name like concat('%',#{keywords},'%')

+ 4 - 4
sckw-modules/sckw-fleet/src/main/resources/mapper/KwfTruckMapper.xml

@@ -131,7 +131,7 @@
             and DATE( tr.create_time ) <![CDATA[ <= ]]> #{endTime,jdbcType=TIMESTAMP}
         </if>
         <choose>
-            <when test="ids != null">
+            <when test="ids != null and ids != '' and ids.size() > 0">
                 and tr.id in
                 <foreach collection="ids" item="id" open="(" close=")" separator=",">
                     #{id,jdbcType=BIGINT}
@@ -197,7 +197,7 @@
             and DATE( tr.create_time ) <![CDATA[ <= ]]> #{endTime,jdbcType=TIMESTAMP}
         </if>
         <choose>
-            <when test="ids != null">
+            <when test="ids != null and ids != '' and ids.size() > 0">
                 and tr.id in
                 <foreach collection="ids" item="id" open="(" close=")" separator=",">
                     #{id,jdbcType=BIGINT}
@@ -253,7 +253,7 @@
             and DATE( tr.create_time ) <![CDATA[ <= ]]> #{endTime,jdbcType=TIMESTAMP}
         </if>
         <choose>
-            <when test="truckNos != null and truckNos != ''">
+            <when test="truckNos != null and truckNos != '' and truckNos.size() > 0">
                 and tr.truck_no in
                 <foreach collection="truckNos" item="truckNo" open="(" close=")" separator=",">
                     #{truckNo,jdbcType=VARCHAR}
@@ -320,7 +320,7 @@
         from kwf_truck
         where del_flag = 0
         <choose>
-            <when test="entIds != null and entIds.size() > 0">
+            <when test="truckNos != null and truckNos != '' and truckNos.size() > 0">
                 and ent_id in
                 <foreach collection="entIds" item="item" open="(" close=")" separator=",">
                     #{item,jdbcType=BIGINT}

+ 1 - 1
sckw-modules/sckw-fleet/src/main/resources/mapper/KwfTruckReportMapper.xml

@@ -87,7 +87,7 @@
             and DATE( trr.create_time ) <![CDATA[ <= ]]> #{endTime,jdbcType=TIMESTAMP}
         </if>
         <choose>
-            <when test="ids != null">
+            <when test="ids != null and ids != '' and ids.size() > 0">
                 and trr.id in
                 <foreach collection="ids" item="id" open="(" close=")" separator=",">
                     #{id,jdbcType=BIGINT}