Selaa lähdekoodia

销售订单报表 时间

liuchaohui 3 vuotta sitten
vanhempi
commit
bbf8b3ee6a

+ 15 - 9
jeecg-boot-module-system/src/main/java/org/jeecg/modules/report/mapper/xml/SoSoDetailsMapper.xml

@@ -25,9 +25,11 @@
         ) v on ss.cCusCode=v.cVenCode
         left join Department de on ss.cDepCode=de.cDepCode
         left join Customer cc on ss.cCusCode = cc.cCusCode
-        WHERE
-        CONVERT ( CHAR ( 7 ), ss.dPreDateBT, 120 ) <![CDATA[ >= ]]> #{map.startYearMonth}
-        AND CONVERT ( CHAR ( 7 ), ss.dPreDateBT, 120 ) <![CDATA[ <= ]]> #{map.endYearMonth}
+        WHERE 1=1
+        <if test="map.startYearMonth!=null and map.startYearMonth!='' and map.endYearMonth!=null and map.endYearMonth!=''">
+            AND CONVERT ( CHAR ( 7 ), ss.dPreDateBT, 120 ) <![CDATA[ >= ]]> #{map.startYearMonth}
+            AND CONVERT ( CHAR ( 7 ), ss.dPreDateBT, 120 ) <![CDATA[ <= ]]> #{map.endYearMonth}
+        </if>
         <if test="map.vendorType!=null and map.vendorType!='' and map.vendorType=='内部'">
             and (v.cVenAbbName='宁波森语' or  v.cVenAbbName='马菲羊' or  v.cVenAbbName='森语集团')
         </if>
@@ -57,9 +59,11 @@
         left join Vendor v on ss.cCusCode=v.cVenCode
         left join Department de on ss.cDepCode=de.cDepCode
         left join Customer cc on ss.cCusCode = cc.cCusCode
-        WHERE
-        CONVERT ( CHAR ( 7 ), ss.dPreDateBT, 120 ) <![CDATA[ >= ]]> #{startYearMonth}
-        AND CONVERT ( CHAR ( 7 ), ss.dPreDateBT, 120 ) <![CDATA[ <= ]]> #{endYearMonth}
+        WHERE 1=1
+        <if test="startYearMonth!=null and startYearMonth!='' and endYearMonth!=null and endYearMonth!=''">
+            AND CONVERT ( CHAR ( 7 ), ss.dPreDateBT, 120 ) <![CDATA[ >= ]]> #{startYearMonth}
+            AND CONVERT ( CHAR ( 7 ), ss.dPreDateBT, 120 ) <![CDATA[ <= ]]> #{endYearMonth}
+        </if>
         <if test="vendorType!=null and vendorType!='' and vendorType=='内部'">
             and (v.cVenAbbName='宁波森语' or  v.cVenAbbName='马菲羊' or  v.cVenAbbName='森语集团')
         </if>
@@ -85,9 +89,11 @@
         left join Vendor v on ss.cCusCode=v.cVenCode
         left join Customer cc on ss.cCusCode = cc.cCusCode
         left join Department de on ss.cDepCode=de.cDepCode
-        WHERE
-        CONVERT ( CHAR ( 7 ), ss.dPreDateBT, 120 ) <![CDATA[ >= ]]> #{startYearMonth}
-        AND CONVERT ( CHAR ( 7 ), ss.dPreDateBT, 120 ) <![CDATA[ <= ]]> #{endYearMonth}
+        WHERE 1=1
+        <if test="startYearMonth!=null and startYearMonth!='' and endYearMonth!=null and endYearMonth!=''">
+            AND CONVERT ( CHAR ( 7 ), ss.dPreDateBT, 120 ) <![CDATA[ >= ]]> #{startYearMonth}
+            AND CONVERT ( CHAR ( 7 ), ss.dPreDateBT, 120 ) <![CDATA[ <= ]]> #{endYearMonth}
+        </if>
         <if test="vendorType!=null and vendorType!='' and vendorType=='内部'">
             and (v.cVenAbbName='宁波森语' or  v.cVenAbbName='马菲羊' or  v.cVenAbbName='森语集团')
         </if>