public int baseUpdateMchNotifySuccess(String orderId, String result, byte notifyCount) { MchNotify mchNotify = new MchNotify(); mchNotify.setStatus(PayConstant.MCH_NOTIFY_STATUS_SUCCESS); mchNotify.setResult(result); mchNotify.setNotifyCount(notifyCount); mchNotify.setLastNotifyTime(new Date()); MchNotifyExample example = new MchNotifyExample(); MchNotifyExample.Criteria criteria = example.createCriteria(); criteria.andOrderIdEqualTo(orderId); List values = new LinkedList<>(); values.add(PayConstant.MCH_NOTIFY_STATUS_NOTIFYING); values.add(PayConstant.MCH_NOTIFY_STATUS_FAIL); criteria.andStatusIn(values); return mchNotifyMapper.updateByExampleSelective(mchNotify, example); }
void setCriteria(MchNotifyExample.Criteria criteria, MchNotify mchNotify) { if(mchNotify != null) { if(StringUtils.isNotBlank(mchNotify.getMchId())) criteria.andMchIdEqualTo(mchNotify.getMchId()); if(StringUtils.isNotBlank(mchNotify.getOrderId())) criteria.andOrderIdEqualTo(mchNotify.getOrderId()); if(StringUtils.isNotBlank(mchNotify.getOrderType())) criteria.andOrderTypeEqualTo(mchNotify.getOrderType()); if(StringUtils.isNotBlank(mchNotify.getMchOrderNo())) criteria.andMchOrderNoEqualTo(mchNotify.getMchOrderNo()); if(mchNotify.getStatus() != null && mchNotify.getStatus() != -99) criteria.andStatusEqualTo(mchNotify.getStatus()); } }
public int baseUpdateMchNotifyFail(String orderId, String result, byte notifyCount) { MchNotify mchNotify = new MchNotify(); mchNotify.setStatus(PayConstant.MCH_NOTIFY_STATUS_FAIL); mchNotify.setResult(result); mchNotify.setNotifyCount(notifyCount); mchNotify.setLastNotifyTime(new Date()); MchNotifyExample example = new MchNotifyExample(); MchNotifyExample.Criteria criteria = example.createCriteria(); criteria.andOrderIdEqualTo(orderId); List values = new LinkedList<>(); values.add(PayConstant.MCH_NOTIFY_STATUS_NOTIFYING); values.add(PayConstant.MCH_NOTIFY_STATUS_FAIL); return mchNotifyMapper.updateByExampleSelective(mchNotify, example); }
protected Criteria createCriteriaInternal() { Criteria criteria = new Criteria(); return criteria; }