Commit 3d7d51555c2c1aa396ddf70a5f7677eac1269cf1

Authored by jiangjiazhi
1 parent 45f158682b

1

Showing 4 changed files with 29 additions and 6 deletions

platform-biz-service/src/main/java/com/lyms/platform/permission/dao/master/PatientServiceMapper.java View file @ 3d7d515
... ... @@ -27,5 +27,8 @@
27 27 */
28 28 List<Map> selectOnlyBzService(PatientServiceQuery query);
29 29  
  30 +
  31 + int selectOnlyBzServiceCount(PatientServiceQuery query);
  32 +
30 33 }
platform-biz-service/src/main/java/com/lyms/platform/permission/service/impl/PatientServiceServiceImpl.java View file @ 3d7d515
... ... @@ -51,6 +51,9 @@
51 51  
52 52 @Override
53 53 public List<Map> selectOnlyBzService(PatientServiceQuery query) {
  54 + if (query.getNeed() != null) {
  55 + query.mysqlBuild(patientServiceMapper.selectOnlyBzServiceCount(query));
  56 + }
54 57 return patientServiceMapper.selectOnlyBzService(query);
55 58 }
56 59 }
platform-biz-service/src/main/resources/mainOrm/master/PatientService.xml View file @ 3d7d515
... ... @@ -250,6 +250,19 @@
250 250 <include refid="orderAndLimit"/>
251 251 </select>
252 252  
  253 +
  254 + <!--查询只开通了标准服务的数据 -->
  255 + <select id="selectOnlyBzServiceCount" resultType="java.util.HashMap" parameterType="com.lyms.platform.permission.model.PatientServiceQuery">
  256 + SELECT count(1) from (SELECT parentid,id from patient_service where ser_status=1
  257 + <if test="perType != null and perType != ''">
  258 + and per_type = #{perType,jdbcType=INTEGER}
  259 + </if>
  260 +
  261 + and ser_type in (1,6,10,11)
  262 +
  263 + GROUP BY parentid HAVING count(parentid)=1) as b
  264 + </select>
  265 +
253 266 <select id="queryPatientServiceCount" resultType="int"
254 267 parameterType="com.lyms.platform.permission.model.PatientServiceQuery">
255 268 select count(1) from patient_service
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/TestController.java View file @ 3d7d515
... ... @@ -2158,9 +2158,11 @@
2158 2158 Patients patients = patientsService.findOnePatientById(parentId);
2159 2159 if (null != patients) {
2160 2160 //改成不开通
2161   - patients.setServiceStatus(1);
2162   - patients.setModified(new Date());
2163   - patientsService.updatePatient(patients);
  2161 + Patients p1= new Patients();
  2162 + p1.setServiceStatus(1);
  2163 + p1.setId(patients.getId());
  2164 + p1.setModified(new Date());
  2165 + patientsService.updatePatient(p1);
2164 2166 }
2165 2167 } else {
2166 2168 BabyModelQuery babyModelQuery = new BabyModelQuery();
... ... @@ -2169,9 +2171,11 @@
2169 2171 List<BabyModel> babyModel = babyBookbuildingService.queryBabyBuildByCond(babyModelQuery);
2170 2172 if(CollectionUtils.isNotEmpty(babyModel)){
2171 2173 BabyModel baby = babyModel.get(0);
2172   - baby.setServiceStatus(1);
2173   - baby.setModified(new Date());
2174   - babyBookbuildingService.updateBabyBuild(baby,baby.getId());
  2174 + BabyModel baby1=new BabyModel();
  2175 + baby1.setServiceStatus(1);
  2176 + baby1.setModified(new Date());
  2177 + baby1.setId(baby.getId());
  2178 + babyBookbuildingService.updateBabyBuild(baby1,baby.getId());
2175 2179 }
2176 2180 }
2177 2181