Browse Source

调用统计

ZhuDeKang 3 tháng trước cách đây
mục cha
commit
d348ceb313

+ 20 - 0
ruoyi-api-patform/src/main/java/com/ruoyi/interfaces/controller/PtServiceLogStatisServiceController.java

@@ -32,6 +32,13 @@ public class PtServiceLogStatisServiceController extends BaseController {
         return success(ptServiceLogStatis);
     }
 
+    @RequestMapping("/mdList")
+    public AjaxResult mdList(PtServiceLogStatis logStatis) {
+
+        List<PtServiceLogStatisVo> ptServiceLogStatis = logStatisServices.selectPtServiceLogStatisMdList(logStatis);
+        return success(ptServiceLogStatis);
+    }
+
     @RequestMapping("/toDaylist")
     public AjaxResult toDaylist(PtServiceLogStatis logStatis) {
         if (StringUtils.isNull(logStatis.getParams().get("beginTime"))) {
@@ -51,6 +58,19 @@ public class PtServiceLogStatisServiceController extends BaseController {
         return success(ptServiceLogStatis);
     }
 
+    @RequestMapping("/monthMdList")
+    public AjaxResult monthMdList(PtServiceLogStatis logStatis) {
+        List<PtServiceLogStatisVo> ptServiceLogStatis = logStatisServices.selectPtServiceLogStatisMonthMdList(logStatis);
+        return success(ptServiceLogStatis);
+    }
+
+    @RequestMapping("/yearMdList")
+    public AjaxResult yearMdList(PtServiceLogStatis logStatis) {
+        List<PtServiceLogStatisVo> ptServiceLogStatis = logStatisServices.selectPtServiceLogStatisYearMdList(logStatis);
+        return success(ptServiceLogStatis);
+    }
+
+
     @RequestMapping("/sum")
     public AjaxResult sum(PtServiceLogStatis logStatis) {
         List<PtServiceLogStatisVo> ptServiceLogStatis = logStatisServices.selectPtServiceLogStatis(logStatis);

+ 6 - 0
ruoyi-api-patform/src/main/java/com/ruoyi/interfaces/mapper/PtServiceLogStatisMapper.java

@@ -18,4 +18,10 @@ public interface PtServiceLogStatisMapper {
     int updatePtServiceLogStatis(PtServiceLogStatis serviceLogStatis);
 
     List<PtServiceLogStatisVo> selectPtServiceLogStatisMonthList(PtServiceLogStatis logStatis);
+
+    List<PtServiceLogStatisVo> selectPtServiceLogStatisMdList(PtServiceLogStatis logStatis);
+
+    List<PtServiceLogStatisVo> selectPtServiceLogStatisMonthMdList(PtServiceLogStatis logStatis);
+
+    List<PtServiceLogStatisVo> selectPtServiceLogStatisYearMdList(PtServiceLogStatis logStatis);
 }

+ 6 - 0
ruoyi-api-patform/src/main/java/com/ruoyi/interfaces/service/IPtServiceLogStatisService.java

@@ -12,4 +12,10 @@ public interface IPtServiceLogStatisService {
     List<PtServiceLogStatisVo> selectPtServiceLogStatis(PtServiceLogStatis logStatis);
 
     List<PtServiceLogStatisVo> selectPtServiceLogStatisMonthList(PtServiceLogStatis logStatis);
+
+    List<PtServiceLogStatisVo> selectPtServiceLogStatisMdList(PtServiceLogStatis logStatis);
+
+    List<PtServiceLogStatisVo> selectPtServiceLogStatisMonthMdList(PtServiceLogStatis logStatis);
+
+    List<PtServiceLogStatisVo> selectPtServiceLogStatisYearMdList(PtServiceLogStatis logStatis);
 }

+ 15 - 0
ruoyi-api-patform/src/main/java/com/ruoyi/interfaces/service/impl/PtServiceLogStatisServiceImpl.java

@@ -44,4 +44,19 @@ public class PtServiceLogStatisServiceImpl implements IPtServiceLogStatisService
 
         return ptServiceLogStatisMapper.selectPtServiceLogStatisMonthList(logStatis);
     }
+
+    @Override
+    public List<PtServiceLogStatisVo> selectPtServiceLogStatisMdList(PtServiceLogStatis logStatis) {
+        return ptServiceLogStatisMapper.selectPtServiceLogStatisMdList(logStatis);
+    }
+
+    @Override
+    public List<PtServiceLogStatisVo> selectPtServiceLogStatisMonthMdList(PtServiceLogStatis logStatis) {
+        return ptServiceLogStatisMapper.selectPtServiceLogStatisMonthMdList(logStatis);
+    }
+
+    @Override
+    public List<PtServiceLogStatisVo> selectPtServiceLogStatisYearMdList(PtServiceLogStatis logStatis) {
+        return ptServiceLogStatisMapper.selectPtServiceLogStatisYearMdList(logStatis);
+    }
 }

+ 119 - 0
ruoyi-api-patform/src/main/resources/mapper/interfaces/PtServiceLogStatisMapper.xml

@@ -116,4 +116,123 @@
             and s.name is not null
         </where>
     </select>
+    <select id="selectPtServiceLogStatisMdList"
+            resultMap="PtServiceLogStatisMap">
+        select l.STATIS_TM,
+        l.MD_ID,
+        '' as SER_ID,
+        '' as STATUS_CODE,
+        l.STATIS_NUM,
+        m.name as MD_NAME,
+        '' as SER_NAME
+        from (
+        SELECT
+        STATIS_TM ,MD_ID,sum(statis_num) statis_num
+        FROM (
+        SELECT t.* FROM PT_SERVICE_LOG_STATIS t
+        <where>
+            <if test="params.beginTime != null">
+                and STATIS_TM &gt;= to_date(#{params.beginTime},'yyyy-mm-dd')
+            </if>
+            <if test="params.endTime != null">
+                and STATIS_TM &lt;= to_date(#{params.endTime},'yyyy-mm-dd')
+            </if>
+            <if test="mdId != null and mdId != ''">
+                and t.MD_ID = #{mdId}
+            </if>
+            <if test="serId != null and serId != ''">
+                and t.SER_ID = #{serId}
+            </if>
+            <if test="statusCode != null and statusCode != ''">
+                and STATUS_CODE = #{statusCode}
+            </if>
+        </where>
+        ) GROUP BY STATIS_TM,MD_ID
+        ) l
+        left join md_model_info m on l.MD_ID = m.MDID
+        <where>
+            and m.name is not null
+        </where>
+
+
+    </select>
+    <select id="selectPtServiceLogStatisMonthMdList"
+            resultMap="PtServiceLogStatisMap">
+
+        select l.STATIS_TM,
+        l.MD_ID,
+        '' as SER_ID,
+        '' as STATUS_CODE,
+        l.STATIS_NUM,
+        m.name as MD_NAME,
+        '' as SER_NAME
+        from (
+        SELECT
+        mmdd AS STATIS_TM ,MD_ID,sum(statis_num) statis_num
+        FROM (
+        SELECT t.*,to_char(STATIS_TM,'yyyy-mm' ) || '-01' mmdd FROM PT_SERVICE_LOG_STATIS t
+        <where>
+            <if test="params.beginTime != null">
+                and STATIS_TM &gt;= to_date(#{params.beginTime},'yyyy-mm-dd')
+            </if>
+            <if test="params.endTime != null">
+                and STATIS_TM &lt;= to_date(#{params.endTime},'yyyy-mm-dd')
+            </if>
+            <if test="mdId != null and mdId != ''">
+                and t.MD_ID = #{mdId}
+            </if>
+            <if test="serId != null and serId != ''">
+                and t.SER_ID = #{serId}
+            </if>
+            <if test="statusCode != null and statusCode != ''">
+                and STATUS_CODE = #{statusCode}
+            </if>
+        </where>
+        ) GROUP BY mmdd,MD_ID
+        ) l
+        left join md_model_info m on l.MD_ID = m.MDID
+        <where>
+            and m.name is not null
+        </where>
+    </select>
+    <select id="selectPtServiceLogStatisYearMdList"
+            resultMap="PtServiceLogStatisMap">
+
+        select l.STATIS_TM,
+        l.MD_ID,
+        '' as SER_ID,
+        '' as STATUS_CODE,
+        l.STATIS_NUM,
+        m.name as MD_NAME,
+        '' as SER_NAME
+        from (
+        SELECT
+        mmdd AS STATIS_TM ,MD_ID,sum(statis_num) statis_num
+        FROM (
+        SELECT t.*,to_char(STATIS_TM,'yyyy' ) || '-01-01' mmdd FROM PT_SERVICE_LOG_STATIS t
+        <where>
+            <if test="params.beginTime != null">
+                and STATIS_TM &gt;= to_date(#{params.beginTime},'yyyy-mm-dd')
+            </if>
+            <if test="params.endTime != null">
+                and STATIS_TM &lt;= to_date(#{params.endTime},'yyyy-mm-dd')
+            </if>
+            <if test="mdId != null and mdId != ''">
+                and t.MD_ID = #{mdId}
+            </if>
+            <if test="serId != null and serId != ''">
+                and t.SER_ID = #{serId}
+            </if>
+            <if test="statusCode != null and statusCode != ''">
+                and STATUS_CODE = #{statusCode}
+            </if>
+        </where>
+        ) GROUP BY mmdd,MD_ID
+        ) l
+        left join md_model_info m on l.MD_ID = m.MDID
+        <where>
+            and m.name is not null
+        </where>
+
+    </select>
 </mapper>