Commit 22a0f4b2b6c93383c937a67f0d943139a06295df
1 parent
7acc9793b3
Exists in
master
and in
8 other branches
增加社区id
Showing 3 changed files with 84 additions and 10 deletions
platform-biz-patient-service/src/main/java/com/lyms/platform/biz/dal/impl/PatientDaoImpl.java
View file @
22a0f4b
1 | 1 | package com.lyms.platform.biz.dal.impl; |
2 | 2 | |
3 | 3 | import com.lyms.platform.biz.dal.IPatientDao; |
4 | +import com.lyms.platform.common.dao.BaseMongoDAOImpl; | |
4 | 5 | import com.lyms.platform.common.dao.operator.MongoCondition; |
5 | 6 | import com.lyms.platform.common.dao.operator.MongoOper; |
6 | 7 | import com.lyms.platform.common.dao.operator.MongoQuery; |
7 | 8 | import com.lyms.platform.common.dao.operator.Page; |
8 | 9 | import com.lyms.platform.pojo.Patients; |
9 | -import com.lyms.platform.common.dao.BaseMongoDAOImpl; | |
10 | +import org.bson.types.ObjectId; | |
10 | 11 | import org.springframework.stereotype.Repository; |
11 | 12 | |
12 | 13 | import java.util.List; |
13 | 14 | |
14 | 15 | /** |
15 | - * | |
16 | 16 | * 患者模型 |
17 | - * | |
18 | - * | |
17 | + * <p> | |
18 | + * <p> | |
19 | 19 | * Created by Administrator on 2016/4/22 0022. |
20 | 20 | */ |
21 | 21 | @Repository("patientDaoImpl") |
22 | -public class PatientDaoImpl extends BaseMongoDAOImpl<Patients> implements IPatientDao { | |
22 | +public class PatientDaoImpl extends BaseMongoDAOImpl<Patients> implements IPatientDao { | |
23 | 23 | @Override |
24 | 24 | public Patients addPatient(Patients obj) { |
25 | - return save(obj); | |
25 | + return save(obj); | |
26 | 26 | } |
27 | 27 | |
28 | 28 | @Override |
29 | 29 | public void updatePatient(Patients obj, String id) { |
30 | - update(new MongoQuery(new MongoCondition("id", id, MongoOper.IS)).convertToMongoQuery(), obj); | |
30 | + boolean check = ObjectId.isValid(id); | |
31 | + if (check) { | |
32 | + update(new MongoQuery(new MongoCondition("id", new ObjectId(id), MongoOper.IS)).convertToMongoQuery(), obj); | |
33 | + } | |
31 | 34 | } |
32 | 35 | |
33 | 36 | @Override |
34 | 37 | public void deletePatient(String id) { |
35 | - delete(new MongoQuery(new MongoCondition("id", id, MongoOper.IS)).convertToMongoQuery()); | |
38 | + boolean check = ObjectId.isValid(id); | |
39 | + if (check) { | |
40 | + delete(new MongoQuery(new MongoCondition("id", new ObjectId(id), MongoOper.IS)).convertToMongoQuery()); | |
41 | + } | |
36 | 42 | } |
37 | 43 | |
38 | 44 | @Override |
39 | 45 | public Patients getPatient(String id) { |
40 | - return findById(id); | |
46 | + return findById(id); | |
41 | 47 | } |
42 | 48 | |
43 | 49 | @Override |
platform-dal/src/main/java/com/lyms/platform/pojo/Patients.java
View file @
22a0f4b
... | ... | @@ -84,6 +84,71 @@ |
84 | 84 | |
85 | 85 | private Integer patientLevel; |
86 | 86 | |
87 | + private String lastCheckEmployeeId; | |
88 | + private Integer lastReportId; | |
89 | + | |
90 | + private String riskFactorId; | |
91 | + private String riskGroupId; | |
92 | + private Integer serviceType; | |
93 | + private Integer vip; | |
94 | + private String lastReportDoctorName; | |
95 | + | |
96 | + public String getLastCheckEmployeeId() { | |
97 | + return lastCheckEmployeeId; | |
98 | + } | |
99 | + | |
100 | + public void setLastCheckEmployeeId(String lastCheckEmployeeId) { | |
101 | + this.lastCheckEmployeeId = lastCheckEmployeeId; | |
102 | + } | |
103 | + | |
104 | + public String getLastReportDoctorName() { | |
105 | + return lastReportDoctorName; | |
106 | + } | |
107 | + | |
108 | + public void setLastReportDoctorName(String lastReportDoctorName) { | |
109 | + this.lastReportDoctorName = lastReportDoctorName; | |
110 | + } | |
111 | + | |
112 | + public Integer getLastReportId() { | |
113 | + return lastReportId; | |
114 | + } | |
115 | + | |
116 | + public void setLastReportId(Integer lastReportId) { | |
117 | + this.lastReportId = lastReportId; | |
118 | + } | |
119 | + | |
120 | + public String getRiskFactorId() { | |
121 | + return riskFactorId; | |
122 | + } | |
123 | + | |
124 | + public void setRiskFactorId(String riskFactorId) { | |
125 | + this.riskFactorId = riskFactorId; | |
126 | + } | |
127 | + | |
128 | + public String getRiskGroupId() { | |
129 | + return riskGroupId; | |
130 | + } | |
131 | + | |
132 | + public void setRiskGroupId(String riskGroupId) { | |
133 | + this.riskGroupId = riskGroupId; | |
134 | + } | |
135 | + | |
136 | + public Integer getServiceType() { | |
137 | + return serviceType; | |
138 | + } | |
139 | + | |
140 | + public void setServiceType(Integer serviceType) { | |
141 | + this.serviceType = serviceType; | |
142 | + } | |
143 | + | |
144 | + public Integer getVip() { | |
145 | + return vip; | |
146 | + } | |
147 | + | |
148 | + public void setVip(Integer vip) { | |
149 | + this.vip = vip; | |
150 | + } | |
151 | + | |
87 | 152 | public Integer getPatientLevel() { |
88 | 153 | return patientLevel; |
89 | 154 | } |
platform-dal/src/main/java/com/lyms/platform/query/PatientsQuery.java
View file @
22a0f4b
... | ... | @@ -67,7 +67,7 @@ |
67 | 67 | /** |
68 | 68 | * 是否有效 |
69 | 69 | */ |
70 | - private int yn; | |
70 | + private int yn=-1; | |
71 | 71 | |
72 | 72 | |
73 | 73 | public String getCardNo() { |
... | ... | @@ -158,6 +158,9 @@ |
158 | 158 | } |
159 | 159 | if(null!=cardNo){ |
160 | 160 | condition=condition.and("cardno", cardNo, MongoOper.IS); |
161 | + } | |
162 | + if(-1!=yn){ | |
163 | + condition=condition.and("yn", yn, MongoOper.IS); | |
161 | 164 | } |
162 | 165 | /*if(null!=dueDateStart){ |
163 | 166 | // condition= condition.elemMatch("dueDate",MongoCondition.newInstance("$lte", dueDateStart, MongoOper.IS).and("$gte", dueDateEnd, MongoOper.IS)); |