|
@@ -471,15 +471,22 @@ public interface YiZhuLuRuDao {
|
|
|
* @param orderNo 医嘱号
|
|
|
* @return 数据
|
|
|
*/
|
|
|
- @Select("select rtrim(status_flag) status_flag, order_name, act_order_no,frequ_code " +
|
|
|
+ @Select("select rtrim(status_flag) status_flag,order_name, act_order_no,frequ_code " +
|
|
|
"from yz_act_order with (NOLOCK) " +
|
|
|
"where inpatient_no = #{patNo} " +
|
|
|
" and admiss_times = #{times} " +
|
|
|
- " and status_flag in (1, 2)" +
|
|
|
- " and act_order_no <> #{orderNo}")
|
|
|
- List<XinZhenYzActOrder> thereAreUnexecutedOrders(String patNo,
|
|
|
- Integer times,
|
|
|
- BigDecimal orderNo);
|
|
|
+ " and status_flag in ('1', '2')" +
|
|
|
+ " and act_order_no <> #{orderNo} " +
|
|
|
+ " and frequ_code = N'ONCE'" +
|
|
|
+ " union all " +
|
|
|
+ "select rtrim(status_flag) status_flag,order_name, act_order_no,frequ_code " +
|
|
|
+ "from yz_act_order with (NOLOCK) " +
|
|
|
+ "where inpatient_no = #{patNo} " +
|
|
|
+ " and admiss_times = #{times} " +
|
|
|
+ " and status_flag in ('1') " +
|
|
|
+ " and act_order_no <> #{orderNo} " +
|
|
|
+ " and frequ_code <> N'ONCE' ")
|
|
|
+ List<XinZhenYzActOrder> thereAreUnexecutedOrders(String patNo, Integer times, BigDecimal orderNo);
|
|
|
|
|
|
@Select("select count(1) " +
|
|
|
"from yz_act_order " +
|
|
@@ -497,13 +504,14 @@ public interface YiZhuLuRuDao {
|
|
|
@Update("update yz_act_order " +
|
|
|
"set modifier = #{userCode}, " +
|
|
|
" end_time = #{date}, " +
|
|
|
- " exclu_act_order_no = #{orderNo} " +
|
|
|
+ " exclu_act_order_no = #{orderNo}, " +
|
|
|
+ " status_flag = '5' " +
|
|
|
"where inpatient_no = #{patNo} " +
|
|
|
" and admiss_times = #{times} " +
|
|
|
- " and status_flag in ('3', '4') " +
|
|
|
+ " and status_flag in ('2','3','4') " +
|
|
|
" and frequ_code != 'ONCE' " +
|
|
|
- " and act_order_no <> #{orderNo} " +
|
|
|
- " AND (end_time IS NULL or end_time < #{date}) ")
|
|
|
+ " and act_order_no <> #{orderNo}" +
|
|
|
+ " and (end_time > #{date} or end_time is null )")
|
|
|
void stopOrder(String patNo, Integer times, Date date, String userCode, BigDecimal orderNo);
|
|
|
|
|
|
@Update("update yz_act_order " +
|