|
@@ -18,20 +18,18 @@ import java.util.List;
|
|
|
@Mapper
|
|
|
public interface WxApiDao {
|
|
|
@Select("select rtrim(name) from mz_patient_mi with(nolock) where patient_id=#{patientId}")
|
|
|
- String selectPatientName(@Param("patientId") String patientId);
|
|
|
+ String selectPatientName(String patientId);
|
|
|
|
|
|
@Select("select * from t_wechat_pay_order with(nolock) where patient_id=#{patientId} " +
|
|
|
"and mzy_request_id=#{mzyRequestId} and cashpay_amt=#{cost} ")
|
|
|
- WxPayOrder selectSameGhOrder(@Param("patientId") String patientId,
|
|
|
- @Param("mzyRequestId") Integer mzyRequestId,
|
|
|
- @Param("cost") BigDecimal cost);
|
|
|
+ WxPayOrder selectSameGhOrder(String patientId, Integer mzyRequestId, BigDecimal cost);
|
|
|
|
|
|
@Select("select top 1 * from t_wechat_pay_order with(nolock) where his_ord_num=#{hisOrdNum} " +
|
|
|
"and cashpay_amt=#{cost} order by create_datetime desc")
|
|
|
- WxPayOrder selectSameMzPayOrder(@Param("hisOrdNum") String hisOrdNum, @Param("cost") BigDecimal cost);
|
|
|
+ WxPayOrder selectSameMzPayOrder(String hisOrdNum, BigDecimal cost);
|
|
|
|
|
|
@Select("select count(1) from mzy_reqrec WITH(NOLOCK) where psordnum=#{tradeNo} and cancel_mark=0")
|
|
|
- int alreadyPaidRegisterFee(@Param("tradeNo") String tradeNo);
|
|
|
+ int alreadyPaidRegisterFee(String tradeNo);
|
|
|
|
|
|
@Insert("insert into t_wechat_pay_order (body,openid,total_fee,patient_id," +
|
|
|
"patient_name,inpatient_no,admiss_times,app_id,mch_id,prepay_id," +
|
|
@@ -54,71 +52,73 @@ public interface WxApiDao {
|
|
|
|
|
|
@Update("update t_wechat_pay_order set trade_state=#{tradeState}, pay_datetime=#{successTime}, " +
|
|
|
"query_state_times=(query_state_times+1),last_query_state=getdate() where trade_no=#{tradeNo}")
|
|
|
- void updatePayStatusAndPayTime(@Param("tradeNo") String tradeNo,
|
|
|
- @Param("tradeState") Transaction.TradeStateEnum tradeState,
|
|
|
- @Param("successTime") String successTime);
|
|
|
+ void updatePayStatusAndPayTime(String tradeNo,
|
|
|
+ Transaction.TradeStateEnum tradeState,
|
|
|
+ String successTime);
|
|
|
|
|
|
@Update("update t_wechat_pay_order set trade_state=#{tradeState},pay_datetime=#{successTime},openid=#{openid}, " +
|
|
|
"query_state_times=(query_state_times+1),last_query_state=getdate() where trade_no=#{tradeNo}")
|
|
|
- void updatePayStatusAndPayTimeAndOpenid(@Param("tradeNo") String tradeNo,
|
|
|
- @Param("tradeState") Transaction.TradeStateEnum tradeState,
|
|
|
- @Param("successTime") String successTime,
|
|
|
- @Param("openid") String openid);
|
|
|
+ void updatePayStatusAndPayTimeAndOpenid(String tradeNo,
|
|
|
+ Transaction.TradeStateEnum tradeState,
|
|
|
+ String successTime,
|
|
|
+ String openid);
|
|
|
|
|
|
@Update("update t_wechat_pay_order set trade_state=#{tradeState},query_state_times=(query_state_times+1), " +
|
|
|
"last_query_state=getdate() where trade_no=#{tradeNo}")
|
|
|
- void updatePayStatusAndQueryTimes(@Param("tradeNo") String tradeNo,
|
|
|
- @Param("tradeState") Transaction.TradeStateEnum tradeState);
|
|
|
+ void updatePayStatusAndQueryTimes(String tradeNo,
|
|
|
+ Transaction.TradeStateEnum tradeState);
|
|
|
|
|
|
@Update("update t_wechat_pay_order set trade_state=#{tradeState},query_state_times=(query_state_times+1), " +
|
|
|
"openid=#{openid},last_query_state=getdate() where trade_no=#{tradeNo}")
|
|
|
- void updatePayStatusAndQueryTimesAndOpenid(@Param("tradeNo") String tradeNo,
|
|
|
- @Param("tradeState") Transaction.TradeStateEnum tradeState,
|
|
|
- @Param("openid") String openid);
|
|
|
+ void updatePayStatusAndQueryTimesAndOpenid(String tradeNo,
|
|
|
+ Transaction.TradeStateEnum tradeState,
|
|
|
+ String openid);
|
|
|
|
|
|
@Update("update t_wechat_pay_order set trade_state=#{tradeState} where trade_no=#{tradeNo}")
|
|
|
- void updatePayStatusOnly(@Param("tradeNo") String tradeNo, @Param("tradeState") Transaction.TradeStateEnum tradeState);
|
|
|
+ void updatePayStatusOnly(String tradeNo, Transaction.TradeStateEnum tradeState);
|
|
|
|
|
|
@Select("select count(1) from mz_deposit_file WITH(NOLOCK) where psordnum=#{tradeNo} and pay_mark=0")
|
|
|
- int alreadyPayed(@Param("tradeNo") String tradeNo);
|
|
|
+ int alreadyPayed(String tradeNo);
|
|
|
|
|
|
@Select("select trade_state as tradeState,refund_id as name from t_wechat_pay_order where trade_no=#{tradeNo} ")
|
|
|
- PureCodeName selectPayStatus(@Param("tradeNo") String tradeNo);
|
|
|
+ PureCodeName selectPayStatus(String tradeNo);
|
|
|
|
|
|
@Update("update t_wechat_pay_order set trade_state='REFUND',refund_op_code='99999'," +
|
|
|
"refund_reason=#{reason},his_status=0,refund_op_datetime=getdate() " +
|
|
|
"where trade_no=#{tradeNo}")
|
|
|
- void refundOrder(@Param("tradeNo") String tradeNo, @Param("reason") String reason);
|
|
|
+ void refundOrder(String tradeNo, String reason);
|
|
|
|
|
|
@Update("update t_wechat_pay_order set trade_state='REFUND' where trade_no=#{tradeNo}")
|
|
|
- void updateRefundStatus(@Param("tradeNo") String tradeNo);
|
|
|
+ void updateRefundStatus(String tradeNo);
|
|
|
|
|
|
@Update("update t_wechat_pay_order set his_status=1 where trade_no=#{tradeNo}")
|
|
|
- void updateSuccessHisStatus(@Param("tradeNo") String tradeNo);
|
|
|
+ void updateSuccessHisStatus(String tradeNo);
|
|
|
|
|
|
@Update("update t_patient_coupons set coupon_state='USED' where id=#{id}")
|
|
|
void couponUsed(String id);
|
|
|
|
|
|
@Select("select datediff(day,getdate(),request_day) as dateDiff, " +
|
|
|
"rtrim(unit_code) as unitCode from mzy_reqrec where psordnum=#{tradeNo}")
|
|
|
- HisRegister selectRegisterDateDiff(@Param("tradeNo") String tradeNo);
|
|
|
+ HisRegister selectRegisterDateDiff(String tradeNo);
|
|
|
|
|
|
@Select("select count(1) from mz_deposit_file where psordnum=#{tradeNo} and cheque_type='2'")
|
|
|
- int selectFundPayCount(@Param("tradeNo") String tradeNo);
|
|
|
+ int selectFundPayCount(String tradeNo);
|
|
|
|
|
|
@Select("select * from t_wechat_pay_order with(nolock) where trade_no=#{tradeNo}")
|
|
|
- WxPayOrder selectOrderByTradeNo(@Param("tradeNo") String tradeNo);
|
|
|
+ WxPayOrder selectOrderByTradeNo(String tradeNo);
|
|
|
|
|
|
- @Select("select trade_no, query_state_times,offset=datediff(minute,create_datetime,last_query_state) " +
|
|
|
- "from t_wechat_pay_order with(nolock) where his_status=0 and order_type<=3 and openid!='' " +
|
|
|
+ @Select("select trade_no, query_state_times, " +
|
|
|
+ "offset=datediff(minute,create_datetime,last_query_state) " +
|
|
|
+ "from t_wechat_pay_order with(nolock) where his_status=0 " +
|
|
|
+ "and order_type in (1,2,3,5) and openid!='' and sgl_check_notified=0 " +
|
|
|
"and trade_state in ('NOTPAY','ACCEPT','USERPAYING','PAYERROR') ")
|
|
|
List<TradeNo> selectTradeNosForScheduleTask();
|
|
|
|
|
|
@Select("select openid from t_wechat_patient_bind with(nolock) where patient_id=#{cardNo} and del_flag=0")
|
|
|
- List<String> selectOpenidByPatientId(@Param("cardNo") String cardNo);
|
|
|
+ List<String> selectOpenidByPatientId(String cardNo);
|
|
|
|
|
|
@Select("select openid from t_wechat_patient_bind with(nolock) where ic_card_no=#{cardNo} and del_flag=0")
|
|
|
- List<String> selectOpenidByIcCardNo(@Param("cardNo") String cardNo);
|
|
|
+ List<String> selectOpenidByIcCardNo(String cardNo);
|
|
|
|
|
|
@Select("select rtrim(a.code) doctorCode,rtrim(a.name) doctorName,rtrim(b.name) doctorTitle,rtrim(a.dept_code) deptCode, " +
|
|
|
"deptName=(select rtrim(name) from zd_unit_code with(nolock) where code=a.dept_code), " +
|
|
@@ -126,14 +126,14 @@ public interface WxApiDao {
|
|
|
"from a_employee_mi a with(nolock), zd_emp_title b with(nolock) " +
|
|
|
"where a.code=#{doctorCode} and a.emp_tit_code=b.code and " +
|
|
|
"a.code not in ('00000', '00026') and isnull(a.del_flag,0)<>1")
|
|
|
- DoctorInfo selectDoctorInfo(@Param("doctorCode") String doctorCode);
|
|
|
+ DoctorInfo selectDoctorInfo(String doctorCode);
|
|
|
|
|
|
@Select("select trade_no from t_wechat_pay_order where his_ord_num=#{hisOrdNum} " +
|
|
|
"and trade_state not in ('SUCCESS','CLOSED')")
|
|
|
- List<String> selectTradeNoByHisOrdNum(@Param("hisOrdNum") String hisOrdNum);
|
|
|
+ List<String> selectTradeNoByHisOrdNum(String hisOrdNum);
|
|
|
|
|
|
@Select("select trade_state from t_wechat_pay_order with(nolock) where trade_no=#{tradeNo}")
|
|
|
- Transaction.TradeStateEnum selectOrderStatus(@Param("tradeNo") String tradeNo);
|
|
|
+ Transaction.TradeStateEnum selectOrderStatus(String tradeNo);
|
|
|
|
|
|
@Update("update t_wechat_pay_order set refund_id=#{refundId}, refund_op_code=#{refundOpCode}, his_status=0, " +
|
|
|
"refund_op_datetime=#{refundOpDatetime}, refund_reason=#{refundReason}, trade_state='REFUND' where trade_no=#{tradeNo}")
|
|
@@ -143,12 +143,15 @@ public interface WxApiDao {
|
|
|
void deleteOrder(String tradeNo);
|
|
|
|
|
|
@Update("update t_wechat_pay_order set trade_state='REFUND', refund_reason=#{msg}, his_status=0 where trade_no=#{tradeNo}")
|
|
|
- void alreadyRefund(@Param("tradeNo") String tradeNo, @Param("msg") String msg);
|
|
|
+ void alreadyRefund(String tradeNo, String msg);
|
|
|
|
|
|
@Update("update t_si_setlinfo set mz_saved=1 where pat_no=#{patId} and times=#{times} and revoked=0")
|
|
|
- void updateMzSavedFlag(@Param("patId") String patId, @Param("times") String times);
|
|
|
+ void updateMzSavedFlag(String patId, String times);
|
|
|
|
|
|
@Select("select medfee_sumamt,fund_pay_sumamt,acct_pay,psn_cash_pay " +
|
|
|
"from t_si_presetlinfo where pat_no=#{patNo} and times=#{times}")
|
|
|
- MedinsPresettle selectPreSetlinfo(@Param("patNo") String patNo, @Param("times") String times);
|
|
|
+ MedinsPresettle selectPreSetlinfo(String patNo, String times);
|
|
|
+
|
|
|
+ @Update("update t_wechat_pay_order set sgl_check_notified=1 where trade_no=#{tradeNo}")
|
|
|
+ void updateCytjNotified(String tradeNo);
|
|
|
}
|