瀏覽代碼

更改sql

yumeng 6 年之前
父節點
當前提交
0f705c9345

+ 1 - 7
module-report/src/main/java/cn/com/ctop/bytedance/mapper/BytedanceCampaignDailyReportMapper.java

@@ -12,11 +12,5 @@ import org.apache.ibatis.annotations.Param;
  * @Version: V1.0
  */
 public interface BytedanceCampaignDailyReportMapper extends BaseMapper<BytedanceCampaignDailyReport> {
-    /**
-     * 今日消耗
-     *
-     * @param date
-     * @return
-     */
-    ReportVO selectDayReport(@Param("date") String date);
+
 }

+ 2 - 8
module-report/src/main/java/cn/com/ctop/bytedance/mapper/BytedanceReportMapper.java

@@ -14,7 +14,8 @@ public interface BytedanceReportMapper {
      * @param date
      * @return
      */
-    //   ReportVO selectDayReport(@Param("date") String date);
+    JSONObject selectDayReport(@Param("date") String date);
+
 
     /**
      * 查询明细
@@ -40,13 +41,6 @@ public interface BytedanceReportMapper {
      */
     JSONObject selectAllAccount();
 
-    /**
-     * 查询 昨日消耗
-     *
-     * @param anotherDay
-     * @return
-     */
-    JSONObject selectYesterday(@Param("date") String anotherDay);
 
     /**
      * 根据日期 小时 查询信息

+ 1 - 4
module-report/src/main/java/cn/com/ctop/bytedance/mapper/xml/BytedanceCampaignDailyReportMapper.xml

@@ -1,15 +1,5 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="cn.com.ctop.bytedance.mapper.BytedanceCampaignDailyReportMapper">
-    <select id="selectDayReport" resultType="cn.com.ctop.bytedance.vo.ReportVO">
-      select
-1,2,3,4
-    </select>
+
 </mapper>

+ 2 - 12
module-report/src/main/java/cn/com/ctop/bytedance/mapper/xml/BytedanceReportMapper.xml

@@ -3,7 +3,7 @@
 <mapper namespace="cn.com.ctop.bytedance.mapper.BytedanceReportMapper">
 
 
-    <!--  <select id="selectDayReport" resultType="cn.com.ctop.bytedance.vo.ReportVO">
+    <select id="selectDayReport" resultType="com.alibaba.fastjson.JSONObject">
         select
          sum(charge) cost,
          sum(photo_show) photoShow,
@@ -12,18 +12,8 @@
        from
         ctop_kuaishou_report_hourly_account
         where stat_date = #{date}
-      </select>-->
+      </select>
 
-    <select id="selectYesterday" resultType="com.alibaba.fastjson.JSONObject">
-      select
-       sum(charge) cost,
-       sum(photo_show) photoShow,
-       sum(photo_click) photoClick,
-       sum(aclick) aclick
-     from
-      ctop_kuaishou_report_hourly_account
-      where stat_date = #{date}
-    </select>
 
 
     <select id="selectByDate" resultType="com.alibaba.fastjson.JSONObject">

+ 4 - 6
module-report/src/main/java/cn/com/ctop/bytedance/service/impl/BytedanceReportServiceImpl.java

@@ -208,11 +208,9 @@ public class BytedanceReportServiceImpl implements IBytedanceReportService {
             String nowDate = DateUtils.getNowDate("yyyy-MM-dd"); // 当前日期
             String anotherDay = DateUtils.getAnotherDay("yyyy-MM-dd", nowDate, -1); // 当前日期-1
             if (type == 1) { // 今日总消耗
-                ReportVO reportVO = campaignDailyReportMapper.selectDayReport(nowDate);
-                System.err.println("12312312313131313131313131313131");
-                System.err.println(reportVO.toString());
-                System.err.println("----------------------------------------------");
-                JSONObject yesterJson = reportMapper.selectYesterday(anotherDay);
+                accountJson = reportMapper.selectDayReport(nowDate);
+
+                JSONObject yesterJson = reportMapper.selectDayReport(anotherDay);
                 if (!Check.isNull(yesterJson)) {
                     BigDecimal cost = accountJson.getBigDecimal("cost"); // 今日消耗
                     BigDecimal yesterCost = yesterJson.getBigDecimal("cost");// 昨日消耗
@@ -254,7 +252,7 @@ public class BytedanceReportServiceImpl implements IBytedanceReportService {
                 }
 
             } else if (type == 2) { // 昨日总消耗
-                accountJson = reportMapper.selectYesterday(anotherDay);
+                accountJson = reportMapper.selectDayReport(anotherDay);
 
             } else if (type == 3) { // 近七天
                 String endDate = DateUtils.getAnotherDay("yyyy-MM-dd", anotherDay, -7);