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

查询用户信息

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