From 71b6b716361c52af290493d365a328fc1a3467e2 Mon Sep 17 00:00:00 2001
From: nnnjjj123 <494715143@qq.com>
Date: Thu, 28 Jan 2021 11:15:06 +0800
Subject: [PATCH] 1.统计接口 2.健康码

---
 src/main/java/org/springblade/modules/healthcode/mapper/healthcodeMapper.xml |   30 +++++++++++++++++++++++++-----
 1 files changed, 25 insertions(+), 5 deletions(-)

diff --git a/src/main/java/org/springblade/modules/healthcode/mapper/healthcodeMapper.xml b/src/main/java/org/springblade/modules/healthcode/mapper/healthcodeMapper.xml
index 5975c42..dd55646 100644
--- a/src/main/java/org/springblade/modules/healthcode/mapper/healthcodeMapper.xml
+++ b/src/main/java/org/springblade/modules/healthcode/mapper/healthcodeMapper.xml
@@ -6,7 +6,7 @@
     <resultMap id="healthcodeResultMap" type="org.springblade.modules.healthcode.entity.healthcode">
         <id column="id" property="id"/>
         <result column="type" property="type"/>
-        <result column="jname" property="jname"/>
+        <result column="sex" property="sex"/>
         <result column="province" property="province"/>
         <result column="city" property="city"/>
         <result column="district" property="district"/>
@@ -18,8 +18,8 @@
             <if test="type!=null and type!=''">
                 type,
             </if>
-            <if test="jname!=null and jname!=''">
-                jname,
+            <if test="sex!=null and sex!=''">
+                sex,
             </if>
             <if test="province!=null and province!=''">
                 province,
@@ -40,8 +40,8 @@
             <if test="type!=null and type!=''">
                 #{type},
             </if>
-            <if test="jname!=null and jname!=''">
-                #{jname},
+            <if test="sex!=null and sex!=''">
+                #{sex},
             </if>
             <if test="province!=null and province!=''">
                 #{province},
@@ -61,4 +61,24 @@
         insert into healthcode(<include refid="key"/>) values(<include refid="value"/>)
     </insert>
 
+    <select id="selectCountr" resultType="java.util.HashMap">
+     SELECT
+	COUNT( * ) AS num,
+	type
+FROM
+	healthcode
+WHERE
+DATE_FORMAT(dtime,'%Y-%m-%d')=#{time} GROUP BY type
+    </select>
+
+    <select id="selectCountz" resultType="java.util.HashMap">
+        SELECT
+        COUNT( * ) AS num,
+        type
+        FROM
+        healthcode
+        WHERE
+        DATE_FORMAT(dtime,'%Y-%m-%d')&gt;=#{beginTime} and DATE_FORMAT(dtime,'%Y-%m-%d')&lt;=#{endTime} GROUP BY type
+    </select>
+
 </mapper>

--
Gitblit v1.9.3