datascope修改,字段统一。

This commit is contained in:
haown 2024-04-24 14:15:25 +08:00
parent ccba16ee5b
commit b2d8cd0e02
16 changed files with 150 additions and 136 deletions

View File

@ -62,7 +62,6 @@ public class SysUserController extends BaseController {
* 获取用户列表 * 获取用户列表
*/ */
@ApiOperation("获取用户列表") @ApiOperation("获取用户列表")
@PreAuthorize("@ss.hasPermi('system:user:list')")
@GetMapping("/getList") @GetMapping("/getList")
public R<List<SysUser>> getList(SysUser user) { public R<List<SysUser>> getList(SysUser user) {
List<SysUser> list = userService.selectUserList(user); List<SysUser> list = userService.selectUserList(user);

View File

@ -11,6 +11,10 @@ import java.lang.annotation.*;
@Retention(RetentionPolicy.RUNTIME) @Retention(RetentionPolicy.RUNTIME)
@Documented @Documented
public @interface DataScope { public @interface DataScope {
/**
* 机构表别名
*/
public String anencyAlias() default "";
/** /**
* 部门表的别名 * 部门表的别名
*/ */

View File

@ -142,7 +142,7 @@ public class SysUser extends BaseEntity {
/** /**
* 机构id * 机构id
*/ */
private Long agencyId; private Long hospitalAgencyId;
/** /**
* 机构id * 机构id
@ -170,15 +170,15 @@ public class SysUser extends BaseEntity {
this.userId = userId; this.userId = userId;
} }
public Long getAgencyId() { public Long getHospitalAgencyId() {
return agencyId; return hospitalAgencyId;
} }
public void setAgencyId(Long agencyId) { public void setHospitalAgencyId(Long hospitalAgencyId) {
this.agencyId = agencyId; this.hospitalAgencyId = hospitalAgencyId;
} }
public Long getDepartmentId() { public Long getDepartmentId() {
return departmentId; return departmentId;
} }

View File

@ -45,6 +45,11 @@ public class DataScopeAspect {
*/ */
public static final String DATA_SCOPE_SELF = "5"; public static final String DATA_SCOPE_SELF = "5";
/**
* 机构数据权限
*/
public static final String DATA_SCOPE_AGENCY = "6";
/** /**
* 数据权限过滤关键字 * 数据权限过滤关键字
*/ */
@ -63,7 +68,7 @@ public class DataScopeAspect {
SysUser currentUser = loginUser.getUser(); SysUser currentUser = loginUser.getUser();
// 如果是超级管理员则不过滤数据 // 如果是超级管理员则不过滤数据
if (StringUtils.isNotNull(currentUser) && !currentUser.isAdmin()) { if (StringUtils.isNotNull(currentUser) && !currentUser.isAdmin()) {
dataScopeFilter(joinPoint, currentUser, controllerDataScope.deptAlias(), dataScopeFilter(joinPoint, currentUser, controllerDataScope.anencyAlias(), controllerDataScope.deptAlias(),
controllerDataScope.userAlias()); controllerDataScope.userAlias());
} }
} }
@ -76,7 +81,7 @@ public class DataScopeAspect {
* @param user 用户 * @param user 用户
* @param userAlias 别名 * @param userAlias 别名
*/ */
public static void dataScopeFilter(JoinPoint joinPoint, SysUser user, String deptAlias, String userAlias) { public static void dataScopeFilter(JoinPoint joinPoint, SysUser user, String anencyAlias, String deptAlias, String userAlias) {
StringBuilder sqlString = new StringBuilder(); StringBuilder sqlString = new StringBuilder();
for (SysRole role : user.getRoles()) { for (SysRole role : user.getRoles()) {
@ -84,17 +89,19 @@ public class DataScopeAspect {
if (DATA_SCOPE_ALL.equals(dataScope)) { if (DATA_SCOPE_ALL.equals(dataScope)) {
sqlString = new StringBuilder(); sqlString = new StringBuilder();
break; break;
} else if (DATA_SCOPE_CUSTOM.equals(dataScope)) { } else if (DATA_SCOPE_CUSTOM.equals(dataScope)) { // 自定数据权限
sqlString.append(StringUtils.format( sqlString.append(StringUtils.format(
" OR {}.dept_id IN ( SELECT dept_id FROM sys_role_dept WHERE role_id = {} ) ", deptAlias, " OR {}.dept_id IN ( SELECT dept_id FROM sys_role_dept WHERE role_id = {} ) ", deptAlias,
role.getRoleId())); role.getRoleId()));
} else if (DATA_SCOPE_DEPT.equals(dataScope)) { } else if(DATA_SCOPE_AGENCY.equals(dataScope)){ // 机构数据权限
sqlString.append(StringUtils.format(" OR {}.hospital_agency_id = {} ", anencyAlias, user.getHospitalAgencyId()));
} else if (DATA_SCOPE_DEPT.equals(dataScope)) { // 部门数据权限
sqlString.append(StringUtils.format(" OR {}.dept_id = {} ", deptAlias, user.getDeptId())); sqlString.append(StringUtils.format(" OR {}.dept_id = {} ", deptAlias, user.getDeptId()));
} else if (DATA_SCOPE_DEPT_AND_CHILD.equals(dataScope)) { } else if (DATA_SCOPE_DEPT_AND_CHILD.equals(dataScope)) { // 部门及以下数据权限
sqlString.append(StringUtils.format( sqlString.append(StringUtils.format(
" OR {}.dept_id IN ( SELECT dept_id FROM sys_dept WHERE dept_id = {} or find_in_set( {} , ancestors ) )", " OR {}.dept_id IN ( SELECT dept_id FROM sys_dept WHERE dept_id = {} or find_in_set( {} , ancestors ) )",
deptAlias, user.getDeptId(), user.getDeptId())); deptAlias, user.getDeptId(), user.getDeptId()));
} else if (DATA_SCOPE_SELF.equals(dataScope)) { } else if (DATA_SCOPE_SELF.equals(dataScope)) { // 仅本人数据权限
if (StringUtils.isNotBlank(userAlias)) { if (StringUtils.isNotBlank(userAlias)) {
sqlString.append(StringUtils.format(" OR {}.user_id = {} ", userAlias, user.getUserId())); sqlString.append(StringUtils.format(" OR {}.user_id = {} ", userAlias, user.getUserId()));
} else { } else {

View File

@ -45,7 +45,6 @@ public class PatientInfoController extends BaseController {
@PreAuthorize("@ss.hasPermi('manage:patientInfo:list')") @PreAuthorize("@ss.hasPermi('manage:patientInfo:list')")
@GetMapping("/list") @GetMapping("/list")
public TableDataInfo list(PatientInfoDto patientInfo) { public TableDataInfo list(PatientInfoDto patientInfo) {
// 根据用户权限判断查询数据权限
startPage(); startPage();
List<PatientInfo> list = patientInfoService.selectPatientInfoList(patientInfo); List<PatientInfo> list = patientInfoService.selectPatientInfoList(patientInfo);
return getDataTable(list); return getDataTable(list);

View File

@ -45,14 +45,14 @@ public class Department extends BaseEntity {
*/ */
@ApiModelProperty(value = "所属机构id") @ApiModelProperty(value = "所属机构id")
@Excel(name = "所属机构id") @Excel(name = "所属机构id")
private Long agencyId; private Long hospitalAgencyId;
/** /**
* 所属机构名称 * 所属机构名称
*/ */
@ApiModelProperty(value = "所属机构名称") @ApiModelProperty(value = "所属机构名称")
@Excel(name = "所属机构名称") @Excel(name = "所属机构名称")
private String agencyName; private String hospitalAgencyName;
/** /**
* 科室名称 * 科室名称
@ -179,8 +179,8 @@ public class Department extends BaseEntity {
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE) return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
.append("id", getId()) .append("id", getId())
.append("parentDepartmentId", getParentDepartmentId()) .append("parentDepartmentId", getParentDepartmentId())
.append("agencyId", getAgencyId()) .append("hospitalAgencyId", getHospitalAgencyId())
.append("agencyName", getAgencyName()) .append("hospitalAgencyName", getHospitalAgencyName())
.append("departmentName", getDepartmentName()) .append("departmentName", getDepartmentName())
.append("departmentCode", getDepartmentCode()) .append("departmentCode", getDepartmentCode())
.append("departmentType", getDepartmentType()) .append("departmentType", getDepartmentType())

View File

@ -1,5 +1,6 @@
package com.xinelu.manage.dto.patientinfo; package com.xinelu.manage.dto.patientinfo;
import com.xinelu.common.core.domain.BaseEntity;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import java.time.LocalDate; import java.time.LocalDate;
@ -13,7 +14,7 @@ import org.springframework.format.annotation.DateTimeFormat;
**/ **/
@ApiModel("患者列表查询传输对象") @ApiModel("患者列表查询传输对象")
@Data @Data
public class PatientInfoDto { public class PatientInfoDto extends BaseEntity {
@ApiModelProperty("居民信息表主键") @ApiModelProperty("居民信息表主键")
private Long residentId; private Long residentId;

View File

@ -247,7 +247,7 @@ public class AgencyServiceImpl implements IAgencyService {
hospitalVO.setCampusList(campusList); hospitalVO.setCampusList(campusList);
Department department = new Department(); Department department = new Department();
department.setNodeType(NodeTypeEnum.DEPARTMENT.getInfo()); department.setNodeType(NodeTypeEnum.DEPARTMENT.getInfo());
department.setAgencyId(hospitalDTO.getHospitalId()); department.setHospitalAgencyId(hospitalDTO.getHospitalId());
List<Department> departmentList = departmentMapper.selectDepartmentList(department); List<Department> departmentList = departmentMapper.selectDepartmentList(department);
hospitalVO.setDepartmentList(departmentList); hospitalVO.setDepartmentList(departmentList);
department.setNodeType(NodeTypeEnum.WARD.getInfo()); department.setNodeType(NodeTypeEnum.WARD.getInfo());
@ -258,7 +258,7 @@ public class AgencyServiceImpl implements IAgencyService {
if (StringUtils.isNotBlank(hospitalDTO.getNodeType()) && NodeTypeEnum.CAMPUS.getInfo().equals(hospitalDTO.getNodeType()) && Objects.nonNull(hospitalDTO.getCampusId())) { if (StringUtils.isNotBlank(hospitalDTO.getNodeType()) && NodeTypeEnum.CAMPUS.getInfo().equals(hospitalDTO.getNodeType()) && Objects.nonNull(hospitalDTO.getCampusId())) {
Department department = new Department(); Department department = new Department();
department.setNodeType(NodeTypeEnum.DEPARTMENT.getInfo()); department.setNodeType(NodeTypeEnum.DEPARTMENT.getInfo());
department.setAgencyId(hospitalDTO.getCampusId()); department.setHospitalAgencyId(hospitalDTO.getCampusId());
List<Department> departmentList = departmentMapper.selectDepartmentList(department); List<Department> departmentList = departmentMapper.selectDepartmentList(department);
hospitalVO.setDepartmentList(departmentList); hospitalVO.setDepartmentList(departmentList);
department.setNodeType(NodeTypeEnum.WARD.getInfo()); department.setNodeType(NodeTypeEnum.WARD.getInfo());

View File

@ -77,9 +77,9 @@ public class DepartmentServiceImpl implements IDepartmentService {
public AjaxResult selectUserDepartment() { public AjaxResult selectUserDepartment() {
SysUser sysUser = sysUserMapper.selectUserById(SecurityUtils.getUserId()); SysUser sysUser = sysUserMapper.selectUserById(SecurityUtils.getUserId());
List<Department> departments = new ArrayList<>(); List<Department> departments = new ArrayList<>();
if (Objects.nonNull(sysUser) && Objects.nonNull(sysUser.getAgencyId())) { if (Objects.nonNull(sysUser) && Objects.nonNull(sysUser.getHospitalAgencyId())) {
Department department = new Department(); Department department = new Department();
department.setAgencyId(sysUser.getAgencyId()); department.setHospitalAgencyId(sysUser.getHospitalAgencyId());
departments = departmentMapper.selectDepartmentList(department); departments = departmentMapper.selectDepartmentList(department);
} }
return AjaxResult.success(departments); return AjaxResult.success(departments);
@ -93,7 +93,7 @@ public class DepartmentServiceImpl implements IDepartmentService {
*/ */
@Override @Override
public AjaxResult selectDepartmentByAgencyIdList(Department department) { public AjaxResult selectDepartmentByAgencyIdList(Department department) {
if (Objects.isNull(department) || (Objects.isNull(department.getAgencyId()) && Objects.isNull(department.getParentDepartmentId()))) { if (Objects.isNull(department) || (Objects.isNull(department.getHospitalAgencyId()) && Objects.isNull(department.getParentDepartmentId()))) {
return AjaxResult.success(); return AjaxResult.success();
} }
return AjaxResult.success(departmentMapper.selectDepartmentList(department)); return AjaxResult.success(departmentMapper.selectDepartmentList(department));

View File

@ -1,5 +1,6 @@
package com.xinelu.manage.service.patientinfo.impl; package com.xinelu.manage.service.patientinfo.impl;
import com.xinelu.common.annotation.DataScope;
import com.xinelu.common.constant.SignRecordServiceStatusConstants; import com.xinelu.common.constant.SignRecordServiceStatusConstants;
import com.xinelu.common.exception.ServiceException; import com.xinelu.common.exception.ServiceException;
import com.xinelu.common.utils.BaseUtil; import com.xinelu.common.utils.BaseUtil;
@ -62,6 +63,7 @@ public class PatientInfoServiceImpl implements IPatientInfoService {
* @return 患者信息 * @return 患者信息
*/ */
@Override @Override
@DataScope(anencyAlias = "p")
public List<PatientInfo> selectPatientInfoList(PatientInfoDto patientInfo) { public List<PatientInfo> selectPatientInfoList(PatientInfoDto patientInfo) {
return patientInfoMapper.selectPatientInfoList(patientInfo); return patientInfoMapper.selectPatientInfoList(patientInfo);
} }

View File

@ -166,7 +166,7 @@ public class PatientPreHospitalizationServiceImpl implements IPatientPreHospital
if (CollectionUtils.isEmpty(patientList)) { if (CollectionUtils.isEmpty(patientList)) {
return AjaxResult.error("请添加预住院患者导入信息!"); return AjaxResult.error("请添加预住院患者导入信息!");
} }
if (SecurityUtils.getLoginUser().getUser().getAgencyId() == null) { if (SecurityUtils.getLoginUser().getUser().getHospitalAgencyId() == null) {
return AjaxResult.error("您未设置机构信息,导入失败"); return AjaxResult.error("您未设置机构信息,导入失败");
} }
// 根据患者身份证号做去重处理 // 根据患者身份证号做去重处理
@ -181,8 +181,8 @@ public class PatientPreHospitalizationServiceImpl implements IPatientPreHospital
PatientPreHospitalization preHospitalization = new PatientPreHospitalization(); PatientPreHospitalization preHospitalization = new PatientPreHospitalization();
BeanUtils.copyProperties(item, preHospitalization); BeanUtils.copyProperties(item, preHospitalization);
// 设置机构/院区为当前登录用户机构信息 // 设置机构/院区为当前登录用户机构信息
preHospitalization.setHospitalAgencyId(SecurityUtils.getLoginUser().getUser().getAgencyId()); preHospitalization.setHospitalAgencyId(SecurityUtils.getLoginUser().getUser().getHospitalAgencyId());
Agency agencyData = agencyMapper.selectAgencyById(SecurityUtils.getLoginUser().getUser().getAgencyId()); Agency agencyData = agencyMapper.selectAgencyById(SecurityUtils.getLoginUser().getUser().getHospitalAgencyId());
if (ObjectUtils.isNotEmpty(agencyData)) { if (ObjectUtils.isNotEmpty(agencyData)) {
if (StringUtils.equals(NodeTypeConstants.HOSPITAL, agencyData.getNodeType())) { // 节点类型为机构 if (StringUtils.equals(NodeTypeConstants.HOSPITAL, agencyData.getNodeType())) { // 节点类型为机构
preHospitalization.setHospitalAgencyName(agencyData.getAgencyName()); preHospitalization.setHospitalAgencyName(agencyData.getAgencyName());
@ -199,7 +199,7 @@ public class PatientPreHospitalizationServiceImpl implements IPatientPreHospital
// 查询科室id // 查询科室id
Department department = new Department(); Department department = new Department();
if (StringUtils.isNotBlank(item.getDepartmentName())) { if (StringUtils.isNotBlank(item.getDepartmentName())) {
department.setAgencyName(preHospitalization.getHospitalAgencyName()); department.setHospitalAgencyName(preHospitalization.getHospitalAgencyName());
department.setDepartmentName(item.getDepartmentName()); department.setDepartmentName(item.getDepartmentName());
department.setNodeType(NodeTypeConstants.DEPARTMENT); department.setNodeType(NodeTypeConstants.DEPARTMENT);
List<Department> deptList = departmentMapper.selectDepartmentList(department); List<Department> deptList = departmentMapper.selectDepartmentList(department);
@ -209,7 +209,7 @@ public class PatientPreHospitalizationServiceImpl implements IPatientPreHospital
} }
// 查询病区 // 查询病区
if (StringUtils.isNotBlank(item.getWardName())) { if (StringUtils.isNotBlank(item.getWardName())) {
department.setAgencyName(item.getHospitalAgencyName()); department.setHospitalAgencyName(item.getHospitalAgencyName());
department.setDepartmentName(item.getWardName()); department.setDepartmentName(item.getWardName());
department.setNodeType(NodeTypeConstants.WARD); department.setNodeType(NodeTypeConstants.WARD);
List<Department> deptList = departmentMapper.selectDepartmentList(department); List<Department> deptList = departmentMapper.selectDepartmentList(department);

View File

@ -339,8 +339,8 @@ public class PatientVisitRecordServiceImpl implements IPatientVisitRecordService
patientVisitRecord.setHospitalAgencyId(agencyList.get(0).getId()); patientVisitRecord.setHospitalAgencyId(agencyList.get(0).getId());
} }
} else { } else {
patientVisitRecord.setHospitalAgencyId(SecurityUtils.getLoginUser().getUser().getAgencyId()); patientVisitRecord.setHospitalAgencyId(SecurityUtils.getLoginUser().getUser().getHospitalAgencyId());
Agency agencyData = agencyMapper.selectAgencyById(SecurityUtils.getLoginUser().getUser().getAgencyId()); Agency agencyData = agencyMapper.selectAgencyById(SecurityUtils.getLoginUser().getUser().getHospitalAgencyId());
if (ObjectUtils.isNotEmpty(agencyData)) { if (ObjectUtils.isNotEmpty(agencyData)) {
patientVisitRecord.setHospitalAgencyName(agencyData.getAgencyName()); patientVisitRecord.setHospitalAgencyName(agencyData.getAgencyName());
} }
@ -358,7 +358,7 @@ public class PatientVisitRecordServiceImpl implements IPatientVisitRecordService
// 查询科室id // 查询科室id
Department department = new Department(); Department department = new Department();
if (StringUtils.isNotBlank(item.getDepartmentName())) { if (StringUtils.isNotBlank(item.getDepartmentName())) {
department.setAgencyName(item.getHospitalAgencyName()); department.setHospitalAgencyName(item.getHospitalAgencyName());
department.setDepartmentName(item.getDepartmentName()); department.setDepartmentName(item.getDepartmentName());
department.setNodeType(NodeTypeConstants.DEPARTMENT); department.setNodeType(NodeTypeConstants.DEPARTMENT);
List<Department> deptList = departmentMapper.selectDepartmentList(department); List<Department> deptList = departmentMapper.selectDepartmentList(department);
@ -374,7 +374,7 @@ public class PatientVisitRecordServiceImpl implements IPatientVisitRecordService
} }
// 查询病区 // 查询病区
if (StringUtils.isNotBlank(item.getWardName())) { if (StringUtils.isNotBlank(item.getWardName())) {
department.setAgencyName(item.getHospitalAgencyName()); department.setHospitalAgencyName(item.getHospitalAgencyName());
department.setDepartmentName(item.getWardName()); department.setDepartmentName(item.getWardName());
department.setNodeType(NodeTypeConstants.WARD); department.setNodeType(NodeTypeConstants.WARD);
List<Department> deptList = departmentMapper.selectDepartmentList(department); List<Department> deptList = departmentMapper.selectDepartmentList(department);

View File

@ -7,8 +7,8 @@
<resultMap type="Department" id="DepartmentResult"> <resultMap type="Department" id="DepartmentResult">
<result property="id" column="id"/> <result property="id" column="id"/>
<result property="parentDepartmentId" column="parent_department_id"/> <result property="parentDepartmentId" column="parent_department_id"/>
<result property="agencyId" column="agency_id"/> <result property="hospitalAgencyId" column="hospital_agency_id"/>
<result property="agencyName" column="agency_name"/> <result property="hospitalAgencyName" column="hospital_agency_name"/>
<result property="departmentName" column="department_name"/> <result property="departmentName" column="department_name"/>
<result property="departmentCode" column="department_code"/> <result property="departmentCode" column="department_code"/>
<result property="departmentType" column="department_type"/> <result property="departmentType" column="department_type"/>
@ -35,8 +35,8 @@
<sql id="selectDepartmentVo"> <sql id="selectDepartmentVo">
select id, select id,
parent_department_id, parent_department_id,
agency_id, hospital_agency_id,
agency_name, hospital_agency_name,
department_name, department_name,
department_code, department_code,
department_type, department_type,
@ -67,11 +67,11 @@
<if test="parentDepartmentId != null "> <if test="parentDepartmentId != null ">
and parent_department_id =#{parentDepartmentId} and parent_department_id =#{parentDepartmentId}
</if> </if>
<if test="agencyId != null "> <if test="hospitalAgencyId != null ">
and agency_id =#{agencyId} and hospital_agency_id =#{hospitalAgencyId}
</if> </if>
<if test="agencyName != null and agencyName != ''"> <if test="hospitalAgencyName != null and hospitalAgencyName != ''">
and agency_name like concat('%',#{agencyName},'%') and hospital_agency_name like concat('%',#{hospitalAgencyName},'%')
</if> </if>
<if test="departmentName != null and departmentName != ''"> <if test="departmentName != null and departmentName != ''">
and department_name like concat('%',#{departmentName},'%') and department_name like concat('%',#{departmentName},'%')
@ -136,8 +136,8 @@
<select id="selectDepartment" resultType="com.xinelu.manage.vo.department.DepartmentListVO"> <select id="selectDepartment" resultType="com.xinelu.manage.vo.department.DepartmentListVO">
select id, select id,
dt.parent_department_id, dt.parent_department_id,
agency_id, hospital_agency_id,
agency_name, hospital_agency_name,
department_name, department_name,
department_code, department_code,
department_type, department_type,
@ -255,8 +255,8 @@
<select id="getAllDepartmentInfo" resultType="com.xinelu.manage.domain.department.Department"> <select id="getAllDepartmentInfo" resultType="com.xinelu.manage.domain.department.Department">
select id, select id,
parent_department_id, parent_department_id,
agency_id, hospital_agency_id,
agency_name, hospital_agency_name,
department_name, department_name,
department_code, department_code,
department_type, department_type,
@ -311,9 +311,9 @@
<trim prefix="(" suffix=")" suffixOverrides=","> <trim prefix="(" suffix=")" suffixOverrides=",">
<if test="parentDepartmentId != null">parent_department_id, <if test="parentDepartmentId != null">parent_department_id,
</if> </if>
<if test="agencyId != null">agency_id, <if test="hospitalAgencyId != null">hospital_agency_id,
</if> </if>
<if test="agencyName != null">agency_name, <if test="hospitalAgencyName != null">hospital_agency_name,
</if> </if>
<if test="departmentName != null">department_name, <if test="departmentName != null">department_name,
</if> </if>
@ -361,9 +361,9 @@
<trim prefix="values (" suffix=")" suffixOverrides=","> <trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="parentDepartmentId != null">#{parentDepartmentId}, <if test="parentDepartmentId != null">#{parentDepartmentId},
</if> </if>
<if test="agencyId != null">#{agencyId}, <if test="hospitalAgencyId != null">#{hospitalAgencyId},
</if> </if>
<if test="agencyName != null">#{agencyName}, <if test="hospitalAgencyName != null">#{hospitalAgencyName},
</if> </if>
<if test="departmentName != null">#{departmentName}, <if test="departmentName != null">#{departmentName},
</if> </if>
@ -413,8 +413,8 @@
<insert id="insertDepartmentList"> <insert id="insertDepartmentList">
insert into department( insert into department(
parent_department_id, parent_department_id,
agency_id, hospital_agency_id,
agency_name, hospital_agency_name,
department_name, department_name,
department_code, department_code,
department_type, department_type,
@ -438,8 +438,8 @@
<foreach item="Department" index="index" collection="list" separator=","> <foreach item="Department" index="index" collection="list" separator=",">
( (
#{Department.parentDepartmentId}, #{Department.parentDepartmentId},
#{Department.agencyId}, #{Department.hospitalAgencyId},
#{Department.agencyName}, #{Department.hospitalAgencyName},
#{Department.departmentName}, #{Department.departmentName},
#{Department.departmentCode}, #{Department.departmentCode},
#{Department.departmentType}, #{Department.departmentType},
@ -469,11 +469,11 @@
<if test="parentDepartmentId != null">parent_department_id = <if test="parentDepartmentId != null">parent_department_id =
#{parentDepartmentId}, #{parentDepartmentId},
</if> </if>
<if test="agencyId != null">agency_id = <if test="hospitalAgencyId != null">hospital_agency_id =
#{agencyId}, #{hospitalAgencyId},
</if> </if>
<if test="agencyName != null">agency_name = <if test="hospitalAgencyName != null">hospital_agency_name =
#{agencyName}, #{hospitalAgencyName},
</if> </if>
<if test="departmentName != null">department_name = <if test="departmentName != null">department_name =
#{departmentName}, #{departmentName},
@ -546,8 +546,8 @@
update department update department
<trim prefix="SET" suffixOverrides=","> <trim prefix="SET" suffixOverrides=",">
parent_department_id = #{parentDepartmentId}, parent_department_id = #{parentDepartmentId},
agency_id = #{agencyId}, hospital_agency_id = #{hospitalAgencyId},
agency_name = #{agencyName}, hospital_agency_name = #{hospitalAgencyName},
<if test="departmentName != null">department_name = #{departmentName},</if> <if test="departmentName != null">department_name = #{departmentName},</if>
department_code =#{departmentCode}, department_code =#{departmentCode},
department_type =#{departmentType}, department_type =#{departmentType},

View File

@ -53,116 +53,118 @@
</resultMap> </resultMap>
<sql id="selectPatientInfoVo"> <sql id="selectPatientInfoVo">
select id,resident_id, select p.id,p.resident_id,
patient_name, p.patient_name,
patient_phone, p.patient_phone,
family_member_phone, p.family_member_phone,
birth_date, p.birth_date,
card_no, p.card_no,
sex, p.sex,
address, p.address,
patient_type, p.patient_type,
sign_status,sign_patient_record_id,service_status, p.sign_status,p.sign_patient_record_id,p.service_status,
sign_time, p.sign_time,
visit_method, attending_physician_id, attending_physician_name, main_diagnosis, p.visit_method, p.attending_physician_id, p.attending_physician_name, p.main_diagnosis,
hospital_agency_id, hospital_agency_name, campus_agency_id, campus_agency_name, department_id, department_name, ward_id, ward_name, p.hospital_agency_id, p.hospital_agency_name, p.campus_agency_id, p.campus_agency_name, p.department_id, p.department_name, p.ward_id, p.ward_name,
responsible_nurse, patient_visit_record_id, visit_serial_number, p.responsible_nurse, p.patient_visit_record_id, p.visit_serial_number,
admission_time, patient_pre_hospitalization_id, discharge_time, patient_pre_hospitalization_id, appointment_treatment_group, p.admission_time, p.patient_pre_hospitalization_id, p.discharge_time, p.patient_pre_hospitalization_id, p.appointment_treatment_group,
registration_no, registration_date, appointment_date, in_hospital_number, visit_date, discharge_method, p.registration_no, p.registration_date, p.appointment_date, p.in_hospital_number, p.visit_date, p.discharge_method,
patient_source, surgical_name, del_flag, create_by, create_time, update_by, update_time p.patient_source, p.surgical_name, p.del_flag, p.create_by, p.create_time, p.update_by, p.update_time
from patient_info from patient_info p
</sql> </sql>
<select id="selectPatientInfoList" parameterType="com.xinelu.manage.dto.patientinfo.PatientInfoDto" <select id="selectPatientInfoList" parameterType="com.xinelu.manage.dto.patientinfo.PatientInfoDto"
resultMap="PatientInfoResult"> resultMap="PatientInfoResult">
<include refid="selectPatientInfoVo"/> <include refid="selectPatientInfoVo"/>
<where> <where>
del_flag = 0 p.del_flag = 0
<if test="residentId != null"> <if test="residentId != null">
and resident_id = #{residentId} and p.resident_id = #{residentId}
</if> </if>
<if test="patientName != null and patientName != ''"> <if test="patientName != null and patientName != ''">
and patient_name = #{patientName} and p.patient_name = #{patientName}
</if> </if>
<if test="patientPhone != null and patientPhone != ''"> <if test="patientPhone != null and patientPhone != ''">
and patient_phone like concat('%', #{patientPhone}, '%') and p.patient_phone like concat('%', #{patientPhone}, '%')
</if> </if>
<if test="cardNo != null and cardNo != ''"> <if test="cardNo != null and cardNo != ''">
and card_no = #{cardNo} and p.card_no = #{cardNo}
</if> </if>
<if test="patientType != null and patientType != ''"> <if test="patientType != null and patientType != ''">
<choose> <choose>
<when test="patientType == 'OUTPATIENT_DISCHARGE'.toString()"> <when test="patientType == 'OUTPATIENT_DISCHARGE'.toString()">
and (patient_type = 'OUTPATIENT' or patient_type = 'DISCHARGED_PATIENT') and (p.patient_type = 'OUTPATIENT' or p.patient_type = 'DISCHARGED_PATIENT')
</when> </when>
<otherwise> <otherwise>
and patient_type = #{patientType} and p.patient_type = #{patientType}
</otherwise> </otherwise>
</choose> </choose>
</if> </if>
<if test="attendingPhysicianId != null"> <if test="attendingPhysicianId != null">
and attending_physician_id = #{attendingPhysicianId} and p.attending_physician_id = #{attendingPhysicianId}
</if> </if>
<if test="mainDiagnosis != null and mainDiagnosis != ''"> <if test="mainDiagnosis != null and mainDiagnosis != ''">
and main_diagnosis like concat('%', #{mainDiagnosis}, '%') and p.main_diagnosis like concat('%', #{mainDiagnosis}, '%')
</if> </if>
<if test="hospitalAgencyId != null "> <if test="hospitalAgencyId != null ">
and hospital_agency_id = #{hospitalAgencyId} and p.hospital_agency_id = #{hospitalAgencyId}
</if> </if>
<if test="campusAgencyId != null "> <if test="campusAgencyId != null ">
and campus_agency_id = #{campusAgencyId} and p.campus_agency_id = #{campusAgencyId}
</if> </if>
<if test="departmentId != null "> <if test="departmentId != null ">
and department_id = #{departmentId} and p.department_id = #{departmentId}
</if> </if>
<if test="wardId != null "> <if test="wardId != null ">
and ward_id = #{wardId} and p.ward_id = #{wardId}
</if> </if>
<if test="visitMethod != null and visitMethod != ''"> <if test="visitMethod != null and visitMethod != ''">
and visit_method = #{visitMethod} and p.visit_method = #{visitMethod}
</if> </if>
<if test="visitDateStart != null "> <if test="visitDateStart != null ">
and date_format(visit_date, '%y%m%d') >= date_format(#{visitDateStart}, '%y%m%d') and date_format(p.visit_date, '%y%m%d') >= date_format(#{visitDateStart}, '%y%m%d')
</if> </if>
<if test="visitDateEnd != null "> <if test="visitDateEnd != null ">
and date_format(visit_date, '%y%m%d') &lt;= date_format(#{visitDateEnd}, '%y%m%d') and date_format(p.visit_date, '%y%m%d') &lt;= date_format(#{visitDateEnd}, '%y%m%d')
</if> </if>
<if test="admissionTimeStart != null "> <if test="admissionTimeStart != null ">
and date_format(admission_time,'%y%m%d') >= date_format(#{admissionTimeStart}, '%y%m%d') and date_format(p.admission_time,'%y%m%d') >= date_format(#{admissionTimeStart}, '%y%m%d')
</if> </if>
<if test="admissionTimeEnd != null "> <if test="admissionTimeEnd != null ">
and date_format(admission_time,'%y%m%d') &lt;= date_format(#{admissionTimeEnd}, '%y%m%d') and date_format(p.admission_time,'%y%m%d') &lt;= date_format(#{admissionTimeEnd}, '%y%m%d')
</if> </if>
<if test="dischargeTimeStart != null "> <if test="dischargeTimeStart != null ">
and date_format(discharge_time,'%y%m%d') >= date_format(#{dischargeTimeStart}, '%y%m%d') and date_format(p.discharge_time,'%y%m%d') >= date_format(#{dischargeTimeStart}, '%y%m%d')
</if> </if>
<if test="dischargeTimeEnd != null "> <if test="dischargeTimeEnd != null ">
and date_format(discharge_time,'%y%m%d') &lt;= date_format(#{dischargeTimeEnd}, '%y%m%d') and date_format(p.discharge_time,'%y%m%d') &lt;= date_format(#{dischargeTimeEnd}, '%y%m%d')
</if> </if>
<if test="appointmentDateStart != null "> <if test="appointmentDateStart != null ">
and date_format(appointment_date, '%y%m%d') >= date_format(#{appointmentDateStart}, '%y%m%d') and date_format(p.appointment_date, '%y%m%d') >= date_format(#{appointmentDateStart}, '%y%m%d')
</if> </if>
<if test="appointmentDateEnd != null "> <if test="appointmentDateEnd != null ">
and date_format(appointment_date, '%y%m%d') &lt;= date_format(#{appointmentDateEnd}, '%y%m%d') and date_format(p.appointment_date, '%y%m%d') &lt;= date_format(#{appointmentDateEnd}, '%y%m%d')
</if> </if>
<if test="appointmentTreatmentGroup != null and appointmentTreatmentGroup != ''"> <if test="appointmentTreatmentGroup != null and appointmentTreatmentGroup != ''">
and appointment_treatment_group = #{appointmentTreatmentGroup} and p.appointment_treatment_group = #{appointmentTreatmentGroup}
</if> </if>
<if test="registrationNo != null and registrationNo != ''"> <if test="registrationNo != null and registrationNo != ''">
and registration_no = #{registrationNo} and p.registration_no = #{registrationNo}
</if> </if>
<if test="visitSerialNumber != null and visitSerialNumber != ''"> <if test="visitSerialNumber != null and visitSerialNumber != ''">
and visit_serial_number = #{visitSerialNumber} and p.visit_serial_number = #{visitSerialNumber}
</if> </if>
<if test="responsibleNurse != null and responsibleNurse != ''"> <if test="responsibleNurse != null and responsibleNurse != ''">
and responsible_nurse = #{responsibleNurse} and p.responsible_nurse = #{responsibleNurse}
</if> </if>
<if test="patientSource != null and patientSource != ''"> <if test="patientSource != null and patientSource != ''">
and patient_source = #{patientSource} and p.patient_source = #{patientSource}
</if> </if>
<if test="surgicalName != null and surgicalName != ''"> <if test="surgicalName != null and surgicalName != ''">
and surgical_name = #{surgicalName} and p.surgical_name = #{surgicalName}
</if> </if>
<!-- 数据范围过滤 -->
${params.dataScope}
</where> </where>
</select> </select>

View File

@ -71,7 +71,7 @@ public class SysUserServiceImpl implements ISysUserService {
* @return 用户信息集合信息 * @return 用户信息集合信息
*/ */
@Override @Override
@DataScope(deptAlias = "d", userAlias = "u") @DataScope(deptAlias = "d", userAlias = "u", anencyAlias = "u")
public List<SysUser> selectUserList(SysUser user) { public List<SysUser> selectUserList(SysUser user) {
return userMapper.selectUserList(user); return userMapper.selectUserList(user);
} }
@ -508,7 +508,7 @@ public class SysUserServiceImpl implements ISysUserService {
public TableDataInfo selectUserAgency(String userName, String agencyName) { public TableDataInfo selectUserAgency(String userName, String agencyName) {
SysUser sysUser = userMapper.selectUserByUserName(userName); SysUser sysUser = userMapper.selectUserByUserName(userName);
pageServiceUtil.startPage(); pageServiceUtil.startPage();
List<AgencyNameVO> agencyList = userMapper.selectAgencyList(agencyName, sysUser.getAgencyId()); List<AgencyNameVO> agencyList = userMapper.selectAgencyList(agencyName, sysUser.getHospitalAgencyId());
if (CollectionUtils.isNotEmpty(agencyList)) { if (CollectionUtils.isNotEmpty(agencyList)) {
return pageServiceUtil.getDataTable(agencyList); return pageServiceUtil.getDataTable(agencyList);
} }
@ -524,8 +524,8 @@ public class SysUserServiceImpl implements ISysUserService {
@Override @Override
public List<AgencyNameVO> selectUserBelongAgency(String userName) { public List<AgencyNameVO> selectUserBelongAgency(String userName) {
SysUser sysUser = userMapper.selectUserByUserName(userName); SysUser sysUser = userMapper.selectUserByUserName(userName);
if (Objects.nonNull(sysUser) && Objects.nonNull(sysUser.getAgencyId())) { if (Objects.nonNull(sysUser) && Objects.nonNull(sysUser.getHospitalAgencyId())) {
return userMapper.selectBelongAgencyList(sysUser.getAgencyId()); return userMapper.selectBelongAgencyList(sysUser.getHospitalAgencyId());
} }
return new ArrayList<AgencyNameVO>(); return new ArrayList<AgencyNameVO>();
} }
@ -539,11 +539,11 @@ public class SysUserServiceImpl implements ISysUserService {
@Override @Override
public TableDataInfo selectUserDepartment(String userName, String departmentName) { public TableDataInfo selectUserDepartment(String userName, String departmentName) {
SysUser sysUser = userMapper.selectUserByUserName(userName); SysUser sysUser = userMapper.selectUserByUserName(userName);
if (Objects.isNull(sysUser) || Objects.isNull(sysUser.getAgencyId())) { if (Objects.isNull(sysUser) || Objects.isNull(sysUser.getHospitalAgencyId())) {
return pageServiceUtil.getDataTable(new ArrayList<>()); return pageServiceUtil.getDataTable(new ArrayList<>());
} }
pageServiceUtil.startPage(); pageServiceUtil.startPage();
List<AgencyNameVO> agencyList = userMapper.selectDepartmentList(departmentName, sysUser.getDepartmentId(), sysUser.getAgencyId()); List<AgencyNameVO> agencyList = userMapper.selectDepartmentList(departmentName, sysUser.getDepartmentId(), sysUser.getHospitalAgencyId());
if (CollectionUtils.isNotEmpty(agencyList)) { if (CollectionUtils.isNotEmpty(agencyList)) {
return pageServiceUtil.getDataTable(agencyList); return pageServiceUtil.getDataTable(agencyList);
} }

View File

@ -25,7 +25,7 @@
<result property="remark" column="remark"/> <result property="remark" column="remark"/>
<result property="userCardNo" column="user_card_no"/> <result property="userCardNo" column="user_card_no"/>
<result property="userBirthDate" column="user_birth_date"/> <result property="userBirthDate" column="user_birth_date"/>
<result property="agencyId" column="agency_id"/> <result property="hospitalAgencyId" column="hospital_agency_id"/>
<result property="departmentId" column="department_id"/> <result property="departmentId" column="department_id"/>
<result property="postName" column="post_name"/> <result property="postName" column="post_name"/>
<association property="dept" column="dept_id" javaType="SysDept" resultMap="deptResult"/> <association property="dept" column="dept_id" javaType="SysDept" resultMap="deptResult"/>
@ -70,7 +70,7 @@
u.remark, u.remark,
u.user_card_no, u.user_card_no,
u.user_birth_date, u.user_birth_date,
u.agency_id, u.hospital_agency_id,
u.department_id, u.department_id,
u.post_name, u.post_name,
d.dept_id, d.dept_id,
@ -95,7 +95,7 @@
<select id="selectUserList" parameterType="SysUser" resultMap="SysUserResult"> <select id="selectUserList" parameterType="SysUser" resultMap="SysUserResult">
select u.user_id, u.dept_id, u.nick_name, u.user_name, u.email, u.avatar, u.phonenumber, u.sex, u.status, select u.user_id, u.dept_id, u.nick_name, u.user_name, u.email, u.avatar, u.phonenumber, u.sex, u.status,
u.del_flag, u.login_ip, u.login_date, u.create_by, u.create_time, u.remark,u.user_card_no,u.user_birth_date, u.del_flag, u.login_ip, u.login_date, u.create_by, u.create_time, u.remark,u.user_card_no,u.user_birth_date,
u.agency_id,u.department_id,u.post_name,d.dept_name, d.leader from sys_user u u.hospital_agency_id,u.department_id,u.post_name,d.dept_name, d.leader from sys_user u
left join sys_dept d on u.dept_id = d.dept_id left join sys_dept d on u.dept_id = d.dept_id
where u.del_flag = '0' where u.del_flag = '0'
<if test="userId != null and userId != 0"> <if test="userId != null and userId != 0">
@ -107,8 +107,8 @@
<if test="status != null and status != ''"> <if test="status != null and status != ''">
AND u.status = #{status} AND u.status = #{status}
</if> </if>
<if test="agencyId != null"> <if test="hospitalAgencyId != null">
AND u.agency_id = #{agencyId} AND u.hospital_agency_id = #{hospitalAgencyId}
</if> </if>
<if test="userCardNo != null and userCardNo != ''"> <if test="userCardNo != null and userCardNo != ''">
AND u.user_card_no = #{userCardNo} AND u.user_card_no = #{userCardNo}
@ -138,7 +138,7 @@
<select id="selectAllocatedList" parameterType="SysUser" resultMap="SysUserResult"> <select id="selectAllocatedList" parameterType="SysUser" resultMap="SysUserResult">
select distinct u.user_id, u.dept_id, u.user_name, u.nick_name, u.email, u.phonenumber, u.status, select distinct u.user_id, u.dept_id, u.user_name, u.nick_name, u.email, u.phonenumber, u.status,
u.create_time,u.agency_id u.create_time,u.hospital_agency_id
from sys_user u from sys_user u
left join sys_dept d on u.dept_id = d.dept_id left join sys_dept d on u.dept_id = d.dept_id
left join sys_user_role ur on u.user_id = ur.user_id left join sys_user_role ur on u.user_id = ur.user_id
@ -156,7 +156,7 @@
<select id="selectUnallocatedList" parameterType="SysUser" resultMap="SysUserResult"> <select id="selectUnallocatedList" parameterType="SysUser" resultMap="SysUserResult">
select distinct u.user_id, u.dept_id, u.user_name, u.nick_name, u.email, u.phonenumber, u.status, select distinct u.user_id, u.dept_id, u.user_name, u.nick_name, u.email, u.phonenumber, u.status,
u.create_time,u.agency_id u.create_time,u.hospital_agency_id
from sys_user u from sys_user u
left join sys_dept d on u.dept_id = d.dept_id left join sys_dept d on u.dept_id = d.dept_id
left join sys_user_role ur on u.user_id = ur.user_id left join sys_user_role ur on u.user_id = ur.user_id
@ -218,7 +218,7 @@
<if test="remark != null and remark != ''">remark,</if> <if test="remark != null and remark != ''">remark,</if>
<if test="userCardNo != null and userCardNo != ''">user_card_no,</if> <if test="userCardNo != null and userCardNo != ''">user_card_no,</if>
<if test="userBirthDate != null">user_birth_date,</if> <if test="userBirthDate != null">user_birth_date,</if>
<if test="agencyId != null">agency_id,</if> <if test="hospitalAgencyId != null">hospital_agency_id,</if>
<if test="departmentId != null">department_id,</if> <if test="departmentId != null">department_id,</if>
<if test="postName != null">post_name,</if> <if test="postName != null">post_name,</if>
create_time create_time
@ -237,7 +237,7 @@
<if test="remark != null and remark != ''">#{remark},</if> <if test="remark != null and remark != ''">#{remark},</if>
<if test="userCardNo != null and userCardNo != ''">#{userCardNo},</if> <if test="userCardNo != null and userCardNo != ''">#{userCardNo},</if>
<if test="userBirthDate != null">#{userBirthDate},</if> <if test="userBirthDate != null">#{userBirthDate},</if>
<if test="agencyId != null">#{agencyId},</if> <if test="hospitalAgencyId != null">#{hospitalAgencyId},</if>
<if test="departmentId != null">#{departmentId},</if> <if test="departmentId != null">#{departmentId},</if>
<if test="postName != null">#{postName},</if> <if test="postName != null">#{postName},</if>
sysdate() sysdate()
@ -262,7 +262,7 @@
<if test="remark != null">remark = #{remark},</if> <if test="remark != null">remark = #{remark},</if>
<if test="userCardNo != null and userCardNo != ''">user_card_no = #{userCardNo},</if> <if test="userCardNo != null and userCardNo != ''">user_card_no = #{userCardNo},</if>
<if test="userBirthDate != null">user_birth_date = #{userBirthDate},</if> <if test="userBirthDate != null">user_birth_date = #{userBirthDate},</if>
<if test="agencyId != null">agency_id =#{agencyId},</if> <if test="hospitalAgencyId != null">hospital_agency_id =#{hospitalAgencyId},</if>
<if test="departmentId != null">department_id = #{departmentId},</if> <if test="departmentId != null">department_id = #{departmentId},</if>
<if test="postName != null">post_name = #{postName},</if> <if test="postName != null">post_name = #{postName},</if>
update_time = sysdate() update_time = sysdate()
@ -272,7 +272,7 @@
<update id="updateUserAgency" parameterType="SysUser"> <update id="updateUserAgency" parameterType="SysUser">
update sys_user update sys_user
set agency_id =#{agencyId}, set hospital_agency_id =#{hospitalAgencyId},
department_id = #{departmentId}, department_id = #{departmentId},
update_time = sysdate() update_time = sysdate()
where user_id = #{userId} where user_id = #{userId}
@ -317,7 +317,7 @@
</delete> </delete>
<select id="selectAgencyList" resultType="com.xinelu.system.domain.vo.AgencyNameVO"> <select id="selectAgencyList" resultType="com.xinelu.system.domain.vo.AgencyNameVO">
select id agencyId, select id hospitalAgencyId,
agency_name, agency_name,
agency_code, agency_code,
(select COUNT(1) (select COUNT(1)
@ -327,8 +327,8 @@
and agency_name = #{agencyName} and agency_name = #{agencyName}
or agency_code = #{agencyName} or agency_code = #{agencyName}
</if> </if>
<if test="agencyId != null "> <if test="hospitalAgencyId != null ">
and id &lt;&gt; #{agencyId} and id &lt;&gt; #{hospitalAgencyId}
</if> </if>
) as agencyNum ) as agencyNum
from agency from agency
@ -337,22 +337,22 @@
and agency_name = #{agencyName} and agency_name = #{agencyName}
or agency_code = #{agencyName} or agency_code = #{agencyName}
</if> </if>
<if test="agencyId != null "> <if test="hospitalAgencyId != null ">
and id &lt;&gt; #{agencyId} and id &lt;&gt; #{hospitalAgencyId}
</if> </if>
</select> </select>
<select id="selectBelongAgencyList" resultType="com.xinelu.system.domain.vo.AgencyNameVO"> <select id="selectBelongAgencyList" resultType="com.xinelu.system.domain.vo.AgencyNameVO">
select id agencyId, select id hospitalAgencyId,
agency_name, agency_name,
agency_code, agency_code,
(select COUNT(1) (select COUNT(1)
from agency from agency
where id = #{agencyId} where id = #{hospitalAgencyId}
and agency_status = 'ON' and agency_status = 'ON'
and node_type = 'HOSPITAL') as agencyNum and node_type = 'HOSPITAL') as agencyNum
from agency from agency
where id = #{agencyId} where id = #{hospitalAgencyId}
and agency_status = 'ON' and agency_status = 'ON'
and node_type = 'HOSPITAL' and node_type = 'HOSPITAL'
</select> </select>
@ -371,8 +371,8 @@
<if test="departmentId != null "> <if test="departmentId != null ">
and id &lt;&gt; #{departmentId} and id &lt;&gt; #{departmentId}
</if> </if>
<if test="agencyId != null "> <if test="hospitalAgencyId != null ">
and agency_id = #{agencyId} and hospital_agency_id = #{hospitalAgencyId}
</if> </if>
) as departmentNum ) as departmentNum
from department from department
@ -384,8 +384,8 @@
<if test="departmentId != null "> <if test="departmentId != null ">
and id &lt;&gt; #{departmentId} and id &lt;&gt; #{departmentId}
</if> </if>
<if test="agencyId != null "> <if test="hospitalAgencyId != null ">
and agency_id = #{agencyId} and hospital_agency_id = #{hospitalAgencyId}
</if> </if>
</select> </select>