小程序代码订单移植

This commit is contained in:
张恒 2023-10-16 17:32:30 +08:00
parent 343f072673
commit 7b49958ce8
8 changed files with 1224 additions and 0 deletions

View File

@ -0,0 +1,96 @@
package com.xinelu.applet.controller.nursingorder;
import com.xinelu.applet.service.nursingorder.INursingOrderService;
import com.xinelu.applet.vo.nursingorder.AppletGoodsOrderVO;
import com.xinelu.applet.vo.nursingorder.NursingOrderInfoVO;
import com.xinelu.common.annotation.MobileRequestAuthorization;
import com.xinelu.common.core.controller.BaseController;
import com.xinelu.common.core.domain.AjaxResult;
import com.xinelu.common.core.domain.entity.SysDictData;
import com.xinelu.common.core.page.TableDataInfo;
import com.xinelu.common.enums.OrderTypeEnum;
import com.xinelu.manage.domain.goodsOrder.GoodsOrder;
import org.apache.commons.lang3.StringUtils;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import java.util.List;
import java.util.Objects;
/**
* @Description 个人中心订单页面
* @Author zhangheng
* @Date 2022-09-06
* @Version 1.0
*/
@RestController
@RequestMapping("/nurseApplet/nursingOrder")
public class NursingOrderController extends BaseController {
@Resource
private INursingOrderService nursingOrderService;
/**
* 根据登录id查询订单列表
*/
@GetMapping("/userPage")
public TableDataInfo page(Long parentId) {
startPage();
List<NursingOrderInfoVO> nursingOrderByPatientId = nursingOrderService.getNursingOrderByPatientId(parentId);
return getDataTable(nursingOrderByPatientId);
}
/**
* 根据护理人id以及订单状态查询订单信息
*/
@MobileRequestAuthorization
@GetMapping("/goodsOrder")
public TableDataInfo goodsOrder(AppletGoodsOrderVO goodsOrderVO) {
startPage();
List<AppletGoodsOrderVO> goodsOrder = nursingOrderService.getGoodsOrder(goodsOrderVO);
return getDataTable(goodsOrder);
}
/**
* 查询退款原因
*/
@MobileRequestAuthorization
@GetMapping("/refundReason")
public TableDataInfo refundReason(SysDictData sysDictData) {
startPage();
List<SysDictData> refundReason = nursingOrderService.getRefundReason(sysDictData);
return getDataTable(refundReason);
}
/**
* 修改商品订单(退款售后记录信息)
*/
@MobileRequestAuthorization
@PostMapping("/edit")
public AjaxResult edit(@RequestBody GoodsOrder goodsOrder) {
if (Objects.isNull(goodsOrder.getId())) {
return AjaxResult.error("订单id不能为空");
}
if (StringUtils.isNotBlank(goodsOrder.getOrderType()) && !OrderTypeEnum.HEALTH_CONSULTATION.getInfo().equals(goodsOrder.getOrderType())) {
if (Objects.isNull(goodsOrder.getRefundReasonDictId())) {
return AjaxResult.error("请选择退款原因!");
}
}
return toAjax(nursingOrderService.updateGoodsOrder(goodsOrder));
}
/**
* 根据预约订单编号查询对应得订单详情信息
*
* @param orderNo 订单编号
* @return 详情信息
*/
@MobileRequestAuthorization
@GetMapping("/getAppointmentDetailsInfo")
public AjaxResult getAppointmentDetailsInfo(String orderNo) {
if (StringUtils.isBlank(orderNo)) {
return AjaxResult.error("请选择要查询的预约订单信息!");
}
return nursingOrderService.getAppointmentDetailsInfo(orderNo);
}
}

View File

@ -0,0 +1,66 @@
package com.xinelu.applet.mapper.nursingorder;
import com.xinelu.applet.vo.nursingorder.AppletGoodsOrderVO;
import com.xinelu.applet.vo.nursingorder.NursingOrderInfoVO;
import com.xinelu.applet.vo.specialdisease.AppointmentOrderDetailsInfoVO;
import com.xinelu.common.core.domain.entity.SysDictData;
import com.xinelu.manage.domain.goodsOrder.GoodsOrder;
import java.util.List;
/**
* 功能描述: 护理站订单信息
*
* @author zhangheng
*/
public interface NursingOrderMapper {
/**
* 根据被护理人patientId查询订单信息
*
* @param patientId 会员id
* @return 订单列表
*/
List<NursingOrderInfoVO> getNursingOrderVOByPatientId(Long patientId);
/**
* 根据护理人id以及订单状态查询订单信息
*
* @param goodsOrderVO 订单信息
* @return AppletGoodsOrderVO
**/
List<AppletGoodsOrderVO> getGoodsOrder(AppletGoodsOrderVO goodsOrderVO);
/**
* 查询退款原因
*
* @param sysDictData 退款原因
* @return com.xinyilu.common.core.domain.entity.SysDictData
**/
List<SysDictData> getRefundReason(SysDictData sysDictData);
/**
* 修改商品订单(退款售后记录信息)
*
* @param goodsOrder 商品订单
* @return 结果
*/
int updateGoodsOrder(GoodsOrder goodsOrder);
/**
* 根据预约订单编号查询对应得详情信息
*
* @param orderNo 订单编号
* @return 详情信息
*/
AppointmentOrderDetailsInfoVO getAppointmentOrderDetailsInfo(String orderNo);
/**
* 查询护理站信息
*
* @param nurseStationItemId 护理站项目id
* @return 护理站信息
*/
AppointmentOrderDetailsInfoVO getNurseStationByItemId(Long nurseStationItemId);
}

View File

@ -0,0 +1,58 @@
package com.xinelu.applet.service.nursingorder;
import com.xinelu.applet.vo.nursingorder.AppletGoodsOrderVO;
import com.xinelu.applet.vo.nursingorder.NursingOrderInfoVO;
import com.xinelu.common.core.domain.AjaxResult;
import com.xinelu.common.core.domain.entity.SysDictData;
import com.xinelu.manage.domain.goodsOrder.GoodsOrder;
import java.util.List;
/**
* 订单列表Service接口
*
* @author zhangheng
* @date 2022-09-06
*/
public interface INursingOrderService {
/**
* 根据被护理人patientId查询订单信息
*
* @param patientId 被护理人id
* @return 订单列表
*/
List<NursingOrderInfoVO> getNursingOrderByPatientId(Long patientId);
/**
* 根据护理人id以及订单状态查询订单信息
*
* @param goodsOrderVO 订单信息
* @return java.util.List<com.xinyilu.nurseapplet.domain.vo.nursingorder.AppletGoodsOrderVO>
**/
List<AppletGoodsOrderVO> getGoodsOrder(AppletGoodsOrderVO goodsOrderVO);
/**
* 查询退款原因
*
* @param sysDictData 退款原因
* @return com.xinyilu.common.core.domain.entity.SysDictData
**/
List<SysDictData> getRefundReason(SysDictData sysDictData);
/**
* 修改商品订单(退款售后记录信息)
*
* @param goodsOrder 商品订单
* @return 结果
*/
int updateGoodsOrder(GoodsOrder goodsOrder);
/**
* 根据预约订单编号查询对应得订单详情信息
*
* @param orderNo 订单编号
* @return 详情信息
*/
AjaxResult getAppointmentDetailsInfo(String orderNo);
}

View File

@ -0,0 +1,110 @@
package com.xinelu.applet.service.nursingorder.impl;
import com.xinelu.applet.mapper.nursingorder.NursingOrderMapper;
import com.xinelu.applet.service.nursingorder.INursingOrderService;
import com.xinelu.applet.vo.nursingorder.AppletGoodsOrderVO;
import com.xinelu.applet.vo.nursingorder.NursingOrderInfoVO;
import com.xinelu.applet.vo.specialdisease.AppointmentOrderDetailsInfoVO;
import com.xinelu.common.core.domain.AjaxResult;
import com.xinelu.common.core.domain.entity.SysDictData;
import com.xinelu.common.enums.ConfirmRefundStatusEnum;
import com.xinelu.common.enums.GooodsOrderStatusEnum;
import com.xinelu.manage.domain.goodsOrder.GoodsOrder;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.time.LocalDateTime;
import java.util.List;
import java.util.Objects;
/**
* @Description 订单分页
* @Author ZhangHeng
* @Date 2022-09-06
* @Version
*/
@Service
public class NursingOrderServiceImpl implements INursingOrderService {
@Resource
private NursingOrderMapper nursingOrderMapper;
/**
* 查询个人订单列表并分页
*
* @param patientId 被护理人id
* @return 结果
*/
@Override
public List<NursingOrderInfoVO> getNursingOrderByPatientId(Long patientId) {
return nursingOrderMapper.getNursingOrderVOByPatientId(patientId);
}
/**
* 根据护理人id以及订单状态查询订单信息
*
* @param goodsOrderVO 订单信息
* @return java.util.List<com.xinyilu.nurseapplet.domain.vo.nursingorder.GoodsOrderVO>
**/
@Override
public List<AppletGoodsOrderVO> getGoodsOrder(AppletGoodsOrderVO goodsOrderVO) {
return nursingOrderMapper.getGoodsOrder(goodsOrderVO);
}
/**
* 查询退款原因
*
* @param sysDictData 退款原因
* @return com.xinyilu.common.core.domain.entity.SysDictData
**/
@Override
public List<SysDictData> getRefundReason(SysDictData sysDictData) {
//dict_type 字典类型refund_reason
sysDictData.setDictType("refund_reason");
return nursingOrderMapper.getRefundReason(sysDictData);
}
/**
* 修改商品订单(退款售后记录信息)
*
* @param goodsOrder 商品订单
* @return 结果
*/
@Override
public int updateGoodsOrder(GoodsOrder goodsOrder) {
//设置修改人以及修改时间
goodsOrder.setUpdateTime(LocalDateTime.now());
//订单状态 退款中 WAIT_REFUND
goodsOrder.setOrderStatus(GooodsOrderStatusEnum.WAIT_REFUND.getInfo());
//确认退款状态 未确认 NOT_CONFIRM
goodsOrder.setConfirmRefundStatus(ConfirmRefundStatusEnum.NOT_CONFIRM.getInfo());
return nursingOrderMapper.updateGoodsOrder(goodsOrder);
}
/**
* 根据预约订单编号查询对应得订单详情信息
*
* @param orderNo 订单编号
* @return 详情信息
*/
@Override
public AjaxResult getAppointmentDetailsInfo(String orderNo) {
//查询预约服务订单信息
AppointmentOrderDetailsInfoVO detailsInfoVO = nursingOrderMapper.getAppointmentOrderDetailsInfo(orderNo);
if (Objects.isNull(detailsInfoVO)) {
return AjaxResult.success();
}
//查询护理站相关信息
AppointmentOrderDetailsInfoVO nurseStationInfo = nursingOrderMapper.getNurseStationByItemId(Objects.isNull(detailsInfoVO.getNurseStationItemId()) ? 0L : detailsInfoVO.getNurseStationItemId());
if (Objects.nonNull(nurseStationInfo)) {
detailsInfoVO.setNurseStationName(StringUtils.isBlank(nurseStationInfo.getNurseStationName()) ? "" : nurseStationInfo.getNurseStationName());
detailsInfoVO.setStationPhone(StringUtils.isBlank(nurseStationInfo.getStationPhone()) ? "" : nurseStationInfo.getStationPhone());
detailsInfoVO.setAddress(StringUtils.isBlank(nurseStationInfo.getAddress()) ? "" : nurseStationInfo.getAddress());
detailsInfoVO.setStationPictureUrl(StringUtils.isBlank(nurseStationInfo.getStationPictureUrl()) ? "" : nurseStationInfo.getStationPictureUrl());
detailsInfoVO.setItemPictureUrl(StringUtils.isBlank(nurseStationInfo.getItemPictureUrl()) ? "" : nurseStationInfo.getItemPictureUrl());
}
return AjaxResult.success(detailsInfoVO);
}
}

View File

@ -0,0 +1,249 @@
package com.xinelu.applet.vo.nursingorder;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.Date;
/**
* @author ljh
* @version 1.0
* Create by 2022/10/25 15:49
*/
@Data
public class AppletGoodsOrderVO implements Serializable {
private static final long serialVersionUID = -1046127024688630443L;
/**
* 商品订单表id
*/
private Long goodsOrderId;
/**
* 护理站id
*/
private Long nurseStationId;
/**
* 会员id
*/
private Long patientId;
/**
* 订单编号
*/
private String goOrderNo;
/**
* 订单编号
*/
private String godOrderNo;
/**
* 订单状态待付款WAIT_PAY已付款PAY已取消CANCEL待收货WAIT_RECEIVED已收货RECEIVED待退款WAIT_REFUND已退款REFUNDED待退货WAIT_RETURNED已退货RETURNED
*/
private String orderStatus;
/**
* 订单总金额
*/
private BigDecimal totalPrice;
/**
* 收货人
*/
private String receiver;
/**
* 收货地址
*/
private String receiveAddress;
/**
* 联系电话
*/
private String phone;
/**
* 订单总金额
*/
private BigDecimal godTotalPrice;
/**
* 下单时间
*/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private LocalDateTime orderTime;
/**
* 主键id
*/
private Long goodsOrderDetailsId;
/**
* 商品名称
*/
private String goodsName;
/**
* 商品数量
*/
private Integer goodsCount;
/**
* 商品属性名称
*/
private String goodsAttributeName;
/**
* 商品属性内容
*/
private String goodsAttributeContent;
/**
* 商品单价
*/
private BigDecimal goodsPrice;
/**
* 优惠金额
*/
private BigDecimal discountPrice;
/**
* 运费金额
*/
private BigDecimal transportPrice;
/**
* 赠送积分
*/
private Integer giveIntegral;
/**
* 退款退货类型REFUND_MONEY_GOODS仅退款ONLY_REFUND_MONEY
*/
private String refundType;
/**
* 退款原因类型字典表id
*/
private Long refundReasonDictId;
/**
* 退货原因具体描述
*/
private String refundReasonRemark;
/**
* 确认退款状态未确认NOT_CONFIRM已确认CONFIRMED
*/
private String confirmRefundStatus;
/**
* 商品属性图片地址
*/
private String attributePitureUrl;
/**
* 退款时间时间
*/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private LocalDateTime updateTime;
/**
* 字典标签
*/
private String dictLabel;
/**
* 快递单号
*/
private String expressNo;
/**
* 购买来源
*/
private String buySource;
/**
* 订单类型积分兑换INTEGRAL_EXCHANGE直接购买DIRECT_BUY健康咨询HEALTH_CONSULTATION
*/
private String orderType;
/**
* 积分抵扣数量
*/
private Integer integralDeductionCount;
/**
* 退款详情-申请时间
*/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private LocalDateTime appleTime;
/**
* 积分兑换标识01
*/
private Integer integralExchangeFlag;
/**
* 积分兑换门槛值
*/
private Integer integralExchangeSill;
/**
* 积分兑换商品数量
*/
private Integer integralExchangeCount;
/**
* 订单原始总金额优惠券之前的价格商品数量*商品单价
*/
private BigDecimal originalTotalPrice;
/**
* 优惠券名称
*/
private String couponTitle;
/**
* 优惠券id
*/
private Long couponId;
/**
* 健康咨询人员表id记录咨询订单中选择的医生
*/
private Long hospitalPersonId;
/**
* 下单方式手机AppMOBILE_APP微信小程序WECHAT_APPLET支付宝小程序ALI_PAY_APPLET
*/
private String orderChannel;
/**
* 健康咨询内容健康咨询类型的订单使用
*/
private String healthConsultationContent;
/**
* 健康咨询预约时间健康咨询订单使用
**/
@JsonFormat(pattern = "yyyy-MM-dd")
private Date healthAppointDate;
/**
* 健康咨询专家名称健康咨询类型的订单使用
*/
private String hospitalPersonName;
/**
* 科室人员头像地址
*/
private String personPictureUrl;
}

View File

@ -0,0 +1,103 @@
package com.xinelu.applet.vo.nursingorder;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.xinelu.common.core.domain.BaseDomain;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDate;
import java.time.LocalTime;
/**
* 个人中心订单Controller
*
* @author zhangheng
* @date 2022-09-06
*/
@EqualsAndHashCode(callSuper = true)
@Data
public class NursingOrderInfoVO extends BaseDomain implements Serializable {
private static final long serialVersionUID = -2337545308977415936L;
/**
* 预约订单编号
*/
private String orderNo;
/**
* 订单数量
*/
private Long orderCount;
/**
* 服务日期格式yyyy-MM-dd
*/
@JsonFormat(pattern = "yyyy-MM-dd")
private LocalDate serviceDate;
/**
* 服务开始时间格式HH:mm
*/
@JsonFormat(pattern = "HH:mm:ss")
private LocalTime serviceStartTime;
/**
* 服务结束时间格式HH:mm
*/
@JsonFormat(pattern = "HH:mm:ss")
private LocalTime serviceEndTime;
/**
* 预约订单状态代付款WAIT_PAY待派单WAIT_DISPATCH未完成NOT_FINISH服务完成COMPLETE
*/
private String orderStatus;
/**
* 预约状态0可以预约1不可以预约
*/
private Integer appointmentStatus;
/**
* 预约总价格单位
*/
private BigDecimal totalPrice;
/**
* 护理项目名称
*/
private String nurseItemName;
/**
* 护理项目价格
*/
private BigDecimal nurseItemPrice;
/**
* 是否删除标识01
*/
private Integer delFlag;
/**
* 提前预约时长单位小时
*/
private Integer advanceAppointDuration;
/**
* 护理站图片路径
*/
private String itemPictureUrl;
/**
* 护理站图片路径
*/
private String nurseStationName;
/**
* 服务时长和单位
*/
private String itemServeDurationUnit;
}

View File

@ -0,0 +1,208 @@
package com.xinelu.applet.vo.specialdisease;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.xinelu.manage.domain.appointmentorderconsumable.AppointmentOrderConsumable;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;
import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.LocalTime;
import java.util.List;
/**
* @Description 预约服务订单详情返回值实体类
* @Author 纪寒
* @Date 2022-11-11 14:48:01
* @Version 1.0
*/
@Data
public class AppointmentOrderDetailsInfoVO implements Serializable {
private static final long serialVersionUID = 7042842920314984169L;
/**
* 订单主表id
*/
private Long appointmentOrderId;
/**
* 会员id
*/
private Long patientId;
/**
* 护理项目id
*/
private Long nurseStationItemId;
/**
* 护理站名称
*/
private String nurseStationName;
/**
* 护理站头像
*/
private String stationPictureUrl;
/**
* 护理站地址
*/
private String address;
/**
* 护理站联系电话
*/
private String stationPhone;
/**
* 护理人联系电话
*/
private String patientPhone;
/**
* 服务项目名称
*/
private String nurseItemName;
/**
* 服务时长
*/
private String itemServeDurationUnit;
/**
* 护理人名称即会员名称
*/
private String patientName;
/**
* 服务地址
*/
private String serviceAddress;
/**
* 服务时间
*/
private LocalDate serviceDate;
/**
* 服务开始时间
*/
private LocalTime serviceStartTime;
/**
* 服务结束时间
*/
private LocalTime serviceEndTime;
/**
* 订单编号
*/
private String orderNo;
/**
* 备注信息
*/
private String remark;
/**
* 服务项目价格
*/
private BigDecimal nurseItemPrice;
/**
* 耗材总价格
*/
private BigDecimal consumableTotalPrice;
/**
* 订单总价格
*/
private String totalPrice;
/**
* 订单状态
*/
private String orderStatus;
/**
* 创建时间
*/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private LocalDateTime createTime;
/**
* 服务项目图片
*/
private String itemPictureUrl;
/**
* 预约订单耗材信息
*/
private List<AppointmentOrderConsumable> itemConsumableList;
/**
* 失能情况NOT_DISABLED未失能DISABLED已失能
*/
private String disablingCondition;
/**
* 失能原因
*/
private String disablingReason;
/**
* 订单类型院内陪护COMPANION_IN_HOSPITAL其它OTHER
*/
private String orderType;
/**
* 陪护开始时间院内陪护订单使用格式yyyy-MM-dd
*/
@JsonFormat(pattern = "yyyy-MM-dd")
@DateTimeFormat(pattern = "yyyy-MM-dd")
private LocalDate companionStartDate;
/**
* 陪护结束时间院内陪护订单使用格式yyyy-MM-dd
*/
@JsonFormat(pattern = "yyyy-MM-dd")
@DateTimeFormat(pattern = "yyyy-MM-dd")
private LocalDate companionEndDate;
/**
* 陪护天数院内陪护订单使用
*/
private Integer companionDays;
/**
* 订单填写人姓名院内陪护订单使用
*/
private String orderWriteName;
/**
* 护理人姓名院内陪护订单使用
*/
private String caregiverName;
/**
* 护理人电话院内陪护订单使用
*/
private String caregiverPhone;
/**
* 医院名称院内陪护订单使用
*/
private String hospitalName;
/**
* 科室名称院内陪护订单使用
*/
private String departmentName;
/**
* 病床号院内陪护订单使用
*/
private String hospitalBedNumber;
}

View File

@ -0,0 +1,334 @@
<?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.xinelu.applet.mapper.nursingorder.NursingOrderMapper">
<!-- 预约服务订单详情映射关系 -->
<resultMap id="getAppointmentDetailsResultMap"
type="com.xinelu.applet.vo.specialdisease.AppointmentOrderDetailsInfoVO">
<result property="patientId" column="patient_id"/>
<result property="appointmentOrderId" column="appointmentOrderId"/>
<result property="patientName" column="patient_name"/>
<result property="patientPhone" column="patientPhone"/>
<result property="orderNo" column="order_no"/>
<result property="totalPrice" column="total_price"/>
<result property="orderStatus" column="order_status"/>
<result property="remark" column="remark"/>
<result property="createTime" column="create_time"/>
<result property="nurseStationItemId" column="nurse_station_item_id"/>
<result property="serviceAddress" column="service_address"/>
<result property="serviceDate" column="service_date"/>
<result property="serviceStartTime" column="service_start_time"/>
<result property="serviceEndTime" column="service_end_time"/>
<result property="nurseItemName" column="nurse_item_name"/>
<result property="nurseItemPrice" column="nurse_item_price"/>
<result property="itemServeDurationUnit" column="item_serve_duration_unit"/>
<result property="consumableTotalPrice" column="consumable_total_price"/>
<result property="disablingCondition" column="disabling_condition"/>
<result property="disablingReason" column="disabling_reason"/>
<result property="orderType" column="order_type"/>
<result property="companionStartDate" column="companion_start_date"/>
<result property="companionEndDate" column="companion_end_date"/>
<result property="companionDays" column="companion_days"/>
<result property="orderWriteName" column="order_write_name"/>
<result property="caregiverName" column="caregiver_name"/>
<result property="caregiverPhone" column="caregiver_phone"/>
<result property="hospitalName" column="hospital_name"/>
<result property="departmentName" column="department_name"/>
<result property="hospitalBedNumber" column="hospital_bed_number"/>
<collection property="itemConsumableList" javaType="java.util.List"
resultMap="getAppointmentOrderConsumableResult"/>
</resultMap>
<!-- 预约服务耗材映射关系 -->
<resultMap type="com.xinelu.manage.domain.appointmentorderconsumable.AppointmentOrderConsumable"
id="getAppointmentOrderConsumableResult">
<result property="id" column="id"/>
<result property="appointOrderDetailsId" column="appoint_order_details_id"/>
<result property="orderConsumableName" column="order_consumable_name"/>
<result property="orderConsumablePrice" column="order_consumable_price"/>
<result property="orderConsumableCount" column="order_consumable_count"/>
<result property="consumableUnit" column="consumable_unit"/>
</resultMap>
<select id="getNursingOrderVOByPatientId" parameterType="long"
resultType="com.xinelu.applet.vo.nursingorder.NursingOrderInfoVO">
SELECT
aod.order_no,
aod.service_date,
aod.service_start_time,
aod.service_end_time,
aod.appointment_status,
aod.total_price,
aod.item_serve_duration_unit,
aod.nurse_item_name,
aod.order_status,
nsi.advance_appoint_duration,
nsi.item_picture_url,
ns.nurse_station_name
FROM
appointment_order_details aod
LEFT JOIN nurse_station_item nsi ON nsi.id = aod.nurse_station_item_id
LEFT JOIN nurse_station ns ON ns.id = nsi.nurse_station_id
LEFT JOIN appointment_order ao ON ao.order_no = aod.order_no
WHERE
aod.del_flag = 0 and ao.del_flag = 0
<if test="patientId != null">
AND ao.patient_id = #{patientId}
</if>
ORDER BY
aod.service_date DESC,
aod.service_start_time DESC
</select>
<select id="getGoodsOrder" parameterType="com.xinelu.applet.vo.nursingorder.AppletGoodsOrderVO"
resultType="com.xinelu.applet.vo.nursingorder.AppletGoodsOrderVO">
SELECT
gr.id goodsOrderId,
gr.nurse_station_id,
gr.patient_id,
gr.order_no goOrderNo,
gr.order_status,
gr.total_price,
gr.receiver,
gr.receive_address,
gr.phone,
gr.order_time,
gr.refund_type,
gr.refund_reason_dict_id,
gr.refund_reason_remark,
gr.confirm_refund_status,
gr.express_no,
gr.buy_source,
gr.order_type,
gr.original_total_price,
gr.order_channel,
gr.hospital_person_id,
gr.health_consultation_content,
gr.health_appoint_date,
god.integral_deduction_count,
god.id goodsOrderDetailsId,
god.order_no godOrderNo,
god.goods_name,
god.goods_count,
god.goods_attribute_name,
god.goods_attribute_content,
god.goods_price,
god.total_price godTotalPrice,
god.discount_price,
god.transport_price,
god.give_integral,
gad.attribute_piture_url,
gad.integral_exchange_flag,
god.integral_exchange_sill,
god.integral_exchange_count,
god.coupon_id,
god.coupon_title,
sdd.dict_label,
gr.update_time appleTime,
(select rf.success_time from refund_info rf where rf.order_no = gr.order_no) update_time,
IF( gr.order_type = 'HEALTH_CONSULTATION', ( SELECT person_picture_url FROM hospital_person_info WHERE id =
gr.hospital_person_id ), NULL ) person_picture_url,
gr.hospital_person_name
FROM
goods_order gr
LEFT JOIN goods_order_details god ON gr.id = god.goods_order_id
LEFT JOIN goods_attribute_details gad ON god.goods_attribute_details_id = gad.id
LEFT JOIN sys_dict_data sdd ON sdd.dict_code = gr.refund_reason_dict_id
<where>
<if test="patientId != null ">
and gr.patient_id = #{patientId}
</if>
<if test="orderStatus != null and orderStatus != ''">
and gr.order_status = #{orderStatus}
</if>
<if test="goodsName != null and goodsName != ''">
and god.goods_name like concat('%', #{goodsName}, '%')
</if>
<if test="goodsOrderId != null ">
and gr.id = #{goodsOrderId}
</if>
<if test="goOrderNo != null ">
and gr.order_no = #{goOrderNo}
</if>
<if test="orderType != null and orderType != ''">
and gr.order_type = #{orderType}
</if>
and gr.del_flag = 0
and god.del_flag = 0
</where>
ORDER BY gr.order_time DESC
</select>
<select id="getRefundReason" parameterType="com.xinelu.common.core.domain.entity.SysDictData"
resultType="com.xinelu.common.core.domain.entity.SysDictData">
SELECT
dict_code,
dict_sort,
dict_label,
dict_value,
dict_type
FROM
sys_dict_data
<where>
<if test="dictType != null and dictType != ''">
AND dict_type = #{dictType}
</if>
</where>
</select>
<update id="updateGoodsOrder" parameterType="com.xinelu.manage.domain.goodsOrder.GoodsOrder">
update goods_order
<trim prefix="SET" suffixOverrides=",">
<if test="nurseStationId != null">
nurse_station_id =
#{nurseStationId},
</if>
<if test="patientId != null">
patient_id =
#{patientId},
</if>
<if test="orderNo != null">
order_no =
#{orderNo},
</if>
<if test="orderStatus != null">
order_status =
#{orderStatus},
</if>
<if test="totalPrice != null">
total_price =
#{totalPrice},
</if>
<if test="receiver != null">
receiver =
#{receiver},
</if>
<if test="receiveAddress != null">
receive_address =
#{receiveAddress},
</if>
<if test="phone != null">
phone =
#{phone},
</if>
<if test="orderTime != null">
order_time =
#{orderTime},
</if>
<if test="orderChannel != null">
order_channel =
#{orderChannel},
</if>
<if test="buySource != null">
buy_source =
#{buySource},
</if>
<if test="remark != null">
remark =
#{remark},
</if>
<if test="delFlag != null">
del_flag =
#{delFlag},
</if>
<if test="createBy != null">
create_by =
#{createBy},
</if>
<if test="createTime != null">
create_time =
#{createTime},
</if>
<if test="updateBy != null">
update_by =
#{updateBy},
</if>
<if test="updateTime != null">
update_time =
#{updateTime},
</if>
<if test="refundType != null">
refund_type =
#{refundType},
</if>
<if test="refundReasonDictId != null">
refund_reason_dict_id =
#{refundReasonDictId},
</if>
<if test="refundReasonRemark != null">
refund_reason_remark =
#{refundReasonRemark},
</if>
<if test="confirmRefundStatus != null">
confirm_refund_status =
#{confirmRefundStatus},
</if>
</trim>
where id = #{id}
</update>
<select id="getAppointmentOrderDetailsInfo" resultMap="getAppointmentDetailsResultMap">
SELECT pi.patient_name,
pi.phone patientPhone,
aor.id appointmentOrderId,
aor.patient_id,
aor.order_no,
aor.total_price,
aor.order_status,
aor.remark,
aor.create_time,
aor.order_type,
aor.companion_start_date,
aor.companion_end_date,
aor.companion_days,
aor.order_write_name,
aod.nurse_station_item_id,
aod.service_address,
aod.service_date,
aod.service_start_time,
aod.service_end_time,
aod.nurse_item_name,
aod.nurse_item_price,
aod.item_serve_duration_unit,
aod.consumable_total_price,
aoc.id,
aoc.appoint_order_details_id,
aoc.order_consumable_name,
aoc.order_consumable_price,
aoc.order_consumable_count,
aoc.consumable_unit,
aod.disabling_condition,
aod.disabling_reason,
aod.caregiver_name,
aod.caregiver_phone,
aod.hospital_name,
aod.department_name,
aod.hospital_bed_number
FROM appointment_order aor
LEFT JOIN appointment_order_details aod ON aor.order_no = aod.order_no
LEFT JOIN appointment_order_consumable aoc ON aod.id = aoc.appoint_order_details_id
LEFT JOIN patient_info pi ON pi.id = aor.patient_id
where aor.order_no = #{ordeNo}
AND aor.del_flag = 0
and aod.del_flag = 0
</select>
<select id="getNurseStationByItemId"
resultType="com.xinelu.applet.vo.specialdisease.AppointmentOrderDetailsInfoVO">
SELECT ns.nurse_station_name nurseStationName,
ns.phone stationPhone,
ns.address,
ns.station_picture_url,
nsi.item_picture_url
FROM nurse_station_item nsi
LEFT JOIN nurse_station ns ON nsi.nurse_station_id = ns.id
WHERE nsi.id = #{nurseStationItemId}
</select>
</mapper>