Commit f5354afab9129526e7de39352550d07e866ca366
1 parent
efa61aa44d
Exists in
master
and in
8 other branches
add statistics(map)
Showing 18 changed files with 474 additions and 31 deletions
- platform-mommyData/src/main/resources/earlyOrm/Mommy.xml
- platform-mommyData/src/main/resources/earlyOrm/Plat.xml
- platform-operate-api/pom.xml
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/StatisticsController.java
- platform-operate-api/src/main/resources/database.properties
- platform-operate-api/src/main/resources/spring/applicationContext-dal.xml
- platform-operate-api/src/main/resources/spring/applicationContext.xml
- platform-reportData/pom.xml
- platform-reportData/src/main/java/com/lymsh/platform/reportdata/dao/StatisticsMapper.java
- platform-reportData/src/main/java/com/lymsh/platform/reportdata/model/AreaData.java
- platform-reportData/src/main/java/com/lymsh/platform/reportdata/service/StatisticsService.java
- platform-reportData/src/main/java/com/lymsh/platform/reportdata/service/impl/StatisticsServiceImpl.java
- platform-reportData/src/main/resources/reportOrm/StatisticsMapper.xml
- platform-reportData/src/test/sql.txt
- platform-resource/resources/config-dev.properties
- platform-resource/resources/config-product.properties
- platform-resource/resources/config-test.properties
- pom.xml
platform-mommyData/src/main/resources/earlyOrm/Mommy.xml
View file @
f5354af
1 | 1 | <?xml version="1.0" encoding="UTF-8" ?> |
2 | 2 | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" > |
3 | -<mapper namespace="com.lymsh.mommybaby.earlydata.dao.MommyMapper"> | |
3 | +<mapper namespace="MommyMapper"> | |
4 | 4 | |
5 | - <resultMap id="MommyExamineInfoResultMap" type="com.lymsh.mommybaby.earlydata.model.MommyExamineInfo"> | |
5 | + <resultMap id="MommyExamineInfoResultMap" type="MommyExamineInfo"> | |
6 | 6 | <result column="EI_ID" property="eiId" jdbcType="VARCHAR"/> |
7 | 7 | <result column="EI_NAME" property="eiName" jdbcType="VARCHAR"/> |
8 | 8 | <result column="EI_VALUEMODEID" property="eiValuemodeid" jdbcType="VARCHAR"/> |
... | ... | @@ -14,7 +14,7 @@ |
14 | 14 | EI_ID,EI_NAME,EI_VALUEMODEID,EI_VALUEUNITID,EI_DATATYPEID |
15 | 15 | </sql> |
16 | 16 | |
17 | - <select id="selectMommyExamineInfo" resultMap="MommyExamineInfoResultMap" parameterType="com.lymsh.mommybaby.earlydata.model.OracleCommonQuery"> | |
17 | + <select id="selectMommyExamineInfo" resultMap="MommyExamineInfoResultMap" parameterType="OracleCommonQuery"> | |
18 | 18 | select |
19 | 19 | <include refid="MommyExamineInfoColumns"/> |
20 | 20 | from (select<include refid="MommyExamineInfoColumns"/>,rownum r |
... | ... | @@ -33,7 +33,7 @@ |
33 | 33 | |
34 | 34 | |
35 | 35 | |
36 | - <resultMap id="MommyEmployeeResultMap" type="com.lymsh.mommybaby.earlydata.model.MommyEmployee"> | |
36 | + <resultMap id="MommyEmployeeResultMap" type="MommyEmployee"> | |
37 | 37 | <result column="E_ID" property="eId" jdbcType="VARCHAR"/> |
38 | 38 | <result column="E_NAME" property="eName" jdbcType="VARCHAR"/> |
39 | 39 | <result column="E_SEX" property="eSex" jdbcType="INTEGER"/> |
... | ... | @@ -46,7 +46,7 @@ |
46 | 46 | E_ID,E_NAME,E_SEX,E_HOSPITALID,E_JOBTITLEID,E_DEPTID |
47 | 47 | </sql> |
48 | 48 | |
49 | - <select id="selectMommyEmployee" resultMap="MommyEmployeeResultMap" parameterType="com.lymsh.mommybaby.earlydata.model.OracleCommonQuery"> | |
49 | + <select id="selectMommyEmployee" resultMap="MommyEmployeeResultMap" parameterType="OracleCommonQuery"> | |
50 | 50 | select |
51 | 51 | <include refid="MommyEmployeeColumns"/> |
52 | 52 | from (select<include refid="MommyEmployeeColumns"/>,rownum r |
... | ... | @@ -65,7 +65,7 @@ |
65 | 65 | |
66 | 66 | |
67 | 67 | |
68 | - <resultMap id="MommyPatientResultMap" type="com.lymsh.mommybaby.earlydata.model.MommyPatient"> | |
68 | + <resultMap id="MommyPatientResultMap" type="MommyPatient"> | |
69 | 69 | <result column="P_NO" property="pNo" jdbcType="VARCHAR"/> |
70 | 70 | <result column="P_OPERUSER" property="pOperuser" jdbcType="VARCHAR"/> |
71 | 71 | <result column="P_TYPE" property="pType" jdbcType="INTEGER"/> |
... | ... | @@ -80,7 +80,7 @@ |
80 | 80 | P_NO,P_OPERUSER,P_TYPE,P_PLATPATIENTID,P_LASTMENSTRUALPERIOD,P_ISVALID,P_SERVICETYPE,P_ISVIP |
81 | 81 | </sql> |
82 | 82 | |
83 | - <select id="selectMommyPatient" resultMap="MommyPatientResultMap" parameterType="com.lymsh.mommybaby.earlydata.model.OracleCommonQuery"> | |
83 | + <select id="selectMommyPatient" resultMap="MommyPatientResultMap" parameterType="OracleCommonQuery"> | |
84 | 84 | select |
85 | 85 | <include refid="MommyPatientColumns"/> |
86 | 86 | from (select<include refid="MommyPatientColumns"/>,rownum r |
... | ... | @@ -99,7 +99,7 @@ |
99 | 99 | |
100 | 100 | |
101 | 101 | |
102 | - <resultMap id="MommyPatientinfoResultMap" type="com.lymsh.mommybaby.earlydata.model.MommyPatientinfo"> | |
102 | + <resultMap id="MommyPatientinfoResultMap" type="MommyPatientinfo"> | |
103 | 103 | <result column="PI_ID" property="piId" jdbcType="VARCHAR"/> |
104 | 104 | <result column="PI_NAME" property="piName" jdbcType="VARCHAR"/> |
105 | 105 | <result column="PI_SEX" property="piSex" jdbcType="INTEGER"/> |
... | ... | @@ -117,7 +117,7 @@ |
117 | 117 | PI_ID,PI_NAME,PI_SEX,PI_KIDSTYPE,PI_BIRTHDAY,PI_MOTHERPHONE,PI_OPERUSER,PI_PLATPATIENTID,PI_ISDELETE,PI_SERVICETYPE,PI_ISVIP |
118 | 118 | </sql> |
119 | 119 | |
120 | - <select id="selectMommyPatientinfo" resultMap="MommyPatientinfoResultMap" parameterType="com.lymsh.mommybaby.earlydata.model.OracleCommonQuery"> | |
120 | + <select id="selectMommyPatientinfo" resultMap="MommyPatientinfoResultMap" parameterType="OracleCommonQuery"> | |
121 | 121 | select |
122 | 122 | <include refid="MommyPatientinfoColumns"/> |
123 | 123 | from (select<include refid="MommyPatientinfoColumns"/>,rownum r |
... | ... | @@ -136,7 +136,7 @@ |
136 | 136 | |
137 | 137 | |
138 | 138 | |
139 | - <resultMap id="MommyChildexaminerecordResultMap" type="com.lymsh.mommybaby.earlydata.model.MommyChildexaminerecord"> | |
139 | + <resultMap id="MommyChildexaminerecordResultMap" type="MommyChildexaminerecord"> | |
140 | 140 | <result column="CER_ID" property="cerId" jdbcType="VARCHAR"/> |
141 | 141 | <result column="CER_PATIENTID" property="cerPatientid" jdbcType="VARCHAR"/> |
142 | 142 | <result column="CER_EXAMINDATE" property="cerExaminedate" jdbcType="TIMESTAMP"/> |
... | ... | @@ -149,7 +149,7 @@ |
149 | 149 | CER_ID,CER_PATIENTID,CER_EXAMINDATE,CER_EXAMINHOSPITAL,CER_MODIFIEDOPERATOR,CER_REMARKS |
150 | 150 | </sql> |
151 | 151 | |
152 | - <select id="selectMommyChildexaminerecord" resultMap="MommyChildexaminerecordResultMap" parameterType="com.lymsh.mommybaby.earlydata.model.OracleCommonQuery"> | |
152 | + <select id="selectMommyChildexaminerecord" resultMap="MommyChildexaminerecordResultMap" parameterType="OracleCommonQuery"> | |
153 | 153 | select |
154 | 154 | <include refid="MommyChildexaminerecordColumns"/> |
155 | 155 | from (select<include refid="MommyChildexaminerecordColumns"/>,rownum r |
... | ... | @@ -168,7 +168,7 @@ |
168 | 168 | |
169 | 169 | |
170 | 170 | |
171 | - <resultMap id="MommyExamineResultMap" type="com.lymsh.mommybaby.earlydata.model.MommyExamine"> | |
171 | + <resultMap id="MommyExamineResultMap" type="MommyExamine"> | |
172 | 172 | <result column="E_ID" property="eId" jdbcType="VARCHAR"/> |
173 | 173 | <result column="E_CHILDEXAMINID" property="eChildexamineid" jdbcType="VARCHAR"/> |
174 | 174 | <result column="E_EXAMINEID" property="eExamineid" jdbcType="VARCHAR"/> |
... | ... | @@ -181,7 +181,7 @@ |
181 | 181 | E_ID,E_CHILDEXAMINID,E_EXAMINEID,E_RESULT,E_UNIT,E_EVALUATION |
182 | 182 | </sql> |
183 | 183 | |
184 | - <select id="selectMommyExamine" resultMap="MommyExamineResultMap" parameterType="com.lymsh.mommybaby.earlydata.model.OracleCommonQuery"> | |
184 | + <select id="selectMommyExamine" resultMap="MommyExamineResultMap" parameterType="OracleCommonQuery"> | |
185 | 185 | select |
186 | 186 | <include refid="MommyExamineColumns"/> |
187 | 187 | from (select<include refid="MommyExamineColumns"/>,rownum r |
... | ... | @@ -201,7 +201,7 @@ |
201 | 201 | select ED_DIAGNOSISCONTENT FROM Mommy_ExamineDiagnosis WHERE ED_TRIAGEORDERNO = #{triageOrderNo} and ED_ISVALID = 1 |
202 | 202 | </select> |
203 | 203 | |
204 | - <resultMap id="GuideTheWomenResultMap" type="com.lymsh.mommybaby.earlydata.model.PlatDataContent"> | |
204 | + <resultMap id="GuideTheWomenResultMap" type="PlatDataContent"> | |
205 | 205 | <result column="DC_NAME" property="dcId" jdbcType="VARCHAR"/> |
206 | 206 | <result column="ER_CONTENT" property="dcName" jdbcType="VARCHAR"/> |
207 | 207 | <result column="ES_PREGNANCYWEEK" property="week" jdbcType="INTEGER"/> |
208 | 208 | |
209 | 209 | |
... | ... | @@ -214,16 +214,16 @@ |
214 | 214 | </if> |
215 | 215 | </select> |
216 | 216 | |
217 | - <resultMap id="DcIdNameResultMap" type="com.lymsh.mommybaby.earlydata.model.PlatDataContent"> | |
217 | + <resultMap id="DcIdNameResultMap" type="PlatDataContent"> | |
218 | 218 | <result column="DC_ID" property="dcId" jdbcType="VARCHAR"/> |
219 | 219 | <result column="DC_NAME" property="dcName" jdbcType="VARCHAR"/> |
220 | 220 | </resultMap> |
221 | 221 | |
222 | - <select id="selectDcIdName" resultMap="DcIdNameResultMap" parameterType="com.lymsh.mommybaby.earlydata.model.OracleCommonQuery"> | |
222 | + <select id="selectDcIdName" resultMap="DcIdNameResultMap" parameterType="OracleCommonQuery"> | |
223 | 223 | select DC_ID,DC_NAME FROM ${tableName} |
224 | 224 | </select> |
225 | 225 | |
226 | - <resultMap id="DiagnosisViewResultMap" type="com.lymsh.mommybaby.earlydata.model.DiagnosisView"> | |
226 | + <resultMap id="DiagnosisViewResultMap" type="DiagnosisView"> | |
227 | 227 | <result column="dh_pasthistoryid" property="storyId" jdbcType="VARCHAR"/> |
228 | 228 | <result column="dh_name" property="dhName" jdbcType="VARCHAR"/> |
229 | 229 | <result column="dh_historyinfo" property="historyInfo" jdbcType="VARCHAR"/> |
platform-mommyData/src/main/resources/earlyOrm/Plat.xml
View file @
f5354af
1 | 1 | <?xml version="1.0" encoding="UTF-8" ?> |
2 | 2 | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" > |
3 | -<mapper namespace="com.lymsh.mommybaby.earlydata.dao.PlatMapper"> | |
3 | +<mapper namespace="PlatMapper"> | |
4 | 4 | |
5 | - <resultMap id="PlatDataTypeResultMap" type="com.lymsh.mommybaby.earlydata.model.PlatDataType"> | |
5 | + <resultMap id="PlatDataTypeResultMap" type="PlatDataType"> | |
6 | 6 | <result column="DT_ID" property="dtId" jdbcType="VARCHAR"/> |
7 | 7 | <result column="DT_NAME" property="dtName" jdbcType="VARCHAR"/> |
8 | 8 | </resultMap> |
... | ... | @@ -20,7 +20,7 @@ |
20 | 20 | |
21 | 21 | |
22 | 22 | |
23 | - <resultMap id="PlatDataContentResultMap" type="com.lymsh.mommybaby.earlydata.model.PlatDataContent"> | |
23 | + <resultMap id="PlatDataContentResultMap" type="PlatDataContent"> | |
24 | 24 | <result column="DC_ID" property="dcId" jdbcType="VARCHAR"/> |
25 | 25 | <result column="DC_NAME" property="dcName" jdbcType="VARCHAR"/> |
26 | 26 | <result column="DC_NO" property="dcNo" jdbcType="VARCHAR"/> |
... | ... | @@ -40,7 +40,7 @@ |
40 | 40 | |
41 | 41 | |
42 | 42 | |
43 | - <resultMap id="PlatHospitalResultMap" type="com.lymsh.mommybaby.earlydata.model.PlatHospital"> | |
43 | + <resultMap id="PlatHospitalResultMap" type="PlatHospital"> | |
44 | 44 | <result column="H_ID" property="hId" jdbcType="VARCHAR"/> |
45 | 45 | <result column="H_NAME" property="hName" jdbcType="VARCHAR"/> |
46 | 46 | </resultMap> |
... | ... | @@ -49,7 +49,7 @@ |
49 | 49 | H_ID,H_NAME |
50 | 50 | </sql> |
51 | 51 | |
52 | - <select id="selectPlatHospital" resultMap="PlatHospitalResultMap" parameterType="com.lymsh.mommybaby.earlydata.model.OracleCommonQuery"> | |
52 | + <select id="selectPlatHospital" resultMap="PlatHospitalResultMap" parameterType="OracleCommonQuery"> | |
53 | 53 | select |
54 | 54 | <include refid="PlatHospitalColumns"/> |
55 | 55 | from (select<include refid="PlatHospitalColumns"/>,rownum r |
... | ... | @@ -66,7 +66,7 @@ |
66 | 66 | |
67 | 67 | |
68 | 68 | |
69 | - <resultMap id="PlatUsersResultMap" type="com.lymsh.mommybaby.earlydata.model.PlatUsers"> | |
69 | + <resultMap id="PlatUsersResultMap" type="PlatUsers"> | |
70 | 70 | <result column="U_ID" property="uId" jdbcType="VARCHAR"/> |
71 | 71 | <result column="U_USERNAME" property="uUsername" jdbcType="VARCHAR"/> |
72 | 72 | <result column="U_USERPWD" property="uUserpwd" jdbcType="VARCHAR"/> |
... | ... | @@ -79,7 +79,7 @@ |
79 | 79 | U_ID,U_USERNAME,U_USERPWD,U_EMPLOYEEID,U_LOGINNUM,U_ISVALID |
80 | 80 | </sql> |
81 | 81 | |
82 | - <select id="selectPlatUsers" resultMap="PlatUsersResultMap" parameterType="com.lymsh.mommybaby.earlydata.model.OracleCommonQuery"> | |
82 | + <select id="selectPlatUsers" resultMap="PlatUsersResultMap" parameterType="OracleCommonQuery"> | |
83 | 83 | select |
84 | 84 | <include refid="PlatUsersColumns"/> |
85 | 85 | from (select<include refid="PlatUsersColumns"/>,rownum r |
... | ... | @@ -97,7 +97,7 @@ |
97 | 97 | |
98 | 98 | |
99 | 99 | |
100 | - <resultMap id="PlatPatientResultMap" type="com.lymsh.mommybaby.earlydata.model.PlatPatient"> | |
100 | + <resultMap id="PlatPatientResultMap" type="PlatPatient"> | |
101 | 101 | <result column="P_ID" property="pId" jdbcType="VARCHAR"/> |
102 | 102 | <result column="P_NAME" property="pName" jdbcType="VARCHAR"/> |
103 | 103 | <result column="P_SEX" property="pSex" jdbcType="INTEGER"/> |
... | ... | @@ -110,7 +110,7 @@ |
110 | 110 | P_ID,P_NAME,P_SEX,P_BIRTHDAY,P_MOBILEPHONE,P_ISVALID |
111 | 111 | </sql> |
112 | 112 | |
113 | - <select id="selectPlatPatient" resultMap="PlatPatientResultMap" parameterType="com.lymsh.mommybaby.earlydata.model.OracleCommonQuery"> | |
113 | + <select id="selectPlatPatient" resultMap="PlatPatientResultMap" parameterType="OracleCommonQuery"> | |
114 | 114 | select |
115 | 115 | <include refid="PlatPatientColumns"/> |
116 | 116 | from (select<include refid="PlatPatientColumns"/>,rownum r |
... | ... | @@ -126,7 +126,7 @@ |
126 | 126 | <![CDATA[ r >= #{startRow} ]]> |
127 | 127 | </select> |
128 | 128 | |
129 | - <select id="selectTable" resultType="hashmap" parameterType="com.lymsh.mommybaby.earlydata.model.OracleCommonQuery"> | |
129 | + <select id="selectTable" resultType="hashmap" parameterType="OracleCommonQuery"> | |
130 | 130 | select |
131 | 131 | * |
132 | 132 | from (select h.* ,rownum r |
... | ... | @@ -158,7 +158,7 @@ |
158 | 158 | </select> |
159 | 159 | |
160 | 160 | |
161 | - <resultMap id="ViewPatientResultMap" type="com.lymsh.mommybaby.earlydata.model.ViewPatient"> | |
161 | + <resultMap id="ViewPatientResultMap" type="ViewPatient"> | |
162 | 162 | <result column="DC_NAME" property="dcName" jdbcType="VARCHAR"/> |
163 | 163 | <result column="ME_COLORNAME" property="meColorname" jdbcType="VARCHAR"/> |
164 | 164 | <result column="PI_AGEMONTH" property="ageMonth" jdbcType="VARCHAR"/> |
... | ... | @@ -170,7 +170,7 @@ |
170 | 170 | select DC_NAME,ME_COLORNAME,FENSHU,PI_AGEMONTH FROM V_GETALLPATIENT WHERE P_PLATPATIENTID = #{patientId} |
171 | 171 | </select> |
172 | 172 | |
173 | - <resultMap id="RiskDetailsResultMap" type="com.lymsh.mommybaby.earlydata.model.ViewPatient"> | |
173 | + <resultMap id="RiskDetailsResultMap" type="ViewPatient"> | |
174 | 174 | <result column="DC_NAME" property="dcName" jdbcType="VARCHAR"/> |
175 | 175 | <result column="ME_COLORNAME" property="meColorname" jdbcType="VARCHAR"/> |
176 | 176 | <result column="FENSHU" property="fenshu" jdbcType="INTEGER"/> |
platform-operate-api/pom.xml
View file @
f5354af
... | ... | @@ -36,6 +36,11 @@ |
36 | 36 | <version>${project.version}</version> |
37 | 37 | </dependency> |
38 | 38 | <dependency> |
39 | + <groupId>com.lyms.core</groupId> | |
40 | + <artifactId>platform-reportData</artifactId> | |
41 | + <version>${project.version}</version> | |
42 | + </dependency> | |
43 | + <dependency> | |
39 | 44 | <groupId>org.apache.activemq</groupId> |
40 | 45 | <artifactId>activemq-all</artifactId> |
41 | 46 | <version>${org.activemq.version}</version> |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/StatisticsController.java
View file @
f5354af
1 | +package com.lyms.platform.operate.web.controller; | |
2 | + | |
3 | +import com.lyms.platform.common.annotation.TokenRequired; | |
4 | +import com.lyms.platform.common.base.BaseController; | |
5 | +import com.lyms.platform.common.constants.ErrorCodeConstants; | |
6 | +import com.lyms.platform.common.utils.JsonUtil; | |
7 | +import com.lyms.platform.common.utils.ResultUtils; | |
8 | +import com.lymsh.platform.reportdata.model.AreaData; | |
9 | +import com.lymsh.platform.reportdata.service.StatisticsService; | |
10 | +import org.apache.commons.lang.StringUtils; | |
11 | +import org.springframework.beans.factory.annotation.Autowired; | |
12 | +import org.springframework.stereotype.Controller; | |
13 | +import org.springframework.web.bind.annotation.PathVariable; | |
14 | +import org.springframework.web.bind.annotation.RequestMapping; | |
15 | +import org.springframework.web.bind.annotation.RequestMethod; | |
16 | +import org.springframework.web.bind.annotation.RequestParam; | |
17 | + | |
18 | +import javax.servlet.http.HttpServletResponse; | |
19 | +import java.util.HashMap; | |
20 | +import java.util.List; | |
21 | +import java.util.Map; | |
22 | + | |
23 | +/** | |
24 | + * Created by Administrator on 2016/6/28 0028. | |
25 | + */ | |
26 | +@Controller | |
27 | +@RequestMapping("/statistics") | |
28 | +public class StatisticsController extends BaseController { | |
29 | + | |
30 | + @Autowired | |
31 | + private StatisticsService statisticsService; | |
32 | + | |
33 | + @RequestMapping(value = "/countryData", method = RequestMethod.GET) | |
34 | + @TokenRequired | |
35 | + public void getCountryData(HttpServletResponse response, @RequestParam(value = "year", required = false)String year) { | |
36 | + if (StringUtils.isBlank(year)) { | |
37 | + year = null; | |
38 | + } | |
39 | + List<AreaData> simpleList = statisticsService.queryProvincePatients(year); | |
40 | + List<AreaData> riskList = statisticsService.queryProvinceRiskPatients(year); | |
41 | + Map<String,Object> result= new HashMap<String, Object>(); | |
42 | + result.put("simpleList", simpleList); | |
43 | + result.put("riskList", riskList); | |
44 | + ResultUtils.buildSuccessResultAndWrite(response, result); | |
45 | + } | |
46 | + | |
47 | +} |
platform-operate-api/src/main/resources/database.properties
View file @
f5354af
... | ... | @@ -46,4 +46,14 @@ |
46 | 46 | mongo.config.replica.set.name=repl |
47 | 47 | mongo.config.database=test |
48 | 48 | mongo.config.username= mongo.config.password= mongodb.connection= |
49 | + | |
50 | + | |
51 | +report.driver=oracle.jdbc.driver.OracleDriver | |
52 | +report.jdbcurl=${report.db.jdbcurl} | |
53 | +report.username=${report.db.username} | |
54 | +report.password=${report.db.password} | |
55 | + | |
56 | +report.maxpoolsize=5 | |
57 | +report.initialpoolsize=2 | |
58 | +report.minpoolsize=2 |
platform-operate-api/src/main/resources/spring/applicationContext-dal.xml
View file @
f5354af
... | ... | @@ -67,5 +67,52 @@ |
67 | 67 | </bean> |
68 | 68 | |
69 | 69 | |
70 | + <!-- DataSource configuration 数据仓库主数据库 --> | |
71 | + <bean id="reportDataSource" class="com.mchange.v2.c3p0.ComboPooledDataSource"> | |
72 | + <property name="driverClass" value="${report.driver}" /> | |
73 | + <property name="jdbcUrl" value="${report.jdbcurl}" /> | |
74 | + <property name="user" value="${report.username}" /> | |
75 | + <property name="password" value="${report.password}" /> | |
76 | + <property name="maxPoolSize" value="${report.maxpoolsize}" /> | |
77 | + <property name="initialPoolSize" value="${report.initialpoolsize}" /> | |
78 | + <property name="maxIdleTime" value="7200"></property> | |
79 | + <property name="acquireRetryDelay" value="1000"></property> | |
80 | + <property name="breakAfterAcquireFailure" value="false"></property> | |
81 | + <property name="acquireRetryAttempts" value="3" /> | |
82 | + <property name="minPoolSize" value="${report.minpoolsize}" /> | |
83 | + </bean> | |
84 | + | |
85 | + <bean id="reportJdbcTemplate" class="org.springframework.jdbc.core.JdbcTemplate" | |
86 | + p:dataSource-ref="reportDataSource" /> | |
87 | + | |
88 | + <bean id="reportSqlSessionFactory" class="org.mybatis.spring.SqlSessionFactoryBean"> | |
89 | + <property name="dataSource" ref="reportDataSource" /> | |
90 | + <property name="mapperLocations"> | |
91 | + <list> | |
92 | + <value>classpath*:reportOrm/*.xml</value> | |
93 | + </list> | |
94 | + </property> | |
95 | + </bean> | |
96 | + | |
97 | + <!-- manage transaction --> | |
98 | + <bean id="reportTransactionManager" | |
99 | + class="org.springframework.jdbc.datasource.DataSourceTransactionManager"> | |
100 | + <property name="dataSource" ref="reportDataSource" /> | |
101 | + </bean> | |
102 | + | |
103 | + <tx:annotation-driven transaction-manager="reportTransactionManager"/> | |
104 | + | |
105 | + <!-- Mabatis Data Layer --> | |
106 | + <bean id="reportSqlSessionTemplate" class="org.mybatis.spring.SqlSessionTemplate"> | |
107 | + <constructor-arg index="0" ref="reportSqlSessionFactory" /> | |
108 | + </bean> | |
109 | + | |
110 | + <!-- all class in the back-package are auto loaded as a mapper --> | |
111 | + <bean class="org.mybatis.spring.mapper.MapperScannerConfigurer"> | |
112 | + <property name="sqlSessionFactoryBeanName" value="reportSqlSessionFactory"></property> | |
113 | + <property name="basePackage" value="com.lymsh.platform.reportdata.dao" /> | |
114 | + </bean> | |
115 | + | |
116 | + | |
70 | 117 | </beans> |
platform-operate-api/src/main/resources/spring/applicationContext.xml
View file @
f5354af
... | ... | @@ -14,6 +14,7 @@ |
14 | 14 | <context:component-scan base-package="com.lyms.platform.biz.dal.impl"/> |
15 | 15 | <context:component-scan base-package="com.lyms.platform.operate.web.facade"/> |
16 | 16 | <context:component-scan base-package="com.lyms.platform.permission.*"/> |
17 | + <context:component-scan base-package="com.lymsh.platform.reportdata.service.impl.*" /> | |
17 | 18 | <!-- 提示信息加载类 --> |
18 | 19 | <bean class="com.lyms.platform.common.core.resolve.MessageResolver"> |
19 | 20 | <property name="messageFile" value="message.properties"/> |
platform-reportData/pom.xml
View file @
f5354af
1 | +<?xml version="1.0" encoding="UTF-8"?> | |
2 | +<project xmlns="http://maven.apache.org/POM/4.0.0" | |
3 | + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | |
4 | + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | |
5 | + <parent> | |
6 | + <artifactId>regional-platform</artifactId> | |
7 | + <groupId>com.lyms.core</groupId> | |
8 | + <version>1.0.1</version> | |
9 | + </parent> | |
10 | + <modelVersion>4.0.0</modelVersion> | |
11 | + <packaging>jar</packaging> | |
12 | + <artifactId>platform-reportData</artifactId> | |
13 | + | |
14 | + <dependencies> | |
15 | + <dependency> | |
16 | + <groupId>com.lyms.core</groupId> | |
17 | + <artifactId>platform-common</artifactId> | |
18 | + <version>1.0.1</version> | |
19 | + </dependency> | |
20 | + <dependency> | |
21 | + <groupId>com.oracle</groupId> | |
22 | + <artifactId>ojdbc14</artifactId> | |
23 | + <version>11.2.0.1.0</version> | |
24 | + </dependency> | |
25 | + </dependencies> | |
26 | + <build> | |
27 | + <plugins> | |
28 | + <plugin> | |
29 | + <groupId>org.apache.maven.plugins</groupId> | |
30 | + <artifactId>maven-compiler-plugin</artifactId> | |
31 | + <configuration> | |
32 | + <source>1.7</source> | |
33 | + <target>1.7</target> | |
34 | + </configuration> | |
35 | + </plugin> | |
36 | + </plugins> | |
37 | + <finalName>platform-mommyData</finalName> | |
38 | + </build> | |
39 | + | |
40 | +</project> |
platform-reportData/src/main/java/com/lymsh/platform/reportdata/dao/StatisticsMapper.java
View file @
f5354af
1 | +package com.lymsh.platform.reportdata.dao; | |
2 | + | |
3 | +import com.lymsh.platform.reportdata.model.AreaData; | |
4 | + | |
5 | +import java.util.List; | |
6 | + | |
7 | +/** | |
8 | + * Created by Administrator on 2016/6/28 0028. | |
9 | + */ | |
10 | +public interface StatisticsMapper { | |
11 | + | |
12 | + public List<AreaData> queryProvincePatients(String year); | |
13 | + | |
14 | + public List<AreaData> queryProvinceRiskPatients(String year); | |
15 | + | |
16 | +} |
platform-reportData/src/main/java/com/lymsh/platform/reportdata/model/AreaData.java
View file @
f5354af
1 | +package com.lymsh.platform.reportdata.model; | |
2 | + | |
3 | +/** | |
4 | + * Created by Administrator on 2016/6/28 0028. | |
5 | + */ | |
6 | +public class AreaData { | |
7 | + | |
8 | + private String provinceId; | |
9 | + private String provinceName; | |
10 | + private String cityId; | |
11 | + private String cityName; | |
12 | + private String areaId; | |
13 | + private String areaName; | |
14 | + private Integer val; | |
15 | + private String year; | |
16 | + | |
17 | + public String getProvinceId() { | |
18 | + return provinceId; | |
19 | + } | |
20 | + | |
21 | + public void setProvinceId(String provinceId) { | |
22 | + this.provinceId = provinceId; | |
23 | + } | |
24 | + | |
25 | + public String getProvinceName() { | |
26 | + return provinceName; | |
27 | + } | |
28 | + | |
29 | + public void setProvinceName(String provinceName) { | |
30 | + this.provinceName = provinceName; | |
31 | + } | |
32 | + | |
33 | + public String getCityId() { | |
34 | + return cityId; | |
35 | + } | |
36 | + | |
37 | + public void setCityId(String cityId) { | |
38 | + this.cityId = cityId; | |
39 | + } | |
40 | + | |
41 | + public String getCityName() { | |
42 | + return cityName; | |
43 | + } | |
44 | + | |
45 | + public void setCityName(String cityName) { | |
46 | + this.cityName = cityName; | |
47 | + } | |
48 | + | |
49 | + public String getAreaId() { | |
50 | + return areaId; | |
51 | + } | |
52 | + | |
53 | + public void setAreaId(String areaId) { | |
54 | + this.areaId = areaId; | |
55 | + } | |
56 | + | |
57 | + public String getAreaName() { | |
58 | + return areaName; | |
59 | + } | |
60 | + | |
61 | + public void setAreaName(String areaName) { | |
62 | + this.areaName = areaName; | |
63 | + } | |
64 | + | |
65 | + public Integer getVal() { | |
66 | + return val; | |
67 | + } | |
68 | + | |
69 | + public void setVal(Integer val) { | |
70 | + this.val = val; | |
71 | + } | |
72 | + | |
73 | + public String getYear() { | |
74 | + return year; | |
75 | + } | |
76 | + | |
77 | + public void setYear(String year) { | |
78 | + this.year = year; | |
79 | + } | |
80 | +} |
platform-reportData/src/main/java/com/lymsh/platform/reportdata/service/StatisticsService.java
View file @
f5354af
1 | +package com.lymsh.platform.reportdata.service; | |
2 | + | |
3 | +import com.lymsh.platform.reportdata.model.AreaData; | |
4 | + | |
5 | +import java.util.List; | |
6 | + | |
7 | +/** | |
8 | + * Created by Administrator on 2016/6/28 0028. | |
9 | + */ | |
10 | +public interface StatisticsService { | |
11 | + | |
12 | + public List<AreaData> queryProvincePatients(String year); | |
13 | + | |
14 | + public List<AreaData> queryProvinceRiskPatients(String year); | |
15 | + | |
16 | +} |
platform-reportData/src/main/java/com/lymsh/platform/reportdata/service/impl/StatisticsServiceImpl.java
View file @
f5354af
1 | +package com.lymsh.platform.reportdata.service.impl; | |
2 | + | |
3 | +import com.lymsh.platform.reportdata.dao.StatisticsMapper; | |
4 | +import com.lymsh.platform.reportdata.model.AreaData; | |
5 | +import com.lymsh.platform.reportdata.service.StatisticsService; | |
6 | +import org.springframework.beans.factory.annotation.Autowired; | |
7 | +import org.springframework.stereotype.Service; | |
8 | + | |
9 | +import java.util.List; | |
10 | + | |
11 | +/** | |
12 | + * Created by Administrator on 2016/6/28 0028. | |
13 | + */ | |
14 | +@Service | |
15 | +public class StatisticsServiceImpl implements StatisticsService { | |
16 | + | |
17 | + @Autowired | |
18 | + private StatisticsMapper statisticsMapper; | |
19 | + | |
20 | + @Override | |
21 | + public List<AreaData> queryProvincePatients(String year) { | |
22 | + return statisticsMapper.queryProvincePatients(year); | |
23 | + } | |
24 | + | |
25 | + @Override | |
26 | + public List<AreaData> queryProvinceRiskPatients(String year) { | |
27 | + return statisticsMapper.queryProvinceRiskPatients(year); | |
28 | + } | |
29 | +} |
platform-reportData/src/main/resources/reportOrm/StatisticsMapper.xml
View file @
f5354af
1 | +<?xml version="1.0" encoding="UTF-8" ?> | |
2 | +<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" > | |
3 | +<mapper namespace="StatisticsMapper"> | |
4 | + | |
5 | + <resultMap id="AreaDataResultMap" type="AreaData"> | |
6 | + <result column="province_id" property="provinceId" jdbcType="VARCHAR"/> | |
7 | + <result column="province_name" property="provinceName" jdbcType="VARCHAR"/> | |
8 | + <result column="year" property="year" jdbcType="VARCHAR"/> | |
9 | + <result column="val" property="val" jdbcType="INTEGER"/> | |
10 | + </resultMap> | |
11 | + | |
12 | + <select id="queryProvincePatients" resultMap="AreaDataResultMap" parameterType="java.lang.String"> | |
13 | + SELECT | |
14 | + ODS_D_PROVINCE.PROVINCE_ID as province_id, | |
15 | + ODS_D_PROVINCE.PROVINCE as province_name, | |
16 | + <if test="year != null and year != ''"> | |
17 | + ODS_D_DIM_DATE.YEAR_1 as year, | |
18 | + </if> | |
19 | + COUNT(ODS_F_GRAVIDA_RECORD.RECORD_ID) as val | |
20 | + FROM | |
21 | + ODS_D_PROVINCE, | |
22 | + ODS_D_DIM_DATE, | |
23 | + ODS_F_GRAVIDA_RECORD, | |
24 | + ODS_D_HOSPITAL, | |
25 | + ODS_D_CITY | |
26 | + WHERE | |
27 | + ( ODS_F_GRAVIDA_RECORD.HOSPITAL_NO=ODS_D_HOSPITAL.HOSPITAL_NO ) | |
28 | + AND ( ODS_D_CITY.PROVINCE_ID=ODS_D_PROVINCE.PROVINCE_ID ) | |
29 | + AND ( ODS_F_GRAVIDA_RECORD.INSERT_DATE=ODS_D_DIM_DATE.DATE_1 ) | |
30 | + AND ( ODS_D_HOSPITAL.CITY_ID=ODS_D_CITY.CITY_ID(+) ) | |
31 | + <if test="year != null and year != ''"> | |
32 | + AND ODS_D_DIM_DATE.YEAR_1=${year} | |
33 | + </if> | |
34 | + GROUP BY | |
35 | + ODS_D_PROVINCE.PROVINCE_ID, | |
36 | + ODS_D_PROVINCE.PROVINCE | |
37 | + <if test="year != null and year != ''"> | |
38 | + ,ODS_D_DIM_DATE.YEAR_1 | |
39 | + </if> | |
40 | + </select> | |
41 | + | |
42 | + <select id="queryProvinceRiskPatients" resultMap="AreaDataResultMap" parameterType="java.lang.String"> | |
43 | + SELECT | |
44 | + ODS_D_PROVINCE.PROVINCE_ID as province_id, | |
45 | + ODS_D_PROVINCE.PROVINCE as province_name, | |
46 | + <if test="year != null and year != ''"> | |
47 | + ODS_D_DIM_DATE.YEAR_1 as year, | |
48 | + </if> | |
49 | + COUNT(ODS_F_GRAVIDA_RECORD.RECORD_ID) as val | |
50 | + FROM | |
51 | + ODS_D_PROVINCE, | |
52 | + ODS_D_DIM_DATE, | |
53 | + ODS_F_GRAVIDA_RECORD, | |
54 | + ODS_F_EXAMINE_HISTORY, | |
55 | + ODS_D_HOSPITAL, | |
56 | + ODS_D_CITY | |
57 | + WHERE | |
58 | + ( ODS_F_GRAVIDA_RECORD.RECORD_ID=ODS_F_EXAMINE_HISTORY.RECORD_ID(+) ) | |
59 | + AND ( ODS_F_GRAVIDA_RECORD.HOSPITAL_NO=ODS_D_HOSPITAL.HOSPITAL_NO ) | |
60 | + AND ( ODS_D_CITY.PROVINCE_ID=ODS_D_PROVINCE.PROVINCE_ID ) | |
61 | + AND ( ODS_F_GRAVIDA_RECORD.INSERT_DATE=ODS_D_DIM_DATE.DATE_1 ) | |
62 | + AND ( ODS_D_HOSPITAL.CITY_ID=ODS_D_CITY.CITY_ID(+) ) | |
63 | + AND | |
64 | + ( | |
65 | + ODS_F_EXAMINE_HISTORY.EXAMINE_HISTORY_NUM = 1 | |
66 | + AND | |
67 | + ODS_F_EXAMINE_HISTORY.HIGH_RISK_FACTOR NOT IN ( '健康','健康,无' ) | |
68 | + ) | |
69 | + <if test="year != null and year != ''"> | |
70 | + AND ODS_D_DIM_DATE.YEAR_1=${year} | |
71 | + </if> | |
72 | + GROUP BY | |
73 | + ODS_D_PROVINCE.PROVINCE_ID, | |
74 | + ODS_D_PROVINCE.PROVINCE | |
75 | + <if test="year != null and year != ''"> | |
76 | + ,ODS_D_DIM_DATE.YEAR_1 | |
77 | + </if> | |
78 | + </select> | |
79 | + | |
80 | + | |
81 | +</mapper> |
platform-reportData/src/test/sql.txt
View file @
f5354af
1 | +这个就是每个省份 每年的建档孕妇数 | |
2 | + | |
3 | +SELECT | |
4 | + ODS_D_PROVINCE.PROVINCE_ID as province_id, | |
5 | + ODS_D_PROVINCE.PROVINCE as province_name, | |
6 | + ODS_D_DIM_DATE.YEAR_1 as year, | |
7 | + COUNT(ODS_F_GRAVIDA_RECORD.RECORD_ID) as val | |
8 | +FROM | |
9 | + ODS_D_PROVINCE, | |
10 | + ODS_D_DIM_DATE, | |
11 | + ODS_F_GRAVIDA_RECORD, | |
12 | + ODS_D_HOSPITAL, | |
13 | + ODS_D_CITY | |
14 | +WHERE | |
15 | + ( ODS_F_GRAVIDA_RECORD.HOSPITAL_NO=ODS_D_HOSPITAL.HOSPITAL_NO ) | |
16 | + AND ( ODS_D_CITY.PROVINCE_ID=ODS_D_PROVINCE.PROVINCE_ID ) | |
17 | + AND ( ODS_F_GRAVIDA_RECORD.INSERT_DATE=ODS_D_DIM_DATE.DATE_1 ) | |
18 | + AND ( ODS_D_HOSPITAL.CITY_ID=ODS_D_CITY.CITY_ID(+) ) | |
19 | + AND ODS_D_DIM_DATE.YEAR_1=2016 | |
20 | +GROUP BY | |
21 | + ODS_D_PROVINCE.PROVINCE_ID, | |
22 | + ODS_D_PROVINCE.PROVINCE, | |
23 | + ODS_D_DIM_DATE.YEAR_1 | |
24 | + | |
25 | + --------------------------------------------------- | |
26 | + 这个就是每个省份 每年的高危孕妇数 | |
27 | + | |
28 | + SELECT | |
29 | + ODS_D_PROVINCE.PROVINCE_ID as province_id, | |
30 | + ODS_D_PROVINCE.PROVINCE as province_name, | |
31 | + ODS_D_DIM_DATE.YEAR_1 as year, | |
32 | + COUNT(ODS_F_GRAVIDA_RECORD.RECORD_ID) as val | |
33 | + FROM | |
34 | + ODS_D_PROVINCE, | |
35 | + ODS_D_DIM_DATE, | |
36 | + ODS_F_GRAVIDA_RECORD, | |
37 | + ODS_F_EXAMINE_HISTORY, | |
38 | + ODS_D_HOSPITAL, | |
39 | + ODS_D_CITY | |
40 | + WHERE | |
41 | + ( ODS_F_GRAVIDA_RECORD.RECORD_ID=ODS_F_EXAMINE_HISTORY.RECORD_ID(+) ) | |
42 | + AND ( ODS_F_GRAVIDA_RECORD.HOSPITAL_NO=ODS_D_HOSPITAL.HOSPITAL_NO ) | |
43 | + AND ( ODS_D_CITY.PROVINCE_ID=ODS_D_PROVINCE.PROVINCE_ID ) | |
44 | + AND ( ODS_F_GRAVIDA_RECORD.INSERT_DATE=ODS_D_DIM_DATE.DATE_1 ) | |
45 | + AND ( ODS_D_HOSPITAL.CITY_ID=ODS_D_CITY.CITY_ID(+) ) | |
46 | + AND | |
47 | + ( | |
48 | + ODS_F_EXAMINE_HISTORY.EXAMINE_HISTORY_NUM = 1 | |
49 | + AND | |
50 | + ODS_F_EXAMINE_HISTORY.HIGH_RISK_FACTOR NOT IN ( '健康','健康,无' ) | |
51 | + ) | |
52 | + AND ODS_D_DIM_DATE.YEAR_1=2016 | |
53 | + GROUP BY | |
54 | + ODS_D_PROVINCE.PROVINCE_ID, | |
55 | + ODS_D_PROVINCE.PROVINCE, | |
56 | + ODS_D_DIM_DATE.YEAR_1 |
platform-resource/resources/config-dev.properties
View file @
f5354af
... | ... | @@ -15,4 +15,9 @@ |
15 | 15 | mysql.db.password=platform123 |
16 | 16 | mysql.driver=com.mysql.jdbc.Driver |
17 | 17 | mysql.jdbcurl=jdbc:mysql://192.168.5.250:3306/platform?autoReconnect=true&useUnicode=true&characterEncoding=UTF-8 |
18 | + | |
19 | + | |
20 | +report.db.jdbcurl=jdbc:oracle:thin:@192.168.1.32:1521:orcl | |
21 | +report.db.username=LYMS_ODS | |
22 | +report.db.password=Welcome1 |
platform-resource/resources/config-product.properties
View file @
f5354af
platform-resource/resources/config-test.properties
View file @
f5354af