package com.hx.phip.tool.order; import com.hx.common.service.CommonService; import com.hx.mybatisTool.SqlSentence; import com.hx.phiappt.model.consume.ConsumePayItem; import com.hx.phiappt.model.order.OrdersTotal; import com.hx.phiappt.model.userMoney.UserMoneyUnclaimed; import com.hx.phip.dao.mapper.ConsumePayItemMapper; import com.hx.phip.dao.mapper.UserMoneyUnclaimedMapper; import java.util.HashMap; import java.util.List; import java.util.Map; /**订单工具类 * @author CJH*/ public class OrderTool { /**获取一级子单的支付方式 * @param orderOneId 子单标识 * @param commonService 医生 * @return 支付方式集合 */ public static List getOrderOnePay(String orderOneId, CommonService commonService){ SqlSentence sqlSentence = new SqlSentence(); Map values = new HashMap<>(); values.put("typeId",orderOneId); sqlSentence.sqlSentence("SELECT * FROM consume_pay_item WHERE isDel = 0 AND typeId = #{m.typeId}",values); return commonService.selectList(ConsumePayItemMapper.class,sqlSentence); } /**获取活动赠送资金奖励记录*/ public static UserMoneyUnclaimed getActivityGive(OrdersTotal ordersTotal, CommonService commonService){ //查找领取记录释放存在 //领取记录是否已领取 SqlSentence sqlSentence = new SqlSentence(); Map values = new HashMap<>(); values.put("orderId",ordersTotal.getId()); values.put("commonId",ordersTotal.getActivityPageCode()); sqlSentence.sqlSentence("SELECT * FROM user_money_unclaimed WHERE isDel = 0 AND orderId = #{m.orderId} AND commonId = #{m.commonId}",values); return commonService.selectOne(UserMoneyUnclaimedMapper.class,sqlSentence); } /**获取用户活动赠送资金奖励记录-有效*/ public static List getActivityGive(String userId,String commonId, CommonService commonService){ //查找领取记录释放存在 //领取记录是否已领取 SqlSentence sqlSentence = new SqlSentence(); Map values = new HashMap<>(); values.put("userId",userId); values.put("commonId",commonId); sqlSentence.sqlSentence("SELECT * FROM user_money_unclaimed WHERE isDel = 0 AND isValid = 1 AND userId = #{m.userId} AND commonId = #{m.commonId}",values); return commonService.selectList(UserMoneyUnclaimedMapper.class,sqlSentence); } }