chenjiahe
2024-03-01 cfedbfad423aa6fd758da748967122819b1787e2
提交 | 用户 | age
78d1e8 1 package com.hx.phip.tool.order;
C 2
3 import com.hx.common.service.CommonService;
4 import com.hx.mybatisTool.SqlSentence;
5 import com.hx.phiappt.model.consume.ConsumePayItem;
d3fb23 6 import com.hx.phiappt.model.order.OrdersTotal;
C 7 import com.hx.phiappt.model.userMoney.UserMoneyUnclaimed;
78d1e8 8 import com.hx.phip.dao.mapper.ConsumePayItemMapper;
d3fb23 9 import com.hx.phip.dao.mapper.UserMoneyUnclaimedMapper;
78d1e8 10
C 11 import java.util.HashMap;
12 import java.util.List;
13 import java.util.Map;
14
d3fb23 15 /**订单工具类
C 16  * @author CJH*/
78d1e8 17 public class OrderTool {
C 18
19     /**获取一级子单的支付方式
20      * @param orderOneId 子单标识
21      * @param commonService 医生
22      * @return 支付方式集合
23      */
24     public static List<ConsumePayItem> getOrderOnePay(String orderOneId, CommonService commonService){
25         SqlSentence sqlSentence = new SqlSentence();
26         Map<String,Object> values = new HashMap<>();
27
28         values.put("typeId",orderOneId);
29         sqlSentence.sqlSentence("SELECT * FROM consume_pay_item WHERE isDel = 0 AND typeId = #{m.typeId}",values);
30         return commonService.selectList(ConsumePayItemMapper.class,sqlSentence);
31     }
32
d3fb23 33     /**获取活动赠送资金奖励记录*/
C 34     public static UserMoneyUnclaimed getActivityGive(OrdersTotal ordersTotal, CommonService commonService){
35         //查找领取记录释放存在
36         //领取记录是否已领取
37         SqlSentence sqlSentence = new SqlSentence();
38         Map<String,Object> values = new HashMap<>();
39
40         values.put("orderId",ordersTotal.getId());
41         values.put("commonId",ordersTotal.getActivityPageCode());
42         sqlSentence.sqlSentence("SELECT * FROM user_money_unclaimed WHERE isDel = 0 AND orderId = #{m.orderId} AND commonId = #{m.commonId}",values);
43         return commonService.selectOne(UserMoneyUnclaimedMapper.class,sqlSentence);
44     }
45
cfedbf 46     /**获取用户活动赠送资金奖励记录-有效*/
C 47     public static List<UserMoneyUnclaimed> getActivityGive(String userId,String commonId, CommonService commonService){
48         //查找领取记录释放存在
49         //领取记录是否已领取
50         SqlSentence sqlSentence = new SqlSentence();
51         Map<String,Object> values = new HashMap<>();
52
53         values.put("userId",userId);
54         values.put("commonId",commonId);
55         sqlSentence.sqlSentence("SELECT * FROM user_money_unclaimed WHERE isDel = 0 AND isValid = 1 AND userId = #{m.userId} AND commonId = #{m.commonId}",values);
56         return commonService.selectList(UserMoneyUnclaimedMapper.class,sqlSentence);
57     }
58
78d1e8 59
C 60 }