1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283 |
- 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 * from t_wechat_pay_order with(nolock) where his_ord_num=#{hisOrdNum}")
- WxPayOrder selectSameMzPayOrder(@Param("hisOrdNum") String hisOrdNum);
- @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},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} where trade_no=#{tradeNo}")
- void updatePayStatusOnly(@Param("tradeNo") String tradeNo, @Param("status") Integer status);
- @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 his_status=1,pay_status=1 where trade_no=#{tradeNo}")
- void updateSuccessHisStatus(@Param("tradeNo") String tradeNo);
- @Update("update t_wechat_pay_order set open_id=#{openId} where trade_no=#{tradeNo}")
- void updatePayOpenId(@Param("tradeNo") String tradeNo,
- @Param("openId") String openId);
- @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 from t_wechat_pay_order with(nolock) where his_status=#{status} " +
- "and order_type<=3 and pay_status in (99, 0, 5, 6, 100) ")
- List<TradeNo> selectTradeNosForScheduleTask(@Param("status") int status);
- @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);
- }
|