liyg 2 lat temu
rodzic
commit
64e1cdcae9

+ 10 - 2
src/main/java/com/steerinfo/dil/controller/StatisticalReportController.java

@@ -918,7 +918,11 @@ public class StatisticalReportController extends BaseRESTfulController {
                                             String saler,
                                             String easPrimaryId
     ){
-        DataChange.queryDataByDateTimeYestDay(startTime, endTime, map, sdfDateTime);//根时间段查询数据
+        if(map.get("saleMakeDate")!=null){
+            DataChange.queryDataByDateTime(startTime, endTime, map, sdfDateTime);//根据时间段查询数据
+        }else{
+            DataChange.queryDataByDateTimeYestDay(startTime, endTime, map, sdfDateTime);//根据时间段查询数据
+        }
         if(carrierSsoId != null){
             if(!"null".equals(carrierSsoId) && carrierSsoId != null){
                 map.put("carrierSsoId", carrierSsoId);
@@ -1027,7 +1031,11 @@ public class StatisticalReportController extends BaseRESTfulController {
                                                String saler,
                                                String easPrimaryId
     ){
-        DataChange.queryDataByDateTimeYestDay(startTime, endTime, map, sdfDateTime);//根据时间段查询数据
+        if(map.get("saleMakeDate")!=null){
+            DataChange.queryDataByDateTime(startTime, endTime, map, sdfDateTime);//根据时间段查询数据
+        }else{
+            DataChange.queryDataByDateTimeYestDay(startTime, endTime, map, sdfDateTime);//根据时间段查询数据
+        }
         if(carrierSsoId != null){
             if(!"null".equals(carrierSsoId) && carrierSsoId != null){
                 map.put("carrierSsoId", carrierSsoId);

+ 18 - 4
src/main/resources/com/steerinfo/dil/mapper/StatisticalReportMapper.xml

@@ -2484,16 +2484,23 @@
         and (aso.DELETED between 1 and 2 and aso.SALE_ORDER_STATUS = 4 or aso.DELETED = 0 and aso.SALE_ORDER_STATUS between 0 and 4)
         and ASM.SALE_MATERIAL_ID IS NOT NULL
         and (BDO.WETHER_TO_STATEMENT IS NULL or BDO.WETHER_TO_STATEMENT != 1)
-        <if test="oneDate != null">
+        <if test="oneDate != null and saleMakeDate == null">
             and to_date(#{oneDate}, 'yyyy-mm-dd') &lt; = to_date(to_char(ASOM.SALE_DATE_OF_RECEIPT-1,'yyyy-mm-dd'),'yyyy-mm-dd')
         </if>
         <if test="carrierSsoId != null">
             and R_CARRIER.CARRIER_SSO_ID = #{carrierSsoId}
         </if>
-        <if test="startDate != null">
+        <if test="startDate != null and saleMakeDate == null">
             and to_date(#{startDate}, 'yyyy-mm-dd') &lt;=  to_date(to_char(ASOM.SALE_DATE_OF_RECEIPT-1,'yyyy-mm-dd'),'yyyy-mm-dd')
             and to_date(#{endDate}, 'yyyy-mm-dd') >=  to_date(to_char(ASOM.SALE_DATE_OF_RECEIPT-1,'yyyy-mm-dd'),'yyyy-mm-dd')
         </if>
+        <if test="oneDate != null and saleMakeDate != null">
+            and to_date(#{oneDate}, 'yyyy-mm-dd') = to_date(to_char(ASM.SALE_MAKE_DATE,'yyyy-mm-dd'),'yyyy-mm-dd')
+        </if>
+        <if test="startDate != null and saleMakeDate != null">
+            and to_date(#{startDate}, 'yyyy-mm-dd hh24:mi:ss') &lt;=  ASM.SALE_MAKE_DATE
+            and to_date(#{endDate}, 'yyyy-mm-dd hh24:mi:ss') >=  ASM.SALE_MAKE_DATE
+        </if>
         <if test="remark != null" >
             and RSR.SALER_NAME || RCA.CAPACITY_NUMBER || RC.CONSIGNEE_COMPANY_NAME || R_CARRIER.CARRIER_ABBREVIATION || RM.MATERIAL_NAME || RM.MATERIAL_MODEL || RM.MATERIAL_SPECIFICATION
             || (CASE WHEN RRA_HISTORY.ADDRESS_PROVINCE is not null
@@ -2807,16 +2814,23 @@
         and ASM.SALE_MATERIAL_ID IS NOT NULL
         and BDO.WETHER_TO_STATEMENT = 1
         and BDO.STATEMENT_ID IS NULL
-        <if test="oneDate != null">
+        <if test="oneDate != null  and saleMakeDate == null">
             and to_date(#{oneDate}, 'yyyy-mm-dd') &lt; = to_date(to_char(ASOM.SALE_DATE_OF_RECEIPT-1,'yyyy-mm-dd'),'yyyy-mm-dd')
         </if>
         <if test="carrierSsoId != null">
             and R_CARRIER.CARRIER_SSO_ID = #{carrierSsoId}
         </if>
-        <if test="startDate != null">
+        <if test="startDate != null  and saleMakeDate == null">
             and to_date(#{startDate}, 'yyyy-mm-dd') &lt;=  to_date(to_char(ASOM.SALE_DATE_OF_RECEIPT-1,'yyyy-mm-dd'),'yyyy-mm-dd')
             and to_date(#{endDate}, 'yyyy-mm-dd') >=  to_date(to_char(ASOM.SALE_DATE_OF_RECEIPT-1,'yyyy-mm-dd'),'yyyy-mm-dd')
         </if>
+        <if test="oneDate != null and saleMakeDate != null">
+            and to_date(#{oneDate}, 'yyyy-mm-dd') = to_date(to_char(ASM.SALE_MAKE_DATE,'yyyy-mm-dd'),'yyyy-mm-dd')
+        </if>
+        <if test="startDate != null and saleMakeDate != null">
+            and to_date(#{startDate}, 'yyyy-mm-dd hh24:mi:ss') &lt;=  ASM.SALE_MAKE_DATE
+            and to_date(#{endDate}, 'yyyy-mm-dd hh24:mi:ss') >=  ASM.SALE_MAKE_DATE
+        </if>
         <if test="remark != null" >
             and RSR.SALER_NAME || RCA.CAPACITY_NUMBER || RC.CONSIGNEE_COMPANY_NAME || R_CARRIER.CARRIER_ABBREVIATION || RM.MATERIAL_NAME || RM.MATERIAL_MODEL || RM.MATERIAL_SPECIFICATION
             || (CASE WHEN RRA_HISTORY.ADDRESS_PROVINCE is not null