整理代码
This commit is contained in:
parent
d10ce132bd
commit
00296cc20c
@ -0,0 +1,45 @@
|
||||
package com.xinelu.manage.controller.patientinfoimportmain;
|
||||
|
||||
|
||||
import com.xinelu.common.core.controller.BaseController;
|
||||
import com.xinelu.common.core.page.TableDataInfo;
|
||||
import com.xinelu.manage.domain.patientinfoimportmain.PatientInfoImportMain;
|
||||
import com.xinelu.manage.service.patientinfoimportmain.IPatientInfoImportMainService;
|
||||
import com.xinelu.manage.vo.patientinfoimportmain.PatientInfoImportMainVO;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 患者信息Controller
|
||||
*
|
||||
* @author zyk
|
||||
* @date 2024-11-27
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/manage/patientInfoimportmain")
|
||||
@Api(tags = "患者导入信息控制器")
|
||||
public class PatientInfoImportMainController extends BaseController {
|
||||
|
||||
|
||||
@Resource
|
||||
IPatientInfoImportMainService patientInfoImportMainService ;
|
||||
/**
|
||||
* 查询患者信息列表
|
||||
*/
|
||||
@ApiOperation("查询患者导入信息列表")
|
||||
// @PreAuthorize("@ss.hasPermi('manage:patientInfoimporttemp:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(PatientInfoImportMainVO patientInfoImportMainVO) {
|
||||
startPage();
|
||||
List<PatientInfoImportMainVO> list = patientInfoImportMainService.GetPatientInfoImport(patientInfoImportMainVO);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@ -1,6 +1,7 @@
|
||||
package com.xinelu.manage.mapper.patientinfoimportmain;
|
||||
|
||||
import com.xinelu.manage.domain.patientinfoimportmain.PatientInfoImportMain;
|
||||
import com.xinelu.manage.vo.patientinfoimportmain.PatientInfoImportMainVO;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@ -19,6 +20,13 @@ public interface PatientInfoImportMainMapper {
|
||||
*/
|
||||
PatientInfoImportMain selectPatientInfoImportMainById(Long id);
|
||||
|
||||
// @Select("SELECT p.sn,count( 1 ) AS patientcount,DATE_FORMAT( p.create_time, '%Y-%m-%d' ) AS createTime,p.create_by FROM patient_info_import p GROUP BY p.sn,DATE_FORMAT( p.create_time, '%Y-%m-%d' ),p.create_by")
|
||||
// @Select("select * from patient_info")
|
||||
// @DataSource(value = DataSourceType.HKHIS)
|
||||
List<PatientInfoImportMainVO> GetPatientInfoImport(PatientInfoImportMainVO patientInfoImport2VO);
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 查询患者导入记录列表
|
||||
*
|
||||
|
||||
@ -0,0 +1,12 @@
|
||||
package com.xinelu.manage.service.patientinfoimportmain;
|
||||
|
||||
|
||||
import com.xinelu.manage.vo.patientinfoimportmain.PatientInfoImportMainVO;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface IPatientInfoImportMainService {
|
||||
|
||||
List<PatientInfoImportMainVO> GetPatientInfoImport(PatientInfoImportMainVO patientInfoImportMainVO);
|
||||
|
||||
}
|
||||
@ -0,0 +1,32 @@
|
||||
package com.xinelu.manage.service.patientinfoimportmain.impl;
|
||||
|
||||
import com.xinelu.common.annotation.DataScope;
|
||||
import com.xinelu.manage.mapper.patientinfoimportmain.PatientInfoImportMainMapper;
|
||||
import com.xinelu.manage.service.patientinfoimportmain.IPatientInfoImportMainService;
|
||||
import com.xinelu.manage.vo.patientinfoimportmain.PatientInfoImportMainVO;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
@Service
|
||||
public class PatientInfoImportMainServiceImpl implements IPatientInfoImportMainService {
|
||||
|
||||
@Resource
|
||||
PatientInfoImportMainMapper patientInfoImportMainMapper;
|
||||
|
||||
@DataScope(agencyAlias = "p")
|
||||
@Override
|
||||
public List<PatientInfoImportMainVO> GetPatientInfoImport(PatientInfoImportMainVO patientInfoImport2VO)
|
||||
{
|
||||
List<PatientInfoImportMainVO> list = new ArrayList<>();
|
||||
|
||||
list = patientInfoImportMainMapper.GetPatientInfoImport(patientInfoImport2VO);
|
||||
|
||||
return list;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,71 @@
|
||||
package com.xinelu.manage.vo.patientinfoimportmain;
|
||||
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.xinelu.common.core.domain.BaseEntity;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import java.time.LocalDate;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Data
|
||||
public class PatientInfoImportMainVO extends BaseEntity {
|
||||
|
||||
/** $column.columnComment */
|
||||
private Long id;
|
||||
|
||||
/** 附件名称 */
|
||||
@ApiModelProperty(value = "附件名称")
|
||||
private String fileName;
|
||||
|
||||
/** 已随访:FOLLOWED;未随访:NOT_FOLLOWED;PARTIAL_FOLLOWED */
|
||||
@ApiModelProperty(value = "已随访:FOLLOWED;未随访:NOT_FOLLOWED;PARTIAL_FOLLOWED")
|
||||
private String followupStatus;
|
||||
|
||||
/** 已随访人数 */
|
||||
@ApiModelProperty(value = "已随访人数")
|
||||
private Long followupCount;
|
||||
|
||||
/** 流水号 */
|
||||
@ApiModelProperty(value = "流水号")
|
||||
private Long sn;
|
||||
|
||||
/** 患者数量 */
|
||||
@ApiModelProperty(value = "患者数量")
|
||||
private String patientCount;
|
||||
|
||||
|
||||
/** 导入人员 */
|
||||
@ApiModelProperty(value = "导入人员")
|
||||
private String createBy;
|
||||
|
||||
/**
|
||||
* 导入日期
|
||||
*/
|
||||
@ApiModelProperty(value = "导入日期时间")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
@ApiModelProperty(value = "机构ID")
|
||||
private Long hospitalAgencyId;
|
||||
|
||||
@ApiModelProperty(value = "机构名称")
|
||||
private String hospitalAgencyName;
|
||||
|
||||
@ApiModelProperty(value = "院区ID")
|
||||
private Long campusAgencyId;
|
||||
|
||||
|
||||
/** 开始导入时间,时间格式:yyyy-MM-dd */
|
||||
@ApiModelProperty(value = "开始导入时间,时间格式:yyyy-MM-dd")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd")
|
||||
private LocalDate importTimeStart;
|
||||
|
||||
/** 导入时间,时间格式:yyyy-MM-dd */
|
||||
@ApiModelProperty(value = "截止导入时间,时间格式:yyyy-MM-dd")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd")
|
||||
private LocalDate importTimeEnd;
|
||||
|
||||
}
|
||||
@ -15,7 +15,17 @@
|
||||
<result property="followupStatus" column="followup_status"/>
|
||||
<result property="followupCount" column="followup_count"/>
|
||||
</resultMap>
|
||||
|
||||
<resultMap type="com.xinelu.manage.vo.patientinfoimportmain.PatientInfoImportMainVO" id="PatientInfoImportVOResult">
|
||||
<result property="id" column="id"/>
|
||||
<result property="followupStatus" column="followup_status"/>
|
||||
<result property="fileName" column="file_name"/>
|
||||
<result property="followupCount" column="followup_count"/>
|
||||
<result property="hospitalAgencyId" column="hospital_agency_id"/>
|
||||
<result property="hospitalAgencyName" column="hospital_agency_name"/>
|
||||
<result property="patientCount" column="patient_count"/>
|
||||
<result property="createBy" column="create_by"/>
|
||||
<result property="createTime" column="create_date"/>
|
||||
</resultMap>
|
||||
<sql id="selectPatientInfoImportMainVo">
|
||||
select id, sn, create_time, create_by, hospital_agency_id, hospital_agency_name, file_name, followup_status, followup_count from patient_info_import_main
|
||||
</sql>
|
||||
@ -43,7 +53,32 @@
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
<select id="GetPatientInfoImport" resultType="com.xinelu.manage.vo.patientinfoimportmain.PatientInfoImportMainVO"
|
||||
parameterType="com.xinelu.manage.vo.patientinfoimportmain.PatientInfoImportMainVO">
|
||||
-- SELECT sn,count(1) as patientCount,DATE_FORMAT(create_time, '%Y-%m-%d') as createTime,create_by as createBy FROM patient_info_import group by sn,DATE_FORMAT(create_time, '%Y-%m-%d'),create_by
|
||||
-- SELECT p.sn,count( 1 ) AS patientcount,DATE_FORMAT( p.create_time, '%Y-%m-%d' ) AS createTime,p.create_by FROM patient_info_import p
|
||||
|
||||
select p.*,(select count(1) from patient_info_import pii where pii.sn=p.sn) as patient_count from patient_info_import_main p
|
||||
<where>
|
||||
<if test="importTimeStart != null">
|
||||
and date_format(p.create_time,'%y%m%d') >= date_format(#{importTimeStart}, '%y%m%d')
|
||||
</if>
|
||||
<if test="importTimeEnd != null">
|
||||
and date_format(p.create_time,'%y%m%d') <= date_format(#{importTimeEnd}, '%y%m%d')
|
||||
</if>
|
||||
<if test="hospitalAgencyId != null and (campusAgencyId == null or campusAgencyId == '')">
|
||||
and p.hospital_agency_id = #{hospitalAgencyId}
|
||||
</if>
|
||||
<if test="campusAgencyId != null ">
|
||||
and p.hospital_agency_id = #{campusAgencyId}
|
||||
</if>
|
||||
<!-- 数据范围过滤 -->
|
||||
${params.dataScope}
|
||||
</where>
|
||||
ORDER BY P.ID DESC
|
||||
-- GROUP BY p.sn,DATE_FORMAT( p.create_time, '%Y-%m-%d' ),p.create_by
|
||||
|
||||
</select>
|
||||
<select id="selectPatientInfoImportMainById" parameterType="Long"
|
||||
resultMap="PatientInfoImportMainResult">
|
||||
<include refid="selectPatientInfoImportMainVo"/>
|
||||
@ -132,4 +167,4 @@
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
||||
</mapper>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user