魏熙美 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
               DATE_FORMAT( DATE_SUB( now( ), INTERVAL a.rownum DAY ), '%Y-%m-%d' ) AS date
149
               DATE_FORMAT( DATE_SUB( now( ), INTERVAL a.rownum DAY ), '%Y-%m-%d' ) AS date
150
             FROM
150
             FROM
151
               sequence a
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
         ) AS temp_date
159
         ) AS temp_date
160
         LEFT JOIN (
160
         LEFT JOIN (
161
             SELECT
161
             SELECT
233
               </if>
233
               </if>
234
             FROM
234
             FROM
235
               sequence a
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
         ) AS temp_date
243
         ) AS temp_date
244
         LEFT JOIN (
244
         LEFT JOIN (
245
             SELECT
245
             SELECT
267
               DATE_FORMAT( DATE_SUB( now( ), INTERVAL a.rownum DAY ), '%Y-%m-%d' ) AS date
267
               DATE_FORMAT( DATE_SUB( now( ), INTERVAL a.rownum DAY ), '%Y-%m-%d' ) AS date
268
             FROM
268
             FROM
269
               sequence a
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
             ) AS temp_date
278
             ) AS temp_date
280
             LEFT JOIN (
279
             LEFT JOIN (
299
              DATE_FORMAT( DATE_SUB( now( ), INTERVAL a.rownum DAY ), '%Y-%m-%d' ) AS date
298
              DATE_FORMAT( DATE_SUB( now( ), INTERVAL a.rownum DAY ), '%Y-%m-%d' ) AS date
300
             FROM
299
             FROM
301
               sequence a
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
         ) AS temp_date
308
         ) AS temp_date
312
         LEFT JOIN (
309
         LEFT JOIN (
394
             sequence a
391
             sequence a
395
             ,
392
             ,
396
             td_person_from tempf
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
         ) AS temp_date
401
         ) AS temp_date
407
 
402