| | |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiImplicitParam; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.apache.commons.collections4.CollectionUtils; |
| | | import org.apache.commons.lang3.ObjectUtils; |
| | | import org.springframework.security.access.prepost.PreAuthorize; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | |
| | | @AddOrgId(field = "orgid", paramIndex = 0, campusField = "campusid") |
| | | @PostMapping("/selectPatMedOuthospList") |
| | | @ApiOperation("查询患者门诊记录列表") |
| | | public TableDataInfo selectPatMedOuthosplist(@RequestBody PatMedOuthosp patMedOuthosp) { |
| | | PageUtils.startPageByPost(patMedOuthosp.getPageNum(), patMedOuthosp.getPageSize()); |
| | | public Map<String, Object> selectPatMedOuthosplist(@RequestBody PatMedOuthosp patMedOuthosp) { |
| | | patMedOuthosp.setPageNum(PageUtils.getOffset(patMedOuthosp.getPageNum(), patMedOuthosp.getPageSize())); |
| | | SysUser user = getLoginUser().getUser(); |
| | | patMedOuthosp.setOrgid(user.getOrgid()); |
| | | List<PatMedOuthosp> list = patMedOuthospService.selectPatMedOuthospList(patMedOuthosp); |
| | | return getDataTable(list); |
| | | patMedOuthosp.setPageNum(null); |
| | | patMedOuthosp.setPageSize(null); |
| | | List<PatMedOuthosp> patMedOuthosps = patMedOuthospService.selectPatMedOuthospList(patMedOuthosp); |
| | | Integer count = 0; |
| | | if (CollectionUtils.isNotEmpty(patMedOuthosps)) count = patMedOuthosps.size(); |
| | | return getDataTable3(count, list); |
| | | } |
| | | |
| | | /** |
| | |
| | | private List<Map<String, Object>> belongDepts = new ArrayList(); |
| | | |
| | | |
| | | public String getCampusid() { |
| | | return campusid; |
| | | } |
| | | |
| | | public void setCampusid(String campusid) { |
| | | this.campusid = campusid; |
| | | } |
| | | |
| | | /** |
| | | * 机构ID |
| | | */ |
| | | @ApiModelProperty("院区") |
| | | @Excel(name = " 院区 ") |
| | | private String campusid; |
| | | |
| | | |
| | | public SysUser() { |
| | | |
| | | } |
| | |
| | | public List<SysUserDept> yhyksxx(SysUser sysUser); |
| | | |
| | | /** |
| | | * 用户与病房信息 |
| | | * |
| | | * @param sysUser |
| | | * @return |
| | | */ |
| | | public List<SysUserDept> yhybfxx(SysUser sysUser); |
| | | |
| | | /** |
| | | * 用户与院区信息 |
| | | * |
| | | * @param sysUser |
| | |
| | | public Integer selectUserList(SysUser sysUser) { |
| | | List<SysUser> sysUserList = chMapper.selectUserList(sysUser); |
| | | SysUser suerTemp = new SysUser(); |
| | | //用户-机构关系-科室 |
| | | List<SysUserDept> sysUserDeptAll = chMapper.yhyksxx(suerTemp); |
| | | //用户-机构关系-病房 |
| | | List<SysUserDept> sysUserDeptBfAll = chMapper.yhybfxx(suerTemp); |
| | | //用户-院区关系 |
| | | List<SysUserOrg> sysUserOrgAll = chMapper.yhyyqxx(suerTemp); |
| | | |
| | | log.info("sysUserList的采集到的数量为:{}", sysUserList.size()); |
| | | int i = 0;// sysUser2Mapper.batchUser(sysUserList); |
| | | for (SysUser sysUser1 : sysUserList) { |
| | | // log.info("sysUser1的ID为:{}", sysUser1.getUserId()); |
| | | // log.info("sysUser1的HISUSERID为:{}", sysUser1.getHisUserId()); |
| | | if (StringUtils.isEmpty(sysUser1.getHisUserId())) continue; |
| | | SysUser suTemp = new SysUser(); |
| | | suTemp.setHisUserId(sysUser1.getHisUserId()); |
| | | List<SysUser> usersTemp = sysUser2Mapper.selectUserList(suTemp); |
| | | |
| | | //新增用户与科室 |
| | | List<SysUserDept> sysUserDept = sysUserDeptAll.stream().filter((SysUserDept b) -> b.getUserCode().equals(sysUser1.getHisUserId())).collect(Collectors.toList()); |
| | | //新增用户与病区 |
| | | List<SysUserDept> sysUserDeptBf = sysUserDeptBfAll.stream().filter((SysUserDept b) -> b.getUserCode().equals(sysUser1.getHisUserId())).collect(Collectors.toList()); |
| | | //新增用户与院区 |
| | | List<SysUserOrg> sysUserOrg = sysUserOrgAll.stream().filter((SysUserOrg o) -> o.getUserId().equals(sysUser1.getHisUserId())).collect(Collectors.toList()); |
| | | if (usersTemp.size() > 0) { |
| | | sysUser1.setUserId(usersTemp.get(0).getUserId()); |
| | | sysUser1.setUserName(sysUser1.getHisUserId()); |
| | | //对应 SysUserServiceImpl selectUserByUserName2 191行 |
| | | if (!org.springframework.util.CollectionUtils.isEmpty(sysUserOrg)) { |
| | | sysUser1.setOrgid(sysUserOrg.get(0).getOrgid()); |
| | | sysUser1.setCampusid(sysUserOrg.get(0).getCampusid()); |
| | | } |
| | | sysUser2Mapper.updateUser(sysUser1); |
| | | } else { |
| | | sysUser1.setUserName(sysUser1.getHisUserId()); |
| | | sysUser2Mapper.insertUser(sysUser1); |
| | | //对应 SysUserServiceImpl selectUserByUserName2 191行 |
| | | if (!org.springframework.util.CollectionUtils.isEmpty(sysUserOrg)) { |
| | | sysUser1.setOrgid(sysUserOrg.get(0).getOrgid()); |
| | | sysUser1.setCampusid(sysUserOrg.get(0).getCampusid()); |
| | | } |
| | | usersTemp = sysUser2Mapper.selectUserList(suTemp); |
| | | } |
| | | |
| | | //新增用户与部门 |
| | | //List<SysUserDept> sysUserDept = chMapper.yhyksxx(sysUser1); |
| | | List<SysUserDept> sysUserDept = sysUserDeptAll.stream().filter((SysUserDept b) -> b.getUserCode().equals(sysUser1.getHisUserId())).collect(Collectors.toList()); |
| | | |
| | | for (SysUserDept sud : sysUserDept) { |
| | | if (usersTemp.size() > 0) { |
| | | if (!usersTemp.isEmpty()) { |
| | | sud.setDeptType("1"); |
| | | sud.setUserId(usersTemp.get(0).getUserId()); |
| | | sysUserDeptMapper.insertSysUserDept(sud); |
| | | } |
| | | } |
| | | //新增用户与院区 |
| | | List<SysUserOrg> sysUserOrg = sysUserOrgAll.stream().filter((SysUserOrg o) -> o.getUserId().equals(sysUser1.getHisUserId())).collect(Collectors.toList()); |
| | | for (SysUserDept sudb : sysUserDeptBf) { |
| | | if (!usersTemp.isEmpty()) { |
| | | sudb.setDeptType("2"); |
| | | sudb.setUserId(usersTemp.get(0).getUserId()); |
| | | sysUserDeptMapper.insertSysUserDept(sudb); |
| | | } |
| | | } |
| | | for (SysUserOrg suo : sysUserOrg) { |
| | | if (usersTemp.size() > 0) { |
| | | suo.setUserId(usersTemp.get(0).getUserId()); |
| | | if (!usersTemp.isEmpty()) { |
| | | suo.setUserId(usersTemp.get(0).getUserId().toString()); |
| | | sysUserOrgMapper.insertSysUserOrg(suo); |
| | | } |
| | | } |
| | |
| | | <if test="hisUserId != null ">and user_id = #{hisUserId}</if> |
| | | </select> |
| | | |
| | | <select id="yhybfxx" parameterType="com.ruoyi.common.core.domain.entity.SysUser" resultMap="SysUserDeptResult"> |
| | | select user_id , user_code , dept_type ,dept_code,dept_name,deptparent,del_flag,orgid |
| | | FROM healthy_user_dept_bf |
| | | where 1=1 |
| | | and user_id != 'admin' |
| | | <if test="orgid != null and orgid != ''"> |
| | | AND orgid = #{orgid} |
| | | </if> |
| | | <if test="hisUserId != null ">and user_id = #{hisUserId}</if> |
| | | </select> |
| | | |
| | | <select id="yhyyqxx" parameterType="com.ruoyi.common.core.domain.entity.SysUser" resultMap="SysUserOrgResult"> |
| | | select |
| | | d.orgid as campusid, |
| | | d.del_flag, |
| | | ud.user_id as user_id, |
| | | ud.orgid as orgid |
| | | FROM healthy_dept d |
| | |
| | | <if test="campusid != null"> |
| | | AND d.orgid = #{campusid} |
| | | </if> |
| | | union all |
| | | select |
| | | d.orgid as campusid, |
| | | udb.user_id as user_id, |
| | | udb.orgid as orgid |
| | | FROM healthy_dept d |
| | | JOIN healthy_user_dept_bf udb ON d.his_dept_id = udb.dept_code |
| | | where 1=1 |
| | | and udb.user_id != 'admin' |
| | | <if test="orgid != null and orgid != ''"> |
| | | AND udb.orgid = #{orgid} |
| | | </if> |
| | | <if test="hisUserId != null "> |
| | | AND udb.user_id = #{hisUserId} |
| | | </if> |
| | | <if test="campusid != null"> |
| | | AND d.orgid = #{campusid} |
| | | </if> |
| | | </select> |
| | | |
| | | <select id="selectPatArchiveList" parameterType="com.smartor.domain.PatArchive" resultMap="PatArchiveResult"> |
| | |
| | | |
| | | //获取当前登陆人的机构和院区 |
| | | SysUserOrg sysUserOrg = new SysUserOrg(); |
| | | sysUserOrg.setUserId(sysUser.getUserId()); |
| | | sysUserOrg.setUserId(sysUser.getUserId().toString()); |
| | | sysUserOrg.setOrgid(split[1].equals("null") ? "" : split[1]); |
| | | sysUserOrg.setCampusid(split[2].equals("null") ? "" : split[2]); |
| | | List<SysUserOrg> sysUserOrgs = sysUserOrgMapper.selectSysUserOrgList(sysUserOrg); |
| | |
| | | |
| | | //获取当前登陆人的机构和院区 |
| | | SysUserOrg sysUserOrg = new SysUserOrg(); |
| | | sysUserOrg.setUserId(sysUser.getUserId()); |
| | | sysUserOrg.setUserId(sysUser.getUserId().toString()); |
| | | sysUserOrg.setOrgid(split[1].equals("null") ? "" : split[1]); |
| | | sysUserOrg.setCampusid(split[3].equals("null") ? "" : split[3]); |
| | | List<SysUserOrg> sysUserOrgs = sysUserOrgMapper.selectSysUserOrgList(sysUserOrg); |
| | |
| | | /** 用户ID */ |
| | | @ApiModelProperty("用户ID") |
| | | @Excel(name = "用户ID") |
| | | private Long userId; |
| | | private String userId; |
| | | |
| | | /** 院区ID */ |
| | | @ApiModelProperty("院区ID") |
| | |
| | | public int deleteSysUserDeptByIds(Long[] ids); |
| | | |
| | | public int deleteSysUserDeptByCode(SysUserDept sysUserDept); |
| | | |
| | | public int updateSysUserDeptForSync(SysUserDept sysUserDept); |
| | | } |
| | |
| | | * @return 患者门诊记录 |
| | | */ |
| | | @Override |
| | | @Cacheable(value = "selectPatMedOuthospList", key = "T(org.springframework.util.DigestUtils).md5DigestAsHex(#patMedOuthosp.toString().getBytes())", unless = "#result == null or #result.isEmpty()") |
| | | public List<PatMedOuthosp> selectPatMedOuthospList(PatMedOuthosp patMedOuthosp) { |
| | | List<PatMedOuthosp> patMedOuthosps = patMedOuthospMapper.selectPatMedOuthospList(patMedOuthosp); |
| | | for (PatMedOuthosp patMedOuthosp1 : patMedOuthosps) { |
| | | PatArchive patArchive = patArchiveMapper.selectPatArchiveByPatid(patMedOuthosp1.getPatid()); |
| | | if (patArchive.getBirthdate() != null) { |
| | | Map<String, String> map = calculateAge(patArchive.getBirthdate().toInstant().atZone(ZoneId.systemDefault()).toLocalDate(), LocalDate.now()); |
| | | patArchive.setAge(ObjectUtils.isNotEmpty(map.get("age")) ? Long.valueOf(map.get("age")) : null); |
| | | patArchive.setAgeUnit(map.get("ageUnit")); |
| | | patArchive.setAge2(ObjectUtils.isNotEmpty(map.get("age2")) ? Long.valueOf(map.get("age2")) : null); |
| | | patArchive.setAgeUnit2(map.get("ageUnit2")); |
| | | patMedOuthosp1.setAge(patArchive.getAge() + patArchive.getAgeUnit() + patArchive.getAge2() + patArchive.getAgeUnit2()); |
| | | patMedOuthosp1.setTelcode(patArchive.getTelcode()); |
| | | patMedOuthosp1.setIdcardno(patArchive.getIdcardno()); |
| | | if (patMedOuthosp.getPageNum() != null) { |
| | | for (PatMedOuthosp patMedOuthosp1 : patMedOuthosps) { |
| | | PatArchive patArchive = patArchiveMapper.selectPatArchiveByPatid(patMedOuthosp1.getPatid()); |
| | | if (patArchive.getBirthdate() != null) { |
| | | Map<String, String> map = calculateAge(patArchive.getBirthdate().toInstant().atZone(ZoneId.systemDefault()).toLocalDate(), LocalDate.now()); |
| | | patArchive.setAge(ObjectUtils.isNotEmpty(map.get("age")) ? Long.valueOf(map.get("age")) : null); |
| | | patArchive.setAgeUnit(map.get("ageUnit")); |
| | | patArchive.setAge2(ObjectUtils.isNotEmpty(map.get("age2")) ? Long.valueOf(map.get("age2")) : null); |
| | | patArchive.setAgeUnit2(map.get("ageUnit2")); |
| | | patMedOuthosp1.setAge(patArchive.getAge() + patArchive.getAgeUnit() + patArchive.getAge2() + patArchive.getAgeUnit2()); |
| | | patMedOuthosp1.setTelcode(patArchive.getTelcode()); |
| | | patMedOuthosp1.setIdcardno(patArchive.getIdcardno()); |
| | | } |
| | | ServiceSubtaskVO serviceSubtaskVO = new ServiceSubtaskVO(); |
| | | serviceSubtaskVO.setPatid(patMedOuthosp1.getPatid()); |
| | | List<Long> sendstates = new ArrayList<>(); |
| | | sendstates.add(1L); |
| | | sendstates.add(2L); |
| | | sendstates.add(3L); |
| | | serviceSubtaskVO.setSendstates(sendstates); |
| | | serviceSubtaskVO.setServiceType("3"); |
| | | List<ServiceSubtask> serviceSubtaskList = serviceSubtaskMapper.selectServiceSubtaskBySendstate(serviceSubtaskVO); |
| | | if (!CollectionUtils.isEmpty(serviceSubtaskList)) patMedOuthosp1.setServerState("1"); |
| | | } |
| | | ServiceSubtaskVO serviceSubtaskVO = new ServiceSubtaskVO(); |
| | | serviceSubtaskVO.setPatid(patMedOuthosp1.getPatid()); |
| | | List<Long> sendstates = new ArrayList<>(); |
| | | sendstates.add(1L); |
| | | sendstates.add(2L); |
| | | sendstates.add(3L); |
| | | serviceSubtaskVO.setSendstates(sendstates); |
| | | serviceSubtaskVO.setServiceType("3"); |
| | | List<ServiceSubtask> serviceSubtaskList = serviceSubtaskMapper.selectServiceSubtaskBySendstate(serviceSubtaskVO); |
| | | if (!CollectionUtils.isEmpty(serviceSubtaskList)) patMedOuthosp1.setServerState("1"); |
| | | } |
| | | return patMedOuthosps; |
| | | } |
| | |
| | | resultMap="PatMedOuthospResult"> |
| | | select |
| | | pmo.id, |
| | | pmo.campusid, |
| | | pmo.remark, |
| | | pmo.fudate, |
| | | pmo.server_state, |
| | | pmo.outhospno, |
| | | pmo.diagcheck_flag, |
| | | pmo.patno, |
| | | pmo.serialnum, |
| | | pmo.patid, |
| | | pmo.hospitalname, |
| | | pmo.hospitalcode, |
| | | pmo.icd10code, |
| | | pmo.diagname, |
| | | pmo.deptcode, |
| | |
| | | pmo.drcode, |
| | | pmo.drname, |
| | | pmo.admitdate, |
| | | pmo.orgid, |
| | | pmo.del_flag, |
| | | pmo.guid, |
| | | pmo.update_by, |
| | | pmo.update_time, |
| | | pmo.create_by, |
| | | pmo.create_time, |
| | | pmo.isupload, |
| | | pmo.upload_time, |
| | | pmo.schemestatus, |
| | | pmo.deptid, |
| | | pmo.schemetime, |
| | | pmo.hpi, |
| | | pmo.fuflag, |
| | | pmo.patname, |
| | | pmo.update_time, |
| | | pmo.mainsuit |
| | | from pat_med_outhosp pmo |
| | | where 1=1 |
| | | and pmo.del_flag=0 |
| | | <where>pmo.del_flag='0' |
| | | <if test="orgid != null ">and pmo.orgid = #{orgid}</if> |
| | | <if test="serialnum != null ">and pmo.serialnum = #{serialnum}</if> |
| | | <if test="serverState != null ">and pmo.server_state = #{serverState}</if> |
| | |
| | | <if test="outhospno != null and outhospno != ''">and pmo.outhospno = #{outhospno}</if> |
| | | <if test="diagcheckFlag != null and diagcheckFlag != ''">and pmo.diagcheck_flag = #{diagcheckFlag}</if> |
| | | <if test="diagname != null and diagname != ''">and pmo.diagname like concat('%',#{diagname}, '%')</if> |
| | | </where> |
| | | order by pmo.update_time desc |
| | | <if test="pageSize != null and pageNum != null">limit ${pageSize} OFFSET ${pageNum}</if> |
| | | </select> |
| | | |
| | | <select id="selectPatMedOuthospById" parameterType="Long" resultMap="PatMedOuthospResult"> |
| | |
| | | FROM |
| | | pat_med_outhosp |
| | | where 1=1 |
| | | and del_flag = 0 |
| | | <if test="orgid != null"> |
| | | and orgid = #{orgid} |
| | | </if> |
| | | and date_format(admitdate,'%y%m%d') >= date_format(#{startDate},'%y%m%d') |
| | | and date_format(admitdate,'%y%m%d') <= date_format(#{endDate},'%y%m%d') |
| | | <if test="deptcodeList != null and deptcodeList.size()>0"> |
| | | and deptcode in |
| | | <foreach collection="deptcodeList" item="deptcode" open="(" separator="," close=")"> |
| | | #{deptcode} |
| | | </foreach> |
| | | </if> |
| | | and del_flag = 0 |
| | | <if test="orgid != null"> |
| | | and orgid = #{orgid} |
| | | </if> |
| | | and date_format(admitdate,'%y%m%d') >= date_format(#{startDate},'%y%m%d') |
| | | and date_format(admitdate,'%y%m%d') <= date_format(#{endDate},'%y%m%d') |
| | | <if test="deptcodeList != null and deptcodeList.size()>0"> |
| | | and deptcode in |
| | | <foreach collection="deptcodeList" item="deptcode" open="(" separator="," close=")"> |
| | | #{deptcode} |
| | | </foreach> |
| | | </if> |
| | | union all |
| | | select |
| | | 0 AS rc, |
| | |
| | | FROM |
| | | service_subtask |
| | | where 1=1 |
| | | and del_flag = 0 |
| | | and service_type=3 |
| | | <if test="orgid != null"> |
| | | and orgid = #{orgid} |
| | | </if> |
| | | <if test="startDate != null"> |
| | | AND date_format( visit_time, '%y%m%d' ) >= date_format( #{startDate}, '%y%m%d' ) |
| | | </if> |
| | | <if test="endDate != null"> |
| | | AND date_format( visit_time, '%y%m%d' ) <= date_format(#{endDate},'%y%m%d') |
| | | </if> |
| | | <if test="deptcodeList != null and deptcodeList.size()>0"> |
| | | and deptcode in |
| | | <foreach collection="deptcodeList" item="deptcode" open="(" separator="," close=")"> |
| | | #{deptcode} |
| | | </foreach> |
| | | </if> |
| | | and del_flag = 0 |
| | | and service_type=3 |
| | | <if test="orgid != null"> |
| | | and orgid = #{orgid} |
| | | </if> |
| | | <if test="startDate != null"> |
| | | AND date_format( visit_time, '%y%m%d' ) >= date_format( #{startDate}, '%y%m%d' ) |
| | | </if> |
| | | <if test="endDate != null"> |
| | | AND date_format( visit_time, '%y%m%d' ) <= date_format(#{endDate},'%y%m%d') |
| | | </if> |
| | | <if test="deptcodeList != null and deptcodeList.size()>0"> |
| | | and deptcode in |
| | | <foreach collection="deptcodeList" item="deptcode" open="(" separator="," close=")"> |
| | | #{deptcode} |
| | | </foreach> |
| | | </if> |
| | | ) AS combined_data |
| | | </select> |
| | | |
| | |
| | | SELECT deptname, COUNT(1) AS rc |
| | | FROM pat_med_outhosp |
| | | where 1=1 |
| | | and del_flag = 0 |
| | | <if test="orgid != null and orgid != ''"> |
| | | and orgid = #{orgid} |
| | | </if> |
| | | <if test="inhospstate != null"> |
| | | and inhospstate= #{inhospstate} |
| | | </if> |
| | | <if test="serverState != null"> |
| | | and server_state= #{inhospstate} |
| | | </if> |
| | | <if test="deptcodeList != null and deptcodeList.size()>0"> |
| | | and deptcode in |
| | | <foreach collection="deptcodeList" item="deptcode" open="(" separator="," close=")"> |
| | | #{deptcode} |
| | | </foreach> |
| | | </if> |
| | | and del_flag = 0 |
| | | <if test="orgid != null and orgid != ''"> |
| | | and orgid = #{orgid} |
| | | </if> |
| | | <if test="inhospstate != null"> |
| | | and inhospstate= #{inhospstate} |
| | | </if> |
| | | <if test="serverState != null"> |
| | | and server_state= #{inhospstate} |
| | | </if> |
| | | <if test="deptcodeList != null and deptcodeList.size()>0"> |
| | | and deptcode in |
| | | <foreach collection="deptcodeList" item="deptcode" open="(" separator="," close=")"> |
| | | #{deptcode} |
| | | </foreach> |
| | | </if> |
| | | </select> |
| | | |
| | | <!-- PatMedOuthospMapper.xml --> |
| | |
| | | where user_id =#{userId} and dept_code=#{deptCode} |
| | | </update> |
| | | |
| | | |
| | | <update id="updateSysUserDeptForSync" parameterType="com.ruoyi.common.core.domain.entity.SysUserDept"> |
| | | update sys_user_dept |
| | | <trim prefix="SET" suffixOverrides=","> |
| | | <if test="deptId != null">dept_id = |
| | | #{deptId}, |
| | | </if> |
| | | <if test="delFlag != null "> |
| | | del_flag = #{delFlag}, |
| | | </if> |
| | | <if test="createTime != null "> |
| | | create_time = #{createTime}, |
| | | </if> |
| | | <if test="updateTime != null "> |
| | | update_time = #{updateTime}, |
| | | </if> |
| | | <if test="deptType != null "> |
| | | dept_type = #{deptType}, |
| | | </if> |
| | | <if test="deptCode != null "> |
| | | dept_code = #{deptCode}, |
| | | </if> |
| | | <if test="deptName != null "> |
| | | dept_name = #{deptName}, |
| | | </if> |
| | | <if test="orgid != null "> |
| | | orgid = #{orgid}, |
| | | </if> |
| | | <if test="campusid != null "> |
| | | campusid = #{campusid}, |
| | | </if> |
| | | </trim> |
| | | where user_id =#{userId} |
| | | <if test="orgid != null and orgid != ''"> |
| | | and orgid = #{orgid} |
| | | </if> |
| | | <if test="campusid != null and campusid != ''"> |
| | | and campusid = #{campusid} |
| | | </if> |
| | | </update> |
| | | </mapper> |
| | |
| | | <result property="userType" column="user_type"/> |
| | | <result property="searchscope" column="searchscope"/> |
| | | <result property="guid" column="guid"/> |
| | | <result property="orgid" column="orgid"/> |
| | | <result property="campusid" column="campusid"/> |
| | | <association property="dept" column="dept_id" javaType="com.ruoyi.common.core.domain.entity.SysDept" |
| | | resultMap="deptResult"/> |
| | | <collection property="roles" javaType="java.util.List" resultMap="RoleResult"/> |
| | |
| | | u.create_time, |
| | | u.remark, |
| | | u.guid, |
| | | u.orgid, |
| | | u.campusid, |
| | | d.dept_id, |
| | | d.parent_id, |
| | | d.ancestors, |
| | |
| | | u.birthday, |
| | | u.job_phone, |
| | | u.phonenumber, u.sex, u.status, |
| | | u.del_flag, u.login_ip, u.login_date, u.create_by, u.create_time, u.remark, d.dept_name, d.leader from sys_user |
| | | u |
| | | u.del_flag, u.login_ip, u.login_date, u.create_by, u.create_time, u.remark, |
| | | u.orgid, u.campusid, |
| | | d.dept_name, d.leader |
| | | from sys_user u |
| | | left join sys_dept d on u.dept_id = d.dept_id |
| | | where u.del_flag = '0' |
| | | <if test="userId != null and userId != 0"> |
| | |
| | | <if test="deptCode != null and deptCode != ''">dept_code,</if> |
| | | <if test="deptName != null and deptName != ''">dept_name,</if> |
| | | <if test="userCode != null and userCode != ''">user_code,</if> |
| | | <if test="orgid != null and orgid != ''">orgid,</if> |
| | | <if test="campusid != null and campusid != ''">campusid,</if> |
| | | create_time |
| | | )values( |
| | | <if test="userId != null and userId != ''">#{userId},</if> |
| | |
| | | <if test="deptCode != null and deptCode != ''">#{deptCode},</if> |
| | | <if test="deptName != null and deptName != ''">#{deptName},</if> |
| | | <if test="userCode != null and userCode != ''">#{userCode},</if> |
| | | <if test="orgid != null and orgid != ''">#{orgid},</if> |
| | | <if test="campusid != null and campusid != ''">#{campusid},</if> |
| | | sysdate() |
| | | ) |
| | | </insert> |
| | |
| | | insert into sys_user( |
| | | user_id, dept_id, user_name, nick_name, email, avatar, phonenumber, sex, password, status, create_by, remark, |
| | | user_type, dept_info, hosp_info, searchscope, id_card, title, job_phone, birthday, his_user_id, guid, |
| | | user_code, |
| | | user_code, orgid, campusid, |
| | | create_time |
| | | ) values |
| | | <foreach collection="list" item="item" separator=","> |
| | |
| | | #{item.hisUserId}, |
| | | #{item.guid}, |
| | | #{item.userCode}, |
| | | #{item.orgid}, |
| | | #{item.campusid}, |
| | | now() |
| | | ) |
| | | </foreach> |
| | |
| | | <if test="hisUserId != null and hisUserId != ''"> |
| | | his_user_id = #{hisUserId}, |
| | | </if> |
| | | <if test="orgid != null and orgid != ''">orgid = #{orgid},</if> |
| | | <if test="campusid != null and campusid != ''">campusid = #{campusid},</if> |
| | | update_time = sysdate() |
| | | </set> |
| | | where user_id = #{userId} |