提交 9495214a 编写于 作者: dong.an's avatar dong.an

查询用户信息

上级 3217e131
流水线 #12440 已失败 于阶段
in 0 second
......@@ -3,6 +3,8 @@ package com.pica.cloud.account.account.common.req;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.util.List;
/**
* @author andong
* @create 2019/7/18
......@@ -20,19 +22,19 @@ public class AccountInfoReq {
private Long countyId;
@ApiModelProperty("技术职称ID")
private Long titleId;
private List<Long> titleIds;
@ApiModelProperty("医院等级编号")
private Integer levelGrade;
private List<Integer> levelGrades;
public AccountInfoReq() {}
public AccountInfoReq(Long provinceId, Long cityId, Long countyId, Long titleId, Integer levelGrade) {
public AccountInfoReq(Long provinceId, Long cityId, Long countyId, List<Long> titleIds, List<Integer> levelGrades) {
this.provinceId = provinceId;
this.cityId = cityId;
this.countyId = countyId;
this.titleId = titleId;
this.levelGrade = levelGrade;
this.titleIds = titleIds;
this.levelGrades = levelGrades;
}
public Long getProvinceId() {
......@@ -59,19 +61,19 @@ public class AccountInfoReq {
this.countyId = countyId;
}
public Long getTitleId() {
return titleId;
public List<Long> getTitleIds() {
return titleIds;
}
public void setTitleId(Long titleId) {
this.titleId = titleId;
public void setTitleIds(List<Long> titleIds) {
this.titleIds = titleIds;
}
public Integer getLevelGrade() {
return levelGrade;
public List<Integer> getLevelGrades() {
return levelGrades;
}
public void setLevelGrade(Integer levelGrade) {
this.levelGrade = levelGrade;
public void setLevelGrades(List<Integer> levelGrades) {
this.levelGrades = levelGrades;
}
}
......@@ -5,6 +5,7 @@ import com.pica.cloud.account.account.server.service.AccountInfoService;
import com.pica.cloud.foundation.entity.PicaResponse;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.apache.commons.collections.CollectionUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
......@@ -28,7 +29,7 @@ public class AccountInfoController {
@GetMapping("/count")
public PicaResponse<Integer> getCount(AccountInfoReq req) {
if (req.getProvinceId() == null && req.getCityId() == null && req.getCountyId() == null
&& req.getTitleId() == null && req.getLevelGrade() == null) {
&& CollectionUtils.isEmpty(req.getTitleIds()) && CollectionUtils.isEmpty(req.getLevelGrades())) {
return PicaResponse.toResponse(accountInfoService.getTotalCount());
}
return PicaResponse.toResponse(accountInfoService.getCount(req));
......@@ -38,7 +39,7 @@ public class AccountInfoController {
@GetMapping("/doctorIds")
public PicaResponse<List<Integer>> getDoctorIds(AccountInfoReq req) {
if (req.getProvinceId() == null && req.getCityId() == null && req.getCountyId() == null
&& req.getTitleId() == null && req.getLevelGrade() == null) {
&& CollectionUtils.isEmpty(req.getTitleIds()) && CollectionUtils.isEmpty(req.getLevelGrades())) {
return PicaResponse.toResponse(Collections.emptyList());
}
return PicaResponse.toResponse(accountInfoService.getDoctorIds(req));
......
......@@ -19,11 +19,17 @@
<if test="countyId != null">
and h.county_id = #{countyId}
</if>
<if test="titleId != null">
and d.title_id = #{titleId}
</if>
<if test="levelGrade != null">
and h.level_grade = #{levelGrade}
<if test="titleIds != null and titleIds.size > 0">
and d.title_id in
<foreach item="item" collection="titleIds" separator="," open="(" close=")" index="">
#{item}
</foreach>
</if>
<if test="levelGrades != null and levelGrades.size > 0">
and h.level_grade in
<foreach item="item" collection="levelGrades" separator="," open="(" close=")" index="">
#{item}
</foreach>
</if>
</select>
......@@ -40,11 +46,17 @@
<if test="countyId != null">
and h.county_id = #{countyId}
</if>
<if test="titleId != null">
and d.title_id = #{titleId}
</if>
<if test="levelGrade != null">
and h.level_grade = #{levelGrade}
<if test="titleIds != null and titleIds.size > 0">
and d.title_id in
<foreach item="item" collection="titleIds" separator="," open="(" close=")" index="">
#{item}
</foreach>
</if>
<if test="levelGrades != null and levelGrades.size > 0">
and h.level_grade in
<foreach item="item" collection="levelGrades" separator="," open="(" close=")" index="">
#{item}
</foreach>
</if>
</select>
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册