Commit 0de1ce032cd4763e3c0ffad1eb7c37f5daeb96fd

Authored by liquanyu
1 parent 980d355c57

快速测量

Showing 4 changed files with 128 additions and 97 deletions

platform-biz-service/src/main/java/com/lyms/platform/permission/dao/master/MeasureDataInfoMapper.java View file @ 0de1ce0
... ... @@ -20,5 +20,7 @@
20 20 int queryMeasureDataInfoListCount(MeasureDataInfoQuery query);
21 21  
22 22 List<MeasureDataInfoModel> queryMeasureList(MeasureDataInfoQuery query);
  23 +
  24 + int queryMeasureListCount(MeasureDataInfoQuery query);
23 25 }
platform-biz-service/src/main/java/com/lyms/platform/permission/service/impl/MeasureDataInfoServiceImpl.java View file @ 0de1ce0
... ... @@ -41,6 +41,9 @@
41 41  
42 42 @Override
43 43 public List<MeasureDataInfoModel> queryMeasureList(MeasureDataInfoQuery query) {
  44 + if (query.getNeed() != null) {
  45 + query.mysqlBuild(measureDataInfoMapper.queryMeasureListCount(query));
  46 + }
44 47 return measureDataInfoMapper.queryMeasureList(query);
45 48 }
46 49 }
platform-biz-service/src/main/resources/mainOrm/master/MeasureDataInfoMapper.xml View file @ 0de1ce0
... ... @@ -70,6 +70,112 @@
70 70 <include refid="orderAndLimit"/>
71 71 </select>
72 72  
  73 +
  74 +
  75 + <sql id="queryMeasureListCondition">
  76 + <where>
  77 + 1 = 1
  78 + <if test="id != null and id >= 0">
  79 + and m.id = #{id,jdbcType=INTEGER}
  80 + </if>
  81 + <if test="valueOne != null and valueOne != ''">
  82 + and m.value_one = #{valueOne,jdbcType=VARCHAR}
  83 + </if>
  84 + <if test="valueTwo != null and valueTwo != ''">
  85 + and m.value_two = #{valueTwo,jdbcType=VARCHAR}
  86 + </if>
  87 + <if test="valueThree != null and valueThree != ''">
  88 + and m.value_three = #{valueThree,jdbcType=VARCHAR}
  89 + </if>
  90 + <if test="valueType != null and valueType > 0">
  91 + and m.value_type = #{valueType,jdbcType=INTEGER}
  92 + </if>
  93 + <if test="created != null">
  94 + AND date_format(m.created,'%Y-%m-%d') = #{created}
  95 + </if>
  96 + <if test="recordCount != null and recordCount >= 0">
  97 + and m.record_count = #{m.recordCount,jdbcType=INTEGER}
  98 + </if>
  99 +
  100 + <if test="modified != null">
  101 + AND date_format(m.modified,'%Y-%m-%d') = #{modified}
  102 + </if>
  103 +
  104 + <if test="createdTimeStart != null">
  105 + AND m.created >= date_format(#{createdTimeStart},'%Y-%m-%d')
  106 + </if>
  107 + <if test="createdTimeEnd != null">
  108 + AND <![CDATA[ m.created < date_format(#{createdTimeEnd},'%Y-%m-%d') ]]>
  109 + </if>
  110 +
  111 + <if test="modifiedTimeStart != null">
  112 + AND m.modified >= date_format(#{modifiedTimeStart},'%Y-%m-%d')
  113 + </if>
  114 + <if test="modifiedTimeEnd != null">
  115 + AND <![CDATA[ m.modified < date_format(#{modifiedTimeEnd},'%Y-%m-%d') ]]>
  116 + </if>
  117 +
  118 + <if test="todayCount != null and todayCount > 0">
  119 + m.today_count = #{todayCount,jdbcType=INTEGER},
  120 + </if>
  121 +
  122 + <if test="queryNo != null and queryNo != ''">
  123 + and (u.phone = #{queryNo,jdbcType=VARCHAR} or u.cert_no = #{queryNo,jdbcType=VARCHAR}
  124 + or u.user_name = #{queryNo,jdbcType=VARCHAR})
  125 + </if>
  126 +
  127 + <if test="hospitalId != null and hospitalId != ''">
  128 + and u.hospital_id = #{hospitalId,jdbcType=VARCHAR}
  129 + </if>
  130 + <if test="hospitalIds != null and hospitalIds.size() > 0">
  131 + and u.hospital_id in
  132 + <foreach collection="hospitalIds" index="index" item="item" open="(" separator="," close=")">
  133 + #{item}
  134 + </foreach>
  135 + </if>
  136 + <if test="address != null and address != ''">
  137 + and u.address = #{address,jdbcType=VARCHAR}
  138 + </if>
  139 + <if test="face != null and face != ''">
  140 + and u.face = #{face,jdbcType=VARCHAR}
  141 + </if>
  142 + <if test="finger != null and finger != ''">
  143 + and u.finger = #{finger,jdbcType=VARCHAR}
  144 + </if>
  145 +
  146 + <if test="userName != null">
  147 + and u.user_name = #{userName,jdbcType=VARCHAR}
  148 + </if>
  149 + <if test="certType != null and certType != ''">
  150 + and u.cert_type = #{certType,jdbcType=VARCHAR}
  151 + </if>
  152 + <if test="certNo != null and certNo != ''">
  153 + and u.cert_no = #{certNo,jdbcType=VARCHAR}
  154 + </if>
  155 + <if test="age != null and age != ''">
  156 + and u.age = #{age,jdbcType=VARCHAR}
  157 + </if>
  158 + <if test="phone != null and phone != ''">
  159 + and u.phone = #{phone,jdbcType=VARCHAR}
  160 + </if>
  161 + <if test="sex != null">
  162 + and u.sex = #{sex,jdbcType=INTEGER}
  163 + </if>
  164 + <if test="vcCardNo != null and vcCardNo != ''">
  165 + and u.vc_card_no = #{vcCardNo,jdbcType=VARCHAR}
  166 + </if>
  167 + <if test="zyNo != null and zyNo != ''">
  168 + and u.zy_no = #{zyNo,jdbcType=VARCHAR}
  169 + </if>
  170 + <if test="visitId != null and visitId != ''">
  171 + and u.visit_id = #{visitId,jdbcType=VARCHAR}
  172 + </if>
  173 + <if test="patientId != null and patientId != ''">
  174 + and u.patient_id = #{valueOne,jdbcType=VARCHAR}
  175 + </if>
  176 + </where>
  177 + </sql>
  178 +
73 179 <select id="queryMeasureList" parameterType="com.lyms.platform.query.MeasureDataInfoQuery"
74 180 resultMap="measureDataInfoModelMapList">
75 181 SELECT
76 182  
77 183  
78 184  
79 185  
... ... @@ -85,111 +191,30 @@
85 191 FROM measure_data_info m
86 192 LEFT JOIN
87 193 measure_user_info u ON m.measure_user_id = u.id
88   - WHERE 1 = 1
89   - <if test="id != null and id >= 0">
90   - and m.id = #{id,jdbcType=INTEGER}
  194 + <include refid="queryMeasureListCondition"/>
  195 + order by m.created desc
  196 + <if test="need != null">
  197 + limit #{offset, jdbcType=INTEGER} , #{limit, jdbcType=INTEGER}
91 198 </if>
92   - <if test="valueOne != null and valueOne != ''">
93   - and m.value_one = #{valueOne,jdbcType=VARCHAR}
94   - </if>
95   - <if test="valueTwo != null and valueTwo != ''">
96   - and m.value_two = #{valueTwo,jdbcType=VARCHAR}
97   - </if>
98   - <if test="valueThree != null and valueThree != ''">
99   - and m.value_three = #{valueThree,jdbcType=VARCHAR}
100   - </if>
101   - <if test="valueType != null and valueType > 0">
102   - and m.value_type = #{valueType,jdbcType=INTEGER}
103   - </if>
104   - <if test="created != null">
105   - AND date_format(m.created,'%Y-%m-%d') = #{created}
106   - </if>
107   - <if test="recordCount != null and recordCount >= 0">
108   - and m.record_count = #{m.recordCount,jdbcType=INTEGER}
109   - </if>
  199 + </select>
110 200  
111   - <if test="modified != null">
112   - AND date_format(m.modified,'%Y-%m-%d') = #{modified}
113   - </if>
114 201  
115   - <if test="createdTimeStart != null">
116   - AND m.created >= date_format(#{createdTimeStart},'%Y-%m-%d')
117   - </if>
118   - <if test="createdTimeEnd != null">
119   - AND <![CDATA[ m.created < date_format(#{createdTimeEnd},'%Y-%m-%d') ]]>
120   - </if>
121   -
122   - <if test="modifiedTimeStart != null">
123   - AND m.modified >= date_format(#{modifiedTimeStart},'%Y-%m-%d')
124   - </if>
125   - <if test="modifiedTimeEnd != null">
126   - AND <![CDATA[ m.modified < date_format(#{modifiedTimeEnd},'%Y-%m-%d') ]]>
127   - </if>
128   -
129   - <if test="todayCount != null and todayCount > 0">
130   - m.today_count = #{todayCount,jdbcType=INTEGER},
131   - </if>
132   -
133   - <if test="queryNo != null and queryNo != ''">
134   - and (u.phone = #{queryNo,jdbcType=VARCHAR} or u.cert_no = #{queryNo,jdbcType=VARCHAR}
135   - or u.user_name = #{queryNo,jdbcType=VARCHAR})
136   - </if>
137   -
138   - <if test="hospitalId != null and hospitalId != ''">
139   - and u.hospital_id = #{hospitalId,jdbcType=VARCHAR}
140   - </if>
141   - <if test="hospitalIds != null and hospitalIds.size() > 0">
142   - and u.hospital_id in
143   - <foreach collection="hospitalIds" index="index" item="item" open="(" separator="," close=")">
144   - #{item}
145   - </foreach>
146   - </if>
147   - <if test="address != null and address != ''">
148   - and u.address = #{address,jdbcType=VARCHAR}
149   - </if>
150   - <if test="face != null and face != ''">
151   - and u.face = #{face,jdbcType=VARCHAR}
152   - </if>
153   - <if test="finger != null and finger != ''">
154   - and u.finger = #{finger,jdbcType=VARCHAR}
155   - </if>
156   -
157   - <if test="userName != null">
158   - and u.user_name = #{userName,jdbcType=VARCHAR}
159   - </if>
160   - <if test="certType != null and certType != ''">
161   - and u.cert_type = #{certType,jdbcType=VARCHAR}
162   - </if>
163   - <if test="certNo != null and certNo != ''">
164   - and u.cert_no = #{certNo,jdbcType=VARCHAR}
165   - </if>
166   - <if test="age != null and age != ''">
167   - and u.age = #{age,jdbcType=VARCHAR}
168   - </if>
169   - <if test="phone != null and phone != ''">
170   - and u.phone = #{phone,jdbcType=VARCHAR}
171   - </if>
172   - <if test="sex != null">
173   - and u.sex = #{sex,jdbcType=INTEGER}
174   - </if>
175   - <if test="vcCardNo != null and vcCardNo != ''">
176   - and u.vc_card_no = #{vcCardNo,jdbcType=VARCHAR}
177   - </if>
178   - <if test="zyNo != null and zyNo != ''">
179   - and u.zy_no = #{zyNo,jdbcType=VARCHAR}
180   - </if>
181   - <if test="visitId != null and visitId != ''">
182   - and u.visit_id = #{visitId,jdbcType=VARCHAR}
183   - </if>
184   - <if test="patientId != null and patientId != ''">
185   - and u.patient_id = #{valueOne,jdbcType=VARCHAR}
186   - </if>
  202 + <select id="queryMeasureListCount" parameterType="com.lyms.platform.query.MeasureDataInfoQuery"
  203 + resultType="int">
  204 + SELECT
  205 + count(m.id)
  206 + FROM measure_data_info m
  207 + LEFT JOIN
  208 + measure_user_info u ON m.measure_user_id = u.id
  209 + <include refid="queryMeasureListCondition"/>
187 210 order by m.created desc
188 211 <if test="need != null">
189 212 limit #{offset, jdbcType=INTEGER} , #{limit, jdbcType=INTEGER}
190 213 </if>
191 214 </select>
192 215  
  216 +
  217 +
193 218 <select id="queryMeasureDataInfoListCount" parameterType="com.lyms.platform.query.MeasureDataInfoQuery" resultType="int">
194 219 SELECT count(id) FROM measure_data_info
195 220 <include refid="queryMeasureDataInfoCondition"/>
... ... @@ -299,7 +324,7 @@
299 324 </if>
300 325  
301 326 <if test="todayCount != null and todayCount > 0">
302   - today_count = #{todayCount,jdbcType=INTEGER},
  327 + AND today_count = #{todayCount,jdbcType=INTEGER}
303 328 </if>
304 329 </where>
305 330 </sql>
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/MeasureInfoFacade.java View file @ 0de1ce0
... ... @@ -499,6 +499,7 @@
499 499 MeasureUserInfoQuery query = new MeasureUserInfoQuery();
500 500 query.setCertType(certType);
501 501 query.setCertNo(certNo);
  502 + query.setHospitalId(hospitalId);
502 503 query.setNeed("true");
503 504 query.setSort(" created desc ");
504 505 List<MeasureUserInfoModel> models = mysqlMeasureUserInfoService.queryMeasureUserInfoList(query);