魏熙美 hace 5 años
padre
commit
52c7f3a8b9
Se han modificado 1 ficheros con 30 adiciones y 35 borrados
  1. 30
    35
      src/main/resources/mapper/TaPersonMapper.xml

+ 30
- 35
src/main/resources/mapper/TaPersonMapper.xml Ver fichero

@@ -149,13 +149,13 @@ FROM
149 149
               DATE_FORMAT( DATE_SUB( now( ), INTERVAL a.rownum DAY ), '%Y-%m-%d' ) AS date
150 150
             FROM
151 151
               sequence a
152
-            WHERE
153
-                <if test="startDate == null or endDate == null">
154
-                    a.rownum <![CDATA[ <= ]]> 7
155
-                </if>
156
-                <if test="startDate != null or endDate != null">
157
-                    a.rownum <![CDATA[ <= ]]> datediff(#{endDate}, #{startDate})
158
-                </if>
152
+
153
+              <trim prefix="where">
154
+                  <if test="startDate != null or endDate != null">
155
+                      a.rownum <![CDATA[ <= ]]> datediff(#{endDate}, #{startDate})
156
+                  </if>
157
+              </trim>
158
+
159 159
         ) AS temp_date
160 160
         LEFT JOIN (
161 161
             SELECT
@@ -233,13 +233,13 @@ FROM
233 233
               </if>
234 234
             FROM
235 235
               sequence a
236
-            WHERE
237
-              <if test="startDate == null or endDate == null">
238
-                  a.rownum <![CDATA[ <= ]]> 7
239
-              </if>
240
-              <if test="startDate != null or endDate != null">
241
-                  a.rownum <![CDATA[ <= ]]> datediff(#{endDate}, #{startDate})
242
-              </if>
236
+
237
+              <trim prefix="where">
238
+                  <if test="startDate != null or endDate != null">
239
+                      a.rownum <![CDATA[ <= ]]> datediff(#{endDate}, #{startDate})
240
+                  </if>
241
+              </trim>
242
+
243 243
         ) AS temp_date
244 244
         LEFT JOIN (
245 245
             SELECT
@@ -267,14 +267,13 @@ FROM
267 267
               DATE_FORMAT( DATE_SUB( now( ), INTERVAL a.rownum DAY ), '%Y-%m-%d' ) AS date
268 268
             FROM
269 269
               sequence a
270
-            WHERE
271 270
 
272
-                <if test="startDate == null or endDate == null">
273
-                    a.rownum <![CDATA[ <= ]]> 7
274
-                </if>
275
-                <if test="startDate != null or endDate != null">
276
-                    a.rownum <![CDATA[ <= ]]> datediff(#{endDate}, #{startDate})
277
-                </if>
271
+                <trim prefix="where">
272
+                    <if test="startDate != null or endDate != null">
273
+                        a.rownum <![CDATA[ <= ]]> datediff(#{endDate}, #{startDate})
274
+                    </if>
275
+                </trim>
276
+
278 277
 
279 278
             ) AS temp_date
280 279
             LEFT JOIN (
@@ -299,14 +298,12 @@ FROM
299 298
              DATE_FORMAT( DATE_SUB( now( ), INTERVAL a.rownum DAY ), '%Y-%m-%d' ) AS date
300 299
             FROM
301 300
               sequence a
302
-            WHERE
303 301
 
304
-                <if test="startDate == null or endDate == null">
305
-                    a.rownum <![CDATA[ <= ]]> 7
306
-                </if>
307
-                <if test="startDate != null or endDate != null">
308
-                    a.rownum <![CDATA[ <= ]]> datediff(#{endDate}, #{startDate})
309
-                </if>
302
+                <trim prefix="where">
303
+                    <if test="startDate != null or endDate != null">
304
+                        a.rownum <![CDATA[ <= ]]> datediff(#{endDate}, #{startDate})
305
+                    </if>
306
+                </trim>
310 307
 
311 308
         ) AS temp_date
312 309
         LEFT JOIN (
@@ -394,14 +391,12 @@ FROM
394 391
             sequence a
395 392
             ,
396 393
             td_person_from tempf
397
-            WHERE
398 394
 
399
-                <if test="startDate == null or endDate == null">
400
-                    a.rownum <![CDATA[ <= ]]> 7
401
-                </if>
402
-                <if test="startDate != null or endDate != null">
403
-                    a.rownum <![CDATA[ <= ]]> datediff(#{endDate}, #{startDate})
404
-                </if>
395
+                <trim prefix="where">
396
+                    <if test="startDate != null or endDate != null">
397
+                        a.rownum <![CDATA[ <= ]]> datediff(#{endDate}, #{startDate})
398
+                    </if>
399
+                </trim>
405 400
 
406 401
         ) AS temp_date
407 402