From 3467fa64f4be6efc9b742913419e7c3a501c541b Mon Sep 17 00:00:00 2001
From: ZQN <364596817@qq.com>
Date: 星期四, 20 六月 2024 16:52:21 +0800
Subject: [PATCH] 云片短信对接,审批流程优化

---
 project-report/src/main/resources/mapper/report/ReportMapper.xml |  126 ++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 126 insertions(+), 0 deletions(-)

diff --git a/project-report/src/main/resources/mapper/report/ReportMapper.xml b/project-report/src/main/resources/mapper/report/ReportMapper.xml
new file mode 100644
index 0000000..2032c8d
--- /dev/null
+++ b/project-report/src/main/resources/mapper/report/ReportMapper.xml
@@ -0,0 +1,126 @@
+<?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="com.project.report.mapper.ReportMapper">
+
+    <!--    鎵ф硶娆℃暟鏈堝害鍒嗗竷-->
+    <select id="getMonthCount"
+            parameterType="com.project.report.domain.bo.query.ReportQueryBo"
+            resultType="com.project.common.vo.KeyVal">
+        select
+            MONTH(apply_time) AS k,
+            IFNULL(count(order_id),0) as v
+        from enforce_order
+        where 1=1
+        <if test="deptId != null ">
+            AND apply_dept_id = #{deptId}
+        </if>
+        <if test="beginTime!=null and beginTime!=''">
+            AND apply_time &gt;= #{beginTime}
+        </if>
+        <if test="endTime!=null and endTime!=''">
+            AND apply_time &lt;= #{endTime}
+        </if>
+        GROUP BY k
+    </select>
+
+    <!--    鎵ф硶娆℃暟閮ㄩ棬鍒嗗竷-->
+    <select id="getDeptCount"
+            parameterType="com.project.report.domain.bo.query.ReportQueryBo"
+            resultType="com.project.common.vo.KeyVal">
+        select
+        check_dept_id AS k,
+        IFNULL(count(order_id),0) as v
+        from enforce_order
+        where 1=1
+        <if test="beginTime!=null and beginTime!=''">
+            AND apply_time &gt;= #{beginTime}
+        </if>
+        <if test="endTime!=null and endTime!=''">
+            AND apply_time &lt;= #{endTime}
+        </if>
+        GROUP BY k
+    </select>
+
+    <!--    琚墽娉曟鏁颁紒涓氬垎甯�-->
+    <select id="getCompanyCount"
+            parameterType="com.project.report.domain.bo.query.ReportQueryBo"
+            resultType="com.project.common.vo.KeyVal">
+        select
+        company_id AS k,
+        IFNULL(count(order_id),0) as v
+        from enforce_order
+        where 1=1
+        <if test="beginTime!=null and beginTime!=''">
+            AND apply_time &gt;= #{beginTime}
+        </if>
+        <if test="endTime!=null and endTime!=''">
+            AND apply_time &lt;= #{endTime}
+        </if>
+        GROUP BY k order by v desc
+    </select>
+
+    <!--    鎵ф硶绫诲瀷鍒嗗竷-->
+    <select id="getEnforceTypeCount"
+            parameterType="com.project.report.domain.bo.query.ReportQueryBo"
+            resultType="com.project.common.vo.KeyVal">
+        select
+        enforce_type AS k,
+        IFNULL(count(order_id),0) as v
+        from enforce_order
+        where 1=1
+        <if test="beginTime!=null and beginTime!=''">
+            AND apply_time &gt;= #{beginTime}
+        </if>
+        <if test="endTime!=null and endTime!=''">
+            AND apply_time &lt;= #{endTime}
+        </if>
+        GROUP BY k
+    </select>
+
+    <!--    鎶曡瘔澶勭悊鐘舵��-->
+    <select id="getComplaintStatusCount"
+            parameterType="com.project.report.domain.bo.query.ReportQueryBo"
+            resultType="com.project.common.vo.KeyVal">
+        select
+        complaint_status AS k,
+        IFNULL(count(id),0) as v
+        from enforce_complaint_log
+        where 1=1
+        <if test="beginTime!=null and beginTime!=''">
+            AND apply_time &gt;= #{beginTime}
+        </if>
+        <if test="endTime!=null and endTime!=''">
+            AND apply_time &lt;= #{endTime}
+        </if>
+        GROUP BY k
+    </select>
+
+    <!--    鎵ф硶绫诲瀷鍒嗗竷-->
+    <select id="getComplaintTypeCount"
+            parameterType="com.project.report.domain.bo.query.ReportQueryBo"
+            resultType="com.project.common.vo.KeyVal">
+        select
+        complaint_type AS k,
+        IFNULL(count(id),0) as v
+        from enforce_complaint_log
+        where 1=1
+        <if test="beginTime!=null and beginTime!=''">
+            AND apply_time &gt;= #{beginTime}
+        </if>
+        <if test="endTime!=null and endTime!=''">
+            AND apply_time &lt;= #{endTime}
+        </if>
+        <if test="doComplaint!=null ">
+            <if test="doComplaint == 0 ">
+                AND complaint_status = 0
+            </if>
+            <if test="doComplaint == 1 ">
+                AND complaint_status != 0
+            </if>
+        </if>
+        GROUP BY k
+    </select>
+
+</mapper>

--
Gitblit v1.9.1