@GetMapping("/resident-list")
public TableDataInfo getResidentListMChoice(SysResident resident, HttpServletRequest request){
LoginUser docLoginUser = tokenUitls.getLoginUser(request);
if(StringUtils.isBlank(resident.getHosId())) {
resident.setHosId(docLoginUser.getLoginInfo().getOrgId());
if (!StringUtils.isBlank(resident.getTagsId())){
List tagsIdList = new ArrayList<>();
for (String tagsId : resident.getTagsId().split(",")) {
tagsIdList.add(Integer.parseInt(tagsId));
resident.setTagsIdList(tagsIdList);
if(!Objects.isNull(resident.getParams()) && !Objects.isNull(resident.getParams().get("isSelfResident"))) {
String isSelfResidentFlag = resident.getParams().get("isSelfResident").toString();
if(Objects.equals(isSelfResidentFlag, "1")) {
resident.setCreateBy(docLoginUser.getUserId());
List list = residentService.getResidentMChoiceVoList(resident);
for (SysResidentVo sysResidentVo : list) {
sysResidentVo.setTags(residentService.getResidentInfo(sysResidentVo.getResidentId()).getTags());
return getDataTable(list);
----------------------------Mapper---------------------------------
sr.glycosylated_hemoglobin,
left join sys_org t2 on sr.hos_id = t2.org_id
<if test="resident.residentId != null and resident.residentId != ''"> and sr.resident_id = #{resident.residentId}if>
<if test="resident.residentName != null and resident.residentName != ''"> and sr.resident_name like concat('%', #{resident.residentName}, '%')if>
<if test="resident.residentSex != null and resident.residentSex != ''"> and sr.resident_sex = #{resident.residentSex}if>
<if test="resident.idCard != null and resident.idCard != ''"> and upper(sr.id_card) = upper(#{resident.idCard})if>
<if test="resident.cityCode != null and resident.cityCode != ''"> and sr.city_code = #{resident.cityCode}if>
<if test="resident.residentPhone != null and resident.residentPhone != ''"> and sr.resident_phone = #{resident.residentPhone}if>
<if test="resident.createBy != null and resident.createBy != ''"> and sr.create_by = #{resident.createBy}if>
<if test="resident.tagsIdList != null and resident.tagsIdList.size > 0">
and sr.resident_id in (select tags.resident_id from sys_resident_tags tags where tags.tags_id in
"resident.tagsIdList" separator="," item="item" open="(" close=")">
<if test="resident.createTimeBegin != null"> and DATE_FORMAT(sr.create_time, '%Y-%m-%d') >= #{resident.createTimeBegin} if>
<if test="resident.createTimeEnd != null"> and DATE_FORMAT(sr.create_time, '%Y-%m-%d') <= #{resident.createTimeEnd} if>
<if test="resident.hosId != null"> and sr.hos_id in (select
FIND_IN_SET(#{resident.hosId}, t1.path))
order by sr.create_time desc
