Commit f437030135079afab73e057b9de9fa69bc84370c
1 parent
b1d9bd7e0b
Exists in
master
修改产检删除
Showing 2 changed files with 118 additions and 0 deletions
platform-dal/src/main/java/com/lyms/platform/query/OrganizationGroupsItemQuery.java
View file @
f437030
| 1 | +package com.lyms.platform.query; | |
| 2 | + | |
| 3 | +import com.lyms.platform.common.base.IConvertToNativeQuery; | |
| 4 | +import com.lyms.platform.common.dao.BaseQuery; | |
| 5 | +import com.lyms.platform.common.dao.operator.MongoCondition; | |
| 6 | +import com.lyms.platform.common.dao.operator.MongoOper; | |
| 7 | +import com.lyms.platform.common.dao.operator.MongoQuery; | |
| 8 | + | |
| 9 | +import java.util.List; | |
| 10 | + | |
| 11 | +/** | |
| 12 | + * | |
| 13 | + * 机构组 | |
| 14 | + * | |
| 15 | + * Created by Administrator on 2016/12/21 0021. | |
| 16 | + */ | |
| 17 | +public class OrganizationGroupsItemQuery extends BaseQuery implements IConvertToNativeQuery { | |
| 18 | + //分组id | |
| 19 | + private String groupId; | |
| 20 | + | |
| 21 | + private List<Integer> hId; | |
| 22 | + //上级节点id | |
| 23 | + private String parentId; | |
| 24 | + | |
| 25 | + | |
| 26 | + @Override | |
| 27 | + public MongoQuery convertToQuery() { | |
| 28 | + MongoCondition condition = MongoCondition.newInstance(); | |
| 29 | + if(null!=groupId){ | |
| 30 | + condition=condition.and("groupId",groupId, MongoOper.IS); | |
| 31 | + } | |
| 32 | + if(null!=parentId){ | |
| 33 | + condition=condition.and("parentId",parentId, MongoOper.IS); | |
| 34 | + } | |
| 35 | + if(null!=hId){ | |
| 36 | + condition=condition.and("hId",hId, MongoOper.IN); | |
| 37 | + } | |
| 38 | + | |
| 39 | + return condition.toMongoQuery(); | |
| 40 | + } | |
| 41 | + | |
| 42 | + | |
| 43 | + public String getGroupId() { | |
| 44 | + return groupId; | |
| 45 | + } | |
| 46 | + | |
| 47 | + public void setGroupId(String groupId) { | |
| 48 | + this.groupId = groupId; | |
| 49 | + } | |
| 50 | + | |
| 51 | + public List<Integer> gethId() { | |
| 52 | + return hId; | |
| 53 | + } | |
| 54 | + | |
| 55 | + public void sethId(List<Integer> hId) { | |
| 56 | + this.hId = hId; | |
| 57 | + } | |
| 58 | + | |
| 59 | + public String getParentId() { | |
| 60 | + return parentId; | |
| 61 | + } | |
| 62 | + | |
| 63 | + public void setParentId(String parentId) { | |
| 64 | + this.parentId = parentId; | |
| 65 | + } | |
| 66 | +} |
platform-dal/src/main/java/com/lyms/platform/query/OrganizationGroupsQuery.java
View file @
f437030
| 1 | +package com.lyms.platform.query; | |
| 2 | + | |
| 3 | +import com.lyms.platform.common.base.IConvertToNativeQuery; | |
| 4 | +import com.lyms.platform.common.dao.BaseQuery; | |
| 5 | +import com.lyms.platform.common.dao.operator.MongoCondition; | |
| 6 | +import com.lyms.platform.common.dao.operator.MongoOper; | |
| 7 | +import com.lyms.platform.common.dao.operator.MongoQuery; | |
| 8 | +import com.lyms.platform.common.utils.StringUtils; | |
| 9 | + | |
| 10 | +/** | |
| 11 | + * | |
| 12 | + * | |
| 13 | + * Created by Administrator on 2016/12/21 0021. | |
| 14 | + */ | |
| 15 | +public class OrganizationGroupsQuery extends BaseQuery implements IConvertToNativeQuery { | |
| 16 | + | |
| 17 | + | |
| 18 | + private String id; | |
| 19 | + | |
| 20 | + //机构id | |
| 21 | + private Integer owner; | |
| 22 | + | |
| 23 | + | |
| 24 | + @Override | |
| 25 | + public MongoQuery convertToQuery() { | |
| 26 | + MongoCondition condition = MongoCondition.newInstance(); | |
| 27 | + if (StringUtils.isEmpty(id)) { | |
| 28 | + condition.and("id", id, MongoOper.IS); | |
| 29 | + } | |
| 30 | + | |
| 31 | + if (null != owner) { | |
| 32 | + condition.and("owner", owner, MongoOper.IS); | |
| 33 | + } | |
| 34 | + return condition.toMongoQuery(); | |
| 35 | + } | |
| 36 | + | |
| 37 | + public String getId() { | |
| 38 | + return id; | |
| 39 | + } | |
| 40 | + | |
| 41 | + public void setId(String id) { | |
| 42 | + this.id = id; | |
| 43 | + } | |
| 44 | + | |
| 45 | + public Integer getOwner() { | |
| 46 | + return owner; | |
| 47 | + } | |
| 48 | + | |
| 49 | + public void setOwner(Integer owner) { | |
| 50 | + this.owner = owner; | |
| 51 | + } | |
| 52 | +} |