Fix Bug #506: fallback修复
This commit is contained in:
@@ -49,35 +49,65 @@ public interface OrderMapper {
|
|||||||
* **新增**:查询医嘱详情并返回总量单位。
|
* **新增**:查询医嘱详情并返回总量单位。
|
||||||
*/
|
*/
|
||||||
@Select("SELECT o.*, d.total_unit FROM his_order o " +
|
@Select("SELECT o.*, d.total_unit FROM his_order o " +
|
||||||
"LEFT JOIN his_order_detail d ON o.id = d.order_id " +
|
"LEFT JOIN diagnosis_detail d ON o.diagnosis_detail_id = d.id " +
|
||||||
"WHERE o.id = #{orderId}")
|
"WHERE o.id = #{orderId}")
|
||||||
Map<String, Object> selectOrderDetailById(@Param("orderId") Long orderId);
|
Map<String, Object> selectOrderDetailById(@Param("orderId") Long orderId);
|
||||||
|
|
||||||
/**
|
|
||||||
* **新增**:将医嘱状态更新为已取消(CANCELLED)。
|
|
||||||
*/
|
|
||||||
@Update("UPDATE his_order SET status = #{status} WHERE id = #{orderId}")
|
|
||||||
int updateOrderStatusToCancelled(@Param("orderId") Long orderId,
|
|
||||||
@Param("status") String status);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* **新增**:将医嘱状态更新为已支付(PAID)。
|
* **新增**:将医嘱状态更新为已支付(PAID)。
|
||||||
|
*
|
||||||
|
* @param orderId 医嘱ID
|
||||||
|
* @param status 新状态码,建议使用 {@link #ORDER_STATUS_PAID}
|
||||||
|
* @return 受影响的行数
|
||||||
*/
|
*/
|
||||||
@Update("UPDATE his_order SET status = #{status} WHERE id = #{orderId}")
|
@Update("UPDATE his_order SET status = #{status} WHERE id = #{orderId}")
|
||||||
int updateOrderStatusToPaid(@Param("orderId") Long orderId,
|
int updateOrderStatusToPaid(@Param("orderId") Long orderId,
|
||||||
@Param("status") String status);
|
@Param("status") String status);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* **新增**:分页查询待写病历记录,仅返回前端需要的字段。
|
* **新增**:将医嘱状态更新为取消(CANCELLED),用于门诊诊前退号。
|
||||||
|
*
|
||||||
|
* @param orderId 医嘱ID
|
||||||
|
* @param status 新状态码,建议使用 {@link #ORDER_STATUS_CANCELLED}
|
||||||
|
* @return 受影响的行数
|
||||||
*/
|
*/
|
||||||
@Select("<script>" +
|
@Update("UPDATE his_order SET status = #{status} WHERE id = #{orderId}")
|
||||||
"SELECT mr.id, mr.patient_name AS patientName, mr.visit_no AS visitNo, " +
|
int updateOrderStatusToCancelled(@Param("orderId") Long orderId,
|
||||||
"mr.status, mr.create_time AS createTime " +
|
@Param("status") String status);
|
||||||
"FROM medical_record mr " +
|
|
||||||
"WHERE mr.status = 'PENDING' " +
|
/**
|
||||||
"ORDER BY mr.create_time DESC " +
|
* 批量更新医嘱状态(通用),保留原有业务使用。
|
||||||
"LIMIT #{offset}, #{pageSize}" +
|
*
|
||||||
"</script>")
|
* @param orderIds 医嘱ID集合
|
||||||
List<Map<String, Object>> selectPendingMedicalRecords(@Param("offset") int offset,
|
* @param status 目标状态码
|
||||||
@Param("pageSize") int pageSize);
|
* @return 受影响的行数
|
||||||
|
*/
|
||||||
|
@Update({
|
||||||
|
"<script>",
|
||||||
|
"UPDATE his_order",
|
||||||
|
"SET status = #{status}",
|
||||||
|
"WHERE id IN",
|
||||||
|
"<foreach item='id' collection='orderIds' open='(' separator=',' close=')'>",
|
||||||
|
"#{id}",
|
||||||
|
"</foreach>",
|
||||||
|
"</script>"
|
||||||
|
})
|
||||||
|
int batchUpdateOrderStatus(@Param("orderIds") List<Long> orderIds,
|
||||||
|
@Param("status") String status);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页查询待写病历的医嘱(仅返回前端需要的字段),用于提升查询性能。
|
||||||
|
*
|
||||||
|
* @param doctorId 医生ID
|
||||||
|
* @param offset 起始行
|
||||||
|
* @param limit 每页行数
|
||||||
|
* @return 医嘱列表
|
||||||
|
*/
|
||||||
|
@Select("SELECT id, item_name AS itemName, total_quantity AS totalQuantity, " +
|
||||||
|
"total_unit AS totalUnit, status FROM his_order " +
|
||||||
|
"WHERE doctor_id = #{doctorId} AND status = 'PENDING' " +
|
||||||
|
"ORDER BY create_time DESC LIMIT #{limit} OFFSET #{offset}")
|
||||||
|
List<Map<String, Object>> selectPendingMedicalRecords(@Param("doctorId") Long doctorId,
|
||||||
|
@Param("offset") int offset,
|
||||||
|
@Param("limit") int limit);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user