Commit ce6ffdc1 authored by zhangch's avatar zhangch

个人照护方案列表接口以及相关类

parent 8ad30bb6
package com.hungraim.ism.pojo.vo.governance;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import java.util.Date;
/**
* 列表页回显对象
*/
@Data
public class SvrProgramListVo {
/**
* 服务分配ID
*/
private Long srvSendId;
/**
* 机构所在省
*/
private String districtProvincial;
/**
* 机构所在市
*/
private String districtCity;
/**
* 失能人员姓名
*/
private String realName;
/**
* 失能人员手机号
*/
private String realTel;
/**
* 失能人员生日
*/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date birthday;
/**
* 失能人员性别
*/
private String gender;
/**
* 接收服务省市区
*/
private String acptProvincial;
private String acptCity;
private String acptArea;
private String acptStreet;
private String acptAddress;
/**
* 服务方案数量
*/ private Integer programNum;
/**
* 服务分配状态 未分配 0 已分配 1 已终止 2
*/
private Integer sendStatus;
/**
* 创建时间(分配时间)
*/
private Date effTime;
}
package com.hungraim.ltc.pojo.entity.governance;
import com.baomidou.mybatisplus.annotation.KeySequence;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
/**
* CH_SRV_SEND
* @author
*/
@TableName("CH_SRV_SEND")
@Data
@KeySequence("CH_SRV_SEND_SQE")
public class ChSrvSend implements Serializable {
/**
* 服务分配ID
*/
private Long srvSendId;
/**
* 服务机构ID
*/
private Long srvOrganId;
/**
* 服务方式ID
*/
private Long srvModeId;
/**
* 失能人员ID
*/
private Long disabInfoId;
/**
* 分配时间
*/
private Date allotTime;
/**
* 创建人
*/
private Long defineEmp;
/**
* 创建时间
*/
private Date effTime;
/**
* 终止人
*/
private Long endEmp;
/**
* 终止时间
*/
private Date endTime;
/**
* 首次操作时间
*/
private Date fcd;
/**
* 首次操作人
*/
private Long fcu;
/**
* 末次操作时间
*/
private Date lcd;
/**
* 末次操作人
*/
private Long lcu;
/**
* 服务分配状态 未分配 0 已分配 1 已终止 2
*/
private Short status;
/**
* 服务分配终止时间
*/
private Date stopTime;
/**
* 接受服务省
*/
private String acptProvincial;
/**
* 接受服务市
*/
private String acptCity;
/**
* 接受服务区
*/
private String acptArea;
/**
* 接受服务街道
*/
private String acptStreet;
/**
* 接受服务详细地址
*/
private String acptAddress;
/**
* 接受服务类型 现在址:0,机构地址:1,其他:2
*/
private Short acptType;
/**
* 服务配置模式ID
*/
private Long cfgModeId;
/**
* 接受鉴定路街
*/
private String acptRoadDetail;
/**
* 接受鉴定路/街 (0路,1街,2村)
*/
private Short acptRoadType;
/**
* 接受鉴定号弄
*/
private String acptNumberDetail;
/**
* 接受鉴定号/弄 (0弄,1号)
*/
private Short acptNumberType;
/**
* 接受服务地址经度
*/
private String acptLongitude;
/**
* 接受服务地址纬度
*/
private String acptLatitude;
private static final long serialVersionUID = 1L;
}
\ No newline at end of file
package com.hungraim.ltc.governance.controller;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.hungraim.ism.pojo.vo.governance.SvrProgramListVo;
import com.hungraim.ltc.governance.service.SrvProgramService;
import com.hungraim.ltc.util.Result;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@RestController
@RequestMapping("/api.governance/srvProgram")
@Slf4j
public class SrvProgramController {
@Autowired
private SrvProgramService srvProgramService;
/**
* 获取方案详情
*
* @param programId
* @return
*/
@RequestMapping("/{programId}")
public Result getSrvProgram(@PathVariable("programId") Long programId) {
return Result.success();
}
/**
* 个人照护方案查询列表
*
* @param srvOrganId 服务机构id
* @param realName 失能人员姓名
* @param realTel 失能人员手机号
* @param programStatus 服务方案状态
* @return 返回列表
*/
@RequestMapping("/programList")
public Result getProgramList(Long srvOrganId, String realName, String realTel, String programStatus, Integer pageNum, Integer pageSize) {
if (pageNum == null || pageNum < 1) {
return Result.failed("参数错误");
}
if (pageSize == null || pageSize < 1) {
pageSize = 10;
}
Page<SvrProgramListVo> page = new Page<>(pageNum, pageSize);
page = srvProgramService.getProgramList(page, srvOrganId, realName, realTel, programStatus);
return Result.success(page);
}
}
package com.hungraim.ltc.governance.dao;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.hungraim.ism.pojo.vo.governance.SvrProgramListVo;
import com.hungraim.ltc.pojo.entity.governance.ChSrvSend;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;
@Mapper
@Repository
public interface ChSrvSendMapper extends BaseMapper<ChSrvSend> {
/**
* 个人照护方案查询列表
*
* @param srvOrganId 服务机构id
* @param realName 失能人员姓名
* @param realTel 失能人员手机号
* @param programStatus 服务方案状态
* @return 返回列表
*/
Page<SvrProgramListVo> selectProgramList(Page<SvrProgramListVo> page, @Param("srvOrganId") Long srvOrganId, @Param("realName") String realName, @Param("realTel") String realTel, @Param("programStatus") String programStatus);
}
\ No newline at end of file
package com.hungraim.ltc.governance.service;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.hungraim.ism.pojo.vo.governance.SvrProgramListVo;
public interface SrvProgramService {
/**
* 个人照护方案查询列表
*
* @param srvOrganId 服务机构id
* @param realName 失能人员姓名
* @param realTel 失能人员手机号
* @param programStatus 服务方案状态
* @return 返回列表
*/
Page<SvrProgramListVo> getProgramList(Page<SvrProgramListVo> page, Long srvOrganId, String realName, String realTel, String programStatus);
}
package com.hungraim.ltc.governance.service.impl;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.hungraim.ism.pojo.vo.governance.SvrProgramListVo;
import com.hungraim.ltc.governance.dao.ChSrvSendMapper;
import com.hungraim.ltc.governance.service.SrvProgramService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@Service
public class SrvProgramServiceImpl implements SrvProgramService {
@Autowired
private ChSrvSendMapper chSrvSendMapper;
@Override
public Page<SvrProgramListVo> getProgramList(Page<SvrProgramListVo> page, Long srvOrganId, String realName, String realTel, String programStatus) {
return chSrvSendMapper.selectProgramList(page, srvOrganId, realName, realTel, programStatus);
}
}
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.hungraim.ltc.governance.dao.ChSrvSendMapper">
<resultMap id="BaseResultMap" type="com.hungraim.ltc.pojo.entity.governance.ChSrvSend">
<result column="SRV_SEND_ID" jdbcType="DECIMAL" property="srvSendId"/>
<result column="SRV_ORGAN_ID" jdbcType="DECIMAL" property="srvOrganId"/>
<result column="SRV_MODE_ID" jdbcType="DECIMAL" property="srvModeId"/>
<result column="DISAB_INFO_ID" jdbcType="DECIMAL" property="disabInfoId"/>
<result column="ALLOT_TIME" jdbcType="TIMESTAMP" property="allotTime"/>
<result column="DEFINE_EMP" jdbcType="DECIMAL" property="defineEmp"/>
<result column="EFF_TIME" jdbcType="TIMESTAMP" property="effTime"/>
<result column="END_EMP" jdbcType="DECIMAL" property="endEmp"/>
<result column="END_TIME" jdbcType="TIMESTAMP" property="endTime"/>
<result column="FCD" jdbcType="TIMESTAMP" property="fcd"/>
<result column="FCU" jdbcType="DECIMAL" property="fcu"/>
<result column="LCD" jdbcType="TIMESTAMP" property="lcd"/>
<result column="LCU" jdbcType="DECIMAL" property="lcu"/>
<result column="STATUS" jdbcType="DECIMAL" property="status"/>
<result column="STOP_TIME" jdbcType="TIMESTAMP" property="stopTime"/>
<result column="ACPT_PROVINCIAL" jdbcType="VARCHAR" property="acptProvincial"/>
<result column="ACPT_CITY" jdbcType="VARCHAR" property="acptCity"/>
<result column="ACPT_AREA" jdbcType="VARCHAR" property="acptArea"/>
<result column="ACPT_STREET" jdbcType="VARCHAR" property="acptStreet"/>
<result column="ACPT_ADDRESS" jdbcType="VARCHAR" property="acptAddress"/>
<result column="ACPT_TYPE" jdbcType="DECIMAL" property="acptType"/>
<result column="CFG_MODE_ID" jdbcType="DECIMAL" property="cfgModeId"/>
<result column="ACPT_ROAD_DETAIL" jdbcType="VARCHAR" property="acptRoadDetail"/>
<result column="ACPT_ROAD_TYPE" jdbcType="DECIMAL" property="acptRoadType"/>
<result column="ACPT_NUMBER_DETAIL" jdbcType="VARCHAR" property="acptNumberDetail"/>
<result column="ACPT_NUMBER_TYPE" jdbcType="DECIMAL" property="acptNumberType"/>
<result column="ACPT_LONGITUDE" jdbcType="VARCHAR" property="acptLongitude"/>
<result column="ACPT_LATITUDE" jdbcType="VARCHAR" property="acptLatitude"/>
</resultMap>
<select id="selectProgramList" resultType="com.hungraim.ism.pojo.vo.governance.SvrProgramListVo">
SELECT T1.SRV_SEND_ID srvSendId,
T2.DISTRICT_PROVINCIAL districtProvincial,
T2.DISTRICT_CITY districtCity,
T3.REAL_NAME realName,
T3.TEL realTel,
T3.BIRTHDAY birthday,
T3.GENDER gender,
T3.ACPT_PROVINCIAL acptProvincial,
T3.ACPT_CITY acptCity,
T3.ACPT_AREA acptArea,
T3.ACPT_STREET acptStreet,
T3.ACPT_ADDRESS acptAddress,
T1.STATUS sendStatus,
T1.EFF_TIME effTime,
(SELECT COUNT(0) FROM CH_SRV_PROGRAM T4 WHERE T1.SRV_ORGAN_ID = T4.SRV_ORGAN_ID) programNum
FROM CH_SRV_SEND T1
INNER JOIN CH_SRV_ORGAN T2 ON T1.SRV_ORGAN_ID = T2.SRV_ORGAN_ID
INNER JOIN CH_DISABLE_INFO T3 ON T1.DISAB_INFO_ID = T3.DISAB_INFO_ID
<where>
<if test="srvOrganId != null">
T1.SRV_ORGAN_ID = #{srvOrganId}
</if>
<if test="realName != null and realName != ''">
AND T3.REAL_NAME LIKE CONCAT(CONCAT('%',#{realName}),'%')
</if>
<if test="realTel != null and realTel != ''">
AND T3.TEL = #{realTel}
</if>
<if test="programStatus != null and programStatus != ''">
AND T1.STATUS = #{programStatus}
</if>
</where>
ORDER BY T1.EFF_TIME DESC
</select>
</mapper>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment