魏熙美 5 years ago
parent
commit
fbddd2e054
1 changed files with 6 additions and 7 deletions
  1. 6
    7
      src/main/resources/mapper/TaPersonMapper.xml

+ 6
- 7
src/main/resources/mapper/TaPersonMapper.xml View File

@@ -180,13 +180,12 @@ FROM
180 180
         SELECT
181 181
           DATE_FORMAT( DATE_SUB( now( ), INTERVAL a.rownum DAY ), '%Y-%m-%d' ) AS date, b.type_id, b.type_name
182 182
           from sequence a, td_biz_event_type b
183
-          where
184
-            <if test="startDate == null or endDate == null">
185
-                a.rownum <![CDATA[ <= ]]> 7
186
-            </if>
187
-            <if test="startDate != null or endDate != null">
188
-                a.rownum <![CDATA[ <= ]]> datediff(#{endDate}, #{startDate})
189
-            </if>
183
+
184
+            <trim prefix="where">
185
+                <if test="startDate != null or endDate != null">
186
+                    a.rownum <![CDATA[ <= ]]> datediff(#{endDate}, #{startDate})
187
+                </if>
188
+            </trim>
190 189
 
191 190
         ) AS temp_date
192 191