服务管理-查询
This commit is contained in:
@@ -3,16 +3,22 @@
|
||||
*/
|
||||
package com.openhis.web.basicservice.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.core.common.core.domain.R;
|
||||
import com.core.common.utils.MessageUtils;
|
||||
import com.openhis.administration.domain.ChargeItemDefinition;
|
||||
import com.openhis.administration.domain.HealthcareService;
|
||||
import com.openhis.administration.service.IChargeItemDefinitionService;
|
||||
import com.openhis.administration.service.IHealthcareServiceService;
|
||||
import com.openhis.common.constant.CommonConstants;
|
||||
import com.openhis.common.constant.PromptMsgConstant;
|
||||
import com.openhis.common.enums.AccountStatus;
|
||||
import com.openhis.common.enums.WhetherContainUnknown;
|
||||
import com.openhis.common.utils.HisQueryUtils;
|
||||
import com.openhis.web.basicservice.dto.HealthcareServiceAddOrUpdateParam;
|
||||
import com.openhis.web.basicservice.dto.HealthcareServiceDto;
|
||||
import com.openhis.web.basicservice.dto.HealthcareServiceInitDto;
|
||||
import com.openhis.web.basicservice.mapper.HealthcareServiceBizMapper;
|
||||
import lombok.AllArgsConstructor;
|
||||
@@ -21,6 +27,9 @@ import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.util.Arrays;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
import java.util.stream.Stream;
|
||||
@@ -37,7 +46,6 @@ public class HealthcareServiceController {
|
||||
private final IHealthcareServiceService iHealthcareServiceService;
|
||||
private final IChargeItemDefinitionService iChargeItemDefinitionService;
|
||||
|
||||
|
||||
private final HealthcareServiceBizMapper healthcareServiceBizMapper;
|
||||
|
||||
/**
|
||||
@@ -77,5 +85,28 @@ public class HealthcareServiceController {
|
||||
R.fail(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00010, null));
|
||||
}
|
||||
|
||||
/**
|
||||
* 服务管理 分页查询
|
||||
*
|
||||
* @param healthcareServiceDto 查询条件
|
||||
* @param searchKey 模糊查询关键字
|
||||
* @param pageNo 当前页码
|
||||
* @param pageSize 查询条数
|
||||
* @param request 请求数据
|
||||
* @return 列表信息
|
||||
*/
|
||||
@GetMapping(value = "/healthcare-service-page")
|
||||
public R<?> getHealthcareServicePage(@RequestBody HealthcareServiceDto healthcareServiceDto,
|
||||
@RequestParam(value = "searchKey", defaultValue = "") String searchKey,
|
||||
@RequestParam(value = "pageNo", defaultValue = "1") Integer pageNo,
|
||||
@RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize, HttpServletRequest request) {
|
||||
// 构建查询条件
|
||||
QueryWrapper<HealthcareServiceDto> queryWrapper = HisQueryUtils.buildQueryWrapper(healthcareServiceDto, searchKey,
|
||||
new HashSet<>(Arrays.asList("name", "charge_name")), request);
|
||||
IPage<HealthcareServiceDto> healthcareServicePage = healthcareServiceBizMapper.getHealthcareServicePage(
|
||||
new Page<>(pageNo, pageSize), CommonConstants.TableName.ADM_HEALTHCARE_SERVICE, queryWrapper);
|
||||
return R.ok(healthcareServicePage, MessageUtils.createMessage(PromptMsgConstant.Common.M00009, null));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,95 @@
|
||||
package com.openhis.web.basicservice.dto;
|
||||
|
||||
import com.openhis.common.annotation.Dict;
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* 服务管理 Dto
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class HealthcareServiceDto {
|
||||
/**
|
||||
* ID
|
||||
*/
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 活动标记
|
||||
*/
|
||||
private Integer activeFlag;
|
||||
|
||||
/**
|
||||
* 提供部门ID
|
||||
*/
|
||||
@Dict(dictTable = "adm_organization",dictCode = "id",dictText = "name")
|
||||
private Long offeredOrgId;
|
||||
private String offeredOrgId_dictText;
|
||||
|
||||
/**
|
||||
* 服务分类
|
||||
*/
|
||||
@Dict(dictCode = "category_code")
|
||||
private String categoryCode;
|
||||
private String categoryCode_dictText;
|
||||
|
||||
/**
|
||||
* 服务类型
|
||||
*/
|
||||
@Dict(dictCode = "service_type_code")
|
||||
private String typeCode;
|
||||
private String typeCode_dictText;
|
||||
|
||||
/**
|
||||
* 服务专业
|
||||
*/
|
||||
@Dict(dictCode = "specialty_code")
|
||||
private String specialtyCode;
|
||||
private String specialtyCode_dictText;
|
||||
|
||||
/**
|
||||
* 地点
|
||||
*/
|
||||
@Dict(dictTable = "adm_location",dictCode = "id",dictText = "name")
|
||||
private Long locationId;
|
||||
private String locationId_dictText;
|
||||
|
||||
/**
|
||||
* 服务名称
|
||||
*/
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 说明
|
||||
*/
|
||||
private String comment;
|
||||
|
||||
/**
|
||||
* 额外细节
|
||||
*/
|
||||
private String extraDetails;
|
||||
|
||||
/**
|
||||
* 联系方式
|
||||
*/
|
||||
private String contact;
|
||||
|
||||
/**
|
||||
* 预约要求
|
||||
*/
|
||||
private Integer appointmentRequiredFlag;
|
||||
|
||||
/**
|
||||
* 名称
|
||||
*/
|
||||
private String chargeName;
|
||||
|
||||
/**
|
||||
* 基础价格
|
||||
*/
|
||||
private BigDecimal price;
|
||||
|
||||
}
|
||||
@@ -1,5 +1,11 @@
|
||||
package com.openhis.web.basicservice.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Constants;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.openhis.web.basicservice.dto.HealthcareServiceDto;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
/**
|
||||
@@ -7,4 +13,17 @@ import org.springframework.stereotype.Repository;
|
||||
*/
|
||||
@Repository
|
||||
public interface HealthcareServiceBizMapper {
|
||||
|
||||
/**
|
||||
* 服务管理 分页查询
|
||||
*
|
||||
* @param page 分页参数
|
||||
* @param tableName 定价表名
|
||||
* @param queryWrapper 查询条件
|
||||
* @return 列表信息
|
||||
*/
|
||||
IPage<HealthcareServiceDto> getHealthcareServicePage(@Param("page") Page<HealthcareServiceDto> page,
|
||||
@Param("tableName") String tableName,
|
||||
@Param(Constants.WRAPPER) QueryWrapper<HealthcareServiceDto> queryWrapper);
|
||||
|
||||
}
|
||||
|
||||
@@ -4,4 +4,49 @@
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.openhis.web.basicservice.mapper.HealthcareServiceBizMapper">
|
||||
|
||||
<select id="getHealthcareServicePage" resultType="com.openhis.web.basicservice.dto.HealthcareServiceDto">
|
||||
SELECT
|
||||
T3.id,
|
||||
T3.tenant_id,
|
||||
T3.active_flag,
|
||||
T3.offered_org_id,
|
||||
T3.category_code,
|
||||
T3.type_code,
|
||||
T3.specialty_code,
|
||||
T3.location_id,
|
||||
T3.NAME,
|
||||
T3.COMMENT,
|
||||
T3.extra_details,
|
||||
T3.contact,
|
||||
T3.appointment_required_flag,
|
||||
T3.charge_name,
|
||||
T3.price
|
||||
FROM
|
||||
(
|
||||
SELECT
|
||||
T1.id,
|
||||
T1.tenant_id,
|
||||
T1.active_flag,
|
||||
T1.offered_org_id,
|
||||
T1.category_code,
|
||||
T1.type_code,
|
||||
T1.specialty_code,
|
||||
T1.location_id,
|
||||
T1.NAME,
|
||||
T1.COMMENT,
|
||||
T1.extra_details,
|
||||
T1.contact,
|
||||
T1.appointment_required_flag,
|
||||
T2.charge_name,
|
||||
T2.price
|
||||
FROM
|
||||
adm_healthcare_service AS T1
|
||||
LEFT JOIN adm_charge_item_definition AS T2 ON T2.instance_id = T1.ID
|
||||
AND T2.instance_table = #{tableName}
|
||||
ORDER BY
|
||||
T1.create_time DESC
|
||||
) AS T3
|
||||
${ew.customSqlSegment}
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
Reference in New Issue
Block a user