123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113 |
- package thyyxxk.wxservice_server.dao;
- import org.apache.ibatis.annotations.*;
- import thyyxxk.wxservice_server.entity.appointment.DoctorInfo;
- import thyyxxk.wxservice_server.entity.scheduled.TradeNo;
- import thyyxxk.wxservice_server.entity.wxapi.WxPayOrder;
- import java.util.List;
- /**
- * @author dj
- */
- @Mapper
- public interface WxApiDao {
- @Select("select rtrim(name) from mz_patient_mi with(nolock) where patient_id=#{patientId}")
- String selectPatientName(@Param("patientId") String patientId);
- @Select("select * from t_wechat_pay_order with(nolock) where patient_id=#{patientId} and " +
- "mzy_request_id=#{mzyRequestId} ")
- WxPayOrder selectSameGhOrder(@Param("patientId") String patientId,
- @Param("mzyRequestId") Integer mzyRequestId);
- @Select("select top 1 * from t_wechat_pay_order with(nolock) where his_ord_num=#{hisOrdNum} " +
- "and total_fee=#{cost} order by create_datetime desc")
- WxPayOrder selectSameMzPayOrder(@Param("hisOrdNum") String hisOrdNum, @Param("cost") double cost);
- @Select("select count(1) from mzy_reqrec WITH(NOLOCK) where psordnum=#{tradeNo} and cancel_mark=0")
- int alreadyPaidRegisterFee(@Param("tradeNo") String tradeNo);
- @Insert("insert into t_wechat_pay_order (body,open_id,total_fee,patient_id," +
- "patient_name,inpatient_no,admiss_times,app_id,mch_id,prepay_id," +
- "time_stamp,trade_no,create_order_sign,pay_sign,spbill_create_ip," +
- "create_datetime,pay_status,serial_no,order_type,his_ord_num," +
- "mzy_request_id,yj_req_no,his_status,query_state_times) " +
- "values (#{body},#{openId},#{totalFee},#{patientId},#{patientName},#{inpatientNo}," +
- "#{admissTimes},#{appId},#{mchId},#{prepayId},#{timeStamp},#{tradeNo},#{createOrderSign}," +
- "#{paySign},#{spbillCreateIp},#{createDatetime},#{payStatus},#{serialNo},#{orderType}," +
- "#{hisOrdNum},#{mzyRequestId},#{yjReqNo},0,0)")
- void insertNewOrder(WxPayOrder param);
- @Update("update t_wechat_pay_order set pay_status=#{status}, 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("status") Integer status,
- @Param("successTime") String successTime);
- @Update("update t_wechat_pay_order set pay_status=#{status},pay_datetime=#{successTime},open_id=#{openId}, " +
- "query_state_times=(query_state_times+1),last_query_state=getdate() where trade_no=#{tradeNo}")
- void updatePayStatusAndPayTimeAndOpenId(@Param("tradeNo") String tradeNo, @Param("status") Integer status,
- @Param("successTime") String successTime, @Param("openId") String openId);
- @Update("update t_wechat_pay_order set pay_status=#{status},query_state_times=(query_state_times+1), " +
- "last_query_state=getdate() where trade_no=#{tradeNo}")
- void updatePayStatusAndQueryTimes(@Param("tradeNo") String tradeNo, @Param("status") Integer status);
- @Update("update t_wechat_pay_order set pay_status=#{status},query_state_times=(query_state_times+1), " +
- "open_id=#{openId},last_query_state=getdate() where trade_no=#{tradeNo}")
- void updatePayStatusAndQueryTimesAndOpenId(@Param("tradeNo") String tradeNo,
- @Param("status") Integer status,
- @Param("openId") String openId);
- @Update("update t_wechat_pay_order set pay_status=#{status} where trade_no=#{tradeNo}")
- void updatePayStatusOnly(@Param("tradeNo") String tradeNo, @Param("status") Integer status);
- @Select("select count(1) from mz_deposit_file WITH(NOLOCK) where psordnum=#{tradeNo} and pay_mark=0")
- int alreadyPayed(@Param("tradeNo") String tradeNo);
- @Select("select pay_status from t_wechat_pay_order where trade_no=#{tradeNo} ")
- Integer selectPayStatus(@Param("tradeNo") String tradeNo);
- @Update("update t_wechat_pay_order set pay_status=4,refund_op_code='99999',refund_reason=#{rea}, " +
- "his_status=0,refund_op_datetime=getdate() where trade_no=#{tradeNo}")
- void refundOrder(@Param("tradeNo") String tradeNo, @Param("rea") String rea);
- @Update("update t_wechat_pay_order set pay_status=4 where trade_no=#{tradeNo}")
- void updateRefundStatus(@Param("tradeNo") String tradeNo);
- @Update("update t_wechat_pay_order set his_status=1 where trade_no=#{tradeNo}")
- void updateSuccessHisStatus(@Param("tradeNo") String tradeNo);
- @Select("select * from t_wechat_pay_order with(nolock) where trade_no=#{tradeNo}")
- WxPayOrder selectOrderByTradeNo(@Param("tradeNo") 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 open_id!='' " +
- "and pay_status in (99, 0, 5, 6, 100) ")
- List<TradeNo> selectTradeNosForScheduleTask();
- @Select("select open_id from t_wechat_patient_bind with(nolock) where patient_id=#{cardNo} and del_flag=0")
- List<String> selectOpenIdByPatientId(@Param("cardNo") String cardNo);
- @Select("select open_id from t_wechat_patient_bind with(nolock) where ic_card_no=#{cardNo} and del_flag=0")
- List<String> selectOpenIdByIcCardNo(@Param("cardNo") 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), " +
- "a.specialty,a.introduction,a.portrait " +
- "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);
- @Select("select pay_status from t_wechat_pay_order with(nolock) where trade_no=#{tradeNo}")
- Integer selectOrderStatus(@Param("tradeNo") 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}, pay_status=4 where trade_no=#{tradeNo}")
- void updateRefundId(WxPayOrder order);
- @Update("update t_wechat_pay_order set pay_status=4, refund_reason=#{msg}, his_status=0 where trade_no=#{tradeNo}")
- void alreadyRefund(@Param("tradeNo") String tradeNo, @Param("msg") 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);
- }
|