|
@@ -0,0 +1,363 @@
|
|
|
|
+<?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.diagbot.mapper.OptInfoMapper">
|
|
|
|
+
|
|
|
|
+ <!-- 通用查询映射结果 -->
|
|
|
|
+ <resultMap id="BaseResultMap" type="com.diagbot.entity.OptInfo">
|
|
|
|
+ <id column="id" property="id" />
|
|
|
|
+ <result column="is_deleted" property="isDeleted" />
|
|
|
|
+ <result column="gmt_create" property="gmtCreate" />
|
|
|
|
+ <result column="gmt_modified" property="gmtModified" />
|
|
|
|
+ <result column="creator" property="creator" />
|
|
|
|
+ <result column="modifier" property="modifier" />
|
|
|
|
+ <!--<result column="hospital_code" property="hospitalCode" />-->
|
|
|
|
+ <result column="app_id" property="appId" />
|
|
|
|
+ <result column="organ_name" property="organName" />
|
|
|
|
+ <result column="department" property="department" />
|
|
|
|
+ <result column="doctor_id" property="doctorId" />
|
|
|
|
+ <result column="doctor_name" property="doctorName" />
|
|
|
|
+ <result column="mpi_id" property="mpiId" />
|
|
|
|
+ <result column="patient_name" property="patientName" />
|
|
|
|
+ <result column="patient_age" property="patientAge" />
|
|
|
|
+ <result column="patient_sex" property="patientSex" />
|
|
|
|
+ <result column="ip" property="ip" />
|
|
|
|
+ <result column="opt_type" property="optType" />
|
|
|
|
+ <result column="remark" property="remark" />
|
|
|
|
+ </resultMap>
|
|
|
|
+
|
|
|
|
+ <select id="getPV" parameterType="com.diagbot.vo.OptVO" resultType="com.diagbot.dto.PVDTO">
|
|
|
|
+ SELECT
|
|
|
|
+ DATE_FORMAT(gmt_create, '%Y-%m-%d') AS days,
|
|
|
|
+ count(1) AS pvCnt
|
|
|
|
+ FROM
|
|
|
|
+ znwz_opt_info
|
|
|
|
+ WHERE
|
|
|
|
+ opt_type = 1
|
|
|
|
+ <!--<if test="hospitalCode != null and hospitalCode != ''">-->
|
|
|
|
+ <!--AND hospital_code = #{hospitalCode}-->
|
|
|
|
+ <!--</if>-->
|
|
|
|
+ <if test="startDate!=null">
|
|
|
|
+ AND gmt_create >= #{startDate}
|
|
|
|
+ </if>
|
|
|
|
+ <if test="endDate!=null">
|
|
|
|
+ AND gmt_create <= #{endDate}
|
|
|
|
+ </if>
|
|
|
|
+ GROUP BY
|
|
|
|
+ DATE_FORMAT(gmt_create, '%Y-%m-%d')
|
|
|
|
+ ORDER BY
|
|
|
|
+ DATE_FORMAT(gmt_create, '%Y-%m-%d');
|
|
|
|
+ </select>
|
|
|
|
+
|
|
|
|
+ <select id="getPVSum" parameterType="com.diagbot.vo.OptVO" resultType="java.lang.Long">
|
|
|
|
+ SELECT
|
|
|
|
+ count(1) AS pvSum
|
|
|
|
+ FROM
|
|
|
|
+ znwz_opt_info
|
|
|
|
+ WHERE
|
|
|
|
+ opt_type = 1
|
|
|
|
+ <!--<if test="hospitalCode != null and hospitalCode != ''">-->
|
|
|
|
+ <!--AND hospital_code = #{hospitalCode}-->
|
|
|
|
+ <!--</if>-->
|
|
|
|
+ <if test="startDate!=null">
|
|
|
|
+ AND gmt_create >= #{startDate}
|
|
|
|
+ </if>
|
|
|
|
+ <if test="endDate!=null">
|
|
|
|
+ AND gmt_create <= #{endDate}
|
|
|
|
+ </if>
|
|
|
|
+ </select>
|
|
|
|
+
|
|
|
|
+ <select id="getUV" parameterType="com.diagbot.vo.OptVO" resultType="com.diagbot.dto.UVDTO">
|
|
|
|
+ SELECT
|
|
|
|
+ t.days AS days,
|
|
|
|
+ count(ip) AS uvCnt
|
|
|
|
+ FROM
|
|
|
|
+ (
|
|
|
|
+ SELECT DISTINCT
|
|
|
|
+ DATE_FORMAT(gmt_create, '%Y-%m-%d') AS days,
|
|
|
|
+ ip
|
|
|
|
+ FROM
|
|
|
|
+ znwz_opt_info
|
|
|
|
+ WHERE
|
|
|
|
+ opt_type = 1
|
|
|
|
+ <!--<if test="hospitalCode != null and hospitalCode != ''">-->
|
|
|
|
+ <!--AND hospital_code = #{hospitalCode}-->
|
|
|
|
+ <!--</if>-->
|
|
|
|
+ <if test="startDate!=null">
|
|
|
|
+ AND gmt_create >= #{startDate}
|
|
|
|
+ </if>
|
|
|
|
+ <if test="endDate!=null">
|
|
|
|
+ AND gmt_create <= #{endDate}
|
|
|
|
+ </if>
|
|
|
|
+ ) t
|
|
|
|
+ GROUP BY
|
|
|
|
+ days
|
|
|
|
+ ORDER BY
|
|
|
|
+ days;
|
|
|
|
+ </select>
|
|
|
|
+
|
|
|
|
+ <select id="getUVSum" parameterType="com.diagbot.vo.OptVO" resultType="java.lang.Long">
|
|
|
|
+ SELECT
|
|
|
|
+ count(ip) AS uvSum
|
|
|
|
+ FROM
|
|
|
|
+ (
|
|
|
|
+ SELECT DISTINCT
|
|
|
|
+ DATE_FORMAT(gmt_create, '%Y-%m-%d') AS days,
|
|
|
|
+ ip
|
|
|
|
+ FROM
|
|
|
|
+ znwz_opt_info
|
|
|
|
+ WHERE
|
|
|
|
+ opt_type = 1
|
|
|
|
+ <!--<if test="hospitalCode != null and hospitalCode != ''">-->
|
|
|
|
+ <!--AND hospital_code = #{hospitalCode}-->
|
|
|
|
+ <!--</if>-->
|
|
|
|
+ <if test="startDate!=null">
|
|
|
|
+ AND gmt_create >= #{startDate}
|
|
|
|
+ </if>
|
|
|
|
+ <if test="endDate!=null">
|
|
|
|
+ AND gmt_create <= #{endDate}
|
|
|
|
+ </if>
|
|
|
|
+ ) t;
|
|
|
|
+ </select>
|
|
|
|
+
|
|
|
|
+ <select id="getZZ" parameterType="com.diagbot.vo.OptVO" resultType="com.diagbot.dto.ZZDTO">
|
|
|
|
+ SELECT
|
|
|
|
+ t.days AS days,
|
|
|
|
+ count(ip) AS zzCnt
|
|
|
|
+ FROM
|
|
|
|
+ (
|
|
|
|
+ SELECT DISTINCT
|
|
|
|
+ DATE_FORMAT(gmt_create, '%Y-%m-%d') AS days,
|
|
|
|
+ ip
|
|
|
|
+ FROM
|
|
|
|
+ znwz_opt_info
|
|
|
|
+ WHERE
|
|
|
|
+ opt_type = 2
|
|
|
|
+ <!--<if test="hospitalCode != null and hospitalCode != ''">-->
|
|
|
|
+ <!--AND hospital_code = #{hospitalCode}-->
|
|
|
|
+ <!--</if>-->
|
|
|
|
+ <if test="startDate!=null">
|
|
|
|
+ AND gmt_create >= #{startDate}
|
|
|
|
+ </if>
|
|
|
|
+ <if test="endDate!=null">
|
|
|
|
+ AND gmt_create <= #{endDate}
|
|
|
|
+ </if>
|
|
|
|
+ ) t
|
|
|
|
+ GROUP BY
|
|
|
|
+ days
|
|
|
|
+ ORDER BY
|
|
|
|
+ days;
|
|
|
|
+ </select>
|
|
|
|
+
|
|
|
|
+ <select id="getZZSum" parameterType="com.diagbot.vo.OptVO" resultType="java.lang.Long">
|
|
|
|
+ SELECT
|
|
|
|
+ count(ip) AS zzSum
|
|
|
|
+ FROM
|
|
|
|
+ (
|
|
|
|
+ SELECT DISTINCT
|
|
|
|
+ DATE_FORMAT(gmt_create, '%Y-%m-%d') AS days,
|
|
|
|
+ ip
|
|
|
|
+ FROM
|
|
|
|
+ znwz_opt_info
|
|
|
|
+ WHERE
|
|
|
|
+ opt_type = 2
|
|
|
|
+ <!--<if test="hospitalCode != null and hospitalCode != ''">-->
|
|
|
|
+ <!--AND hospital_code = #{hospitalCode}-->
|
|
|
|
+ <!--</if>-->
|
|
|
|
+ <if test="startDate!=null">
|
|
|
|
+ AND gmt_create >= #{startDate}
|
|
|
|
+ </if>
|
|
|
|
+ <if test="endDate!=null">
|
|
|
|
+ AND gmt_create <= #{endDate}
|
|
|
|
+ </if>
|
|
|
|
+ ) t;
|
|
|
|
+ </select>
|
|
|
|
+
|
|
|
|
+ <!--按照医院合计-->
|
|
|
|
+ <select id="getPVHosp" parameterType="com.diagbot.vo.OptVO" resultType="com.diagbot.dto.PVHospDTO">
|
|
|
|
+ SELECT
|
|
|
|
+ hospital_code AS hospitalCode,
|
|
|
|
+ DATE_FORMAT(gmt_create, '%Y-%m-%d') AS days,
|
|
|
|
+ count(1) AS pvCnt
|
|
|
|
+ FROM
|
|
|
|
+ znwz_opt_info
|
|
|
|
+ WHERE
|
|
|
|
+ opt_type = 1
|
|
|
|
+ <!--<if test="hospitalCode != null and hospitalCode != ''">-->
|
|
|
|
+ <!--AND hospital_code = #{hospitalCode}-->
|
|
|
|
+ <!--</if>-->
|
|
|
|
+ <if test="startDate!=null">
|
|
|
|
+ AND gmt_create >= #{startDate}
|
|
|
|
+ </if>
|
|
|
|
+ <if test="endDate!=null">
|
|
|
|
+ AND gmt_create <= #{endDate}
|
|
|
|
+ </if>
|
|
|
|
+-- AND hospital_code !='朗通通用'
|
|
|
|
+ GROUP BY
|
|
|
|
+ hospital_code,
|
|
|
|
+ DATE_FORMAT(gmt_create, '%Y-%m-%d')
|
|
|
|
+ ORDER BY
|
|
|
|
+ hospital_code,
|
|
|
|
+ DATE_FORMAT(gmt_create, '%Y-%m-%d');
|
|
|
|
+ </select>
|
|
|
|
+
|
|
|
|
+ <select id="getPVSumHosp" parameterType="com.diagbot.vo.OptVO" resultType="com.diagbot.dto.PVHospSumDTO">
|
|
|
|
+ SELECT
|
|
|
|
+ hospital_code AS hospitalCode,
|
|
|
|
+ count(1) AS pvSum
|
|
|
|
+ FROM
|
|
|
|
+ znwz_opt_info
|
|
|
|
+ WHERE
|
|
|
|
+ opt_type = 1
|
|
|
|
+ <!--<if test="hospitalCode != null and hospitalCode != ''">-->
|
|
|
|
+ <!--AND hospital_code = #{hospitalCode}-->
|
|
|
|
+ <!--</if>-->
|
|
|
|
+ <if test="startDate!=null">
|
|
|
|
+ AND gmt_create >= #{startDate}
|
|
|
|
+ </if>
|
|
|
|
+ <if test="endDate!=null">
|
|
|
|
+ AND gmt_create <= #{endDate}
|
|
|
|
+ </if>
|
|
|
|
+-- AND hospital_code !='朗通通用'
|
|
|
|
+ GROUP BY
|
|
|
|
+ hospital_code
|
|
|
|
+ ORDER BY
|
|
|
|
+ pvSum desc;
|
|
|
|
+ </select>
|
|
|
|
+
|
|
|
|
+ <select id="getUVHosp" parameterType="com.diagbot.vo.OptVO" resultType="com.diagbot.dto.UVHospDTO">
|
|
|
|
+ SELECT
|
|
|
|
+ t.hospitalCode AS hospitalCode,
|
|
|
|
+ t.days AS days,
|
|
|
|
+ count(ip) AS uvCnt
|
|
|
|
+ FROM
|
|
|
|
+ (
|
|
|
|
+ SELECT DISTINCT
|
|
|
|
+ hospital_code AS hospitalCode,
|
|
|
|
+ DATE_FORMAT(gmt_create, '%Y-%m-%d') AS days,
|
|
|
|
+ ip
|
|
|
|
+ FROM
|
|
|
|
+ znwz_opt_info
|
|
|
|
+ WHERE
|
|
|
|
+ opt_type = 1
|
|
|
|
+ <!--<if test="hospitalCode != null and hospitalCode != ''">-->
|
|
|
|
+ <!--AND hospital_code = #{hospitalCode}-->
|
|
|
|
+ <!--</if>-->
|
|
|
|
+ <if test="startDate!=null">
|
|
|
|
+ AND gmt_create >= #{startDate}
|
|
|
|
+ </if>
|
|
|
|
+ <if test="endDate!=null">
|
|
|
|
+ AND gmt_create <= #{endDate}
|
|
|
|
+ </if>
|
|
|
|
+-- AND hospital_code !='朗通通用'
|
|
|
|
+ ) t
|
|
|
|
+ GROUP BY
|
|
|
|
+ hospitalCode,
|
|
|
|
+ days
|
|
|
|
+ ORDER BY
|
|
|
|
+ hospitalCode,
|
|
|
|
+ days;
|
|
|
|
+
|
|
|
|
+ </select>
|
|
|
|
+
|
|
|
|
+ <select id="getUVSumHosp" parameterType="com.diagbot.vo.OptVO" resultType="com.diagbot.dto.UVHospSumDTO">
|
|
|
|
+ SELECT
|
|
|
|
+ t.hospitalCode AS hospitalCode,
|
|
|
|
+ count(ip) AS uvSum
|
|
|
|
+ FROM
|
|
|
|
+ (
|
|
|
|
+ SELECT DISTINCT
|
|
|
|
+ hospital_code AS hospitalCode,
|
|
|
|
+ DATE_FORMAT(gmt_create, '%Y-%m-%d') AS days,
|
|
|
|
+ ip
|
|
|
|
+ FROM
|
|
|
|
+ znwz_opt_info
|
|
|
|
+ WHERE
|
|
|
|
+ opt_type = 1
|
|
|
|
+ <!--<if test="hospitalCode != null and hospitalCode != ''">-->
|
|
|
|
+ <!--AND hospital_code = #{hospitalCode}-->
|
|
|
|
+ <!--</if>-->
|
|
|
|
+ <if test="startDate!=null">
|
|
|
|
+ AND gmt_create >= #{startDate}
|
|
|
|
+ </if>
|
|
|
|
+ <if test="endDate!=null">
|
|
|
|
+ AND gmt_create <= #{endDate}
|
|
|
|
+ </if>
|
|
|
|
+-- AND hospital_code !='朗通通用'
|
|
|
|
+ ) t
|
|
|
|
+ GROUP BY
|
|
|
|
+ hospitalCode
|
|
|
|
+ ORDER BY
|
|
|
|
+ uvSum desc;
|
|
|
|
+ </select>
|
|
|
|
+
|
|
|
|
+ <select id="getZZHosp" parameterType="com.diagbot.vo.OptVO" resultType="com.diagbot.dto.ZZHospDTO">
|
|
|
|
+ SELECT
|
|
|
|
+ t.hospitalCode AS hospitalCode,
|
|
|
|
+ t.days AS days,
|
|
|
|
+ count(ip) AS zzCnt
|
|
|
|
+ FROM
|
|
|
|
+ (
|
|
|
|
+ SELECT DISTINCT
|
|
|
|
+ hospital_code AS hospitalCode,
|
|
|
|
+ DATE_FORMAT(gmt_create, '%Y-%m-%d') AS days,
|
|
|
|
+ ip
|
|
|
|
+ FROM
|
|
|
|
+ znwz_opt_info
|
|
|
|
+ WHERE
|
|
|
|
+ opt_type = 2
|
|
|
|
+ <!--<if test="hospitalCode != null and hospitalCode != ''">-->
|
|
|
|
+ <!--AND hospital_code = #{hospitalCode}-->
|
|
|
|
+ <!--</if>-->
|
|
|
|
+ <if test="startDate!=null">
|
|
|
|
+ AND gmt_create >= #{startDate}
|
|
|
|
+ </if>
|
|
|
|
+ <if test="endDate!=null">
|
|
|
|
+ AND gmt_create <= #{endDate}
|
|
|
|
+ </if>
|
|
|
|
+-- AND hospital_code !='朗通通用'
|
|
|
|
+ ) t
|
|
|
|
+ GROUP BY
|
|
|
|
+ hospitalCode,
|
|
|
|
+ days
|
|
|
|
+ ORDER BY
|
|
|
|
+ hospitalCode,
|
|
|
|
+ days;
|
|
|
|
+
|
|
|
|
+ </select>
|
|
|
|
+
|
|
|
|
+ <select id="getZZSumHosp" parameterType="com.diagbot.vo.OptVO" resultType="com.diagbot.dto.ZZHospSumDTO">
|
|
|
|
+ SELECT
|
|
|
|
+ t.hospitalCode AS hospitalCode,
|
|
|
|
+ count(ip) AS zzSum
|
|
|
|
+ FROM
|
|
|
|
+ (
|
|
|
|
+ SELECT DISTINCT
|
|
|
|
+ hospital_code AS hospitalCode,
|
|
|
|
+ DATE_FORMAT(gmt_create, '%Y-%m-%d') AS days,
|
|
|
|
+ ip
|
|
|
|
+ FROM
|
|
|
|
+ znwz_opt_info
|
|
|
|
+ WHERE
|
|
|
|
+ opt_type = 2
|
|
|
|
+ <!--<if test="hospitalCode != null and hospitalCode != ''">-->
|
|
|
|
+ <!--AND hospital_code = #{hospitalCode}-->
|
|
|
|
+ <!--</if>-->
|
|
|
|
+ <if test="startDate!=null">
|
|
|
|
+ AND gmt_create >= #{startDate}
|
|
|
|
+ </if>
|
|
|
|
+ <if test="endDate!=null">
|
|
|
|
+ AND gmt_create <= #{endDate}
|
|
|
|
+ </if>
|
|
|
|
+-- AND hospital_code !='朗通通用'
|
|
|
|
+ ) t
|
|
|
|
+ GROUP BY
|
|
|
|
+ hospitalCode
|
|
|
|
+ ORDER BY
|
|
|
|
+ zzSum desc;
|
|
|
|
+ </select>
|
|
|
|
+
|
|
|
|
+ <select id="getAllHospital" resultType="java.lang.String">
|
|
|
|
+ SELECT DISTINCT(hospital_code) AS hospitalCode FROM `znwz_opt_info`;
|
|
|
|
+ </select>
|
|
|
|
+
|
|
|
|
+</mapper>
|