|
|
@@ -1,9 +1,16 @@
|
|
|
package com.zhongshu.payment.server.core.dao.impl;
|
|
|
|
|
|
+import com.github.microservice.components.data.mongo.mongo.helper.DBHelper;
|
|
|
import com.zhongshu.payment.server.core.dao.extend.RechargeRecordDaoExtend;
|
|
|
import com.zhongshu.payment.server.core.domain.wallet.RechargeRecord;
|
|
|
+import com.zhongshu.payment.server.core.domain.wallet.Wallet;
|
|
|
+import com.zhongshu.payment.server.core.utils.CommonUtil;
|
|
|
+import org.apache.commons.lang3.ObjectUtils;
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+import org.springframework.data.mongodb.core.MongoTemplate;
|
|
|
+import org.springframework.data.mongodb.core.query.Criteria;
|
|
|
+import org.springframework.data.mongodb.core.query.Query;
|
|
|
|
|
|
-import java.awt.print.Pageable;
|
|
|
import java.util.List;
|
|
|
|
|
|
/**
|
|
|
@@ -11,8 +18,29 @@ import java.util.List;
|
|
|
* @date 2024/7/26
|
|
|
*/
|
|
|
public class RechargeRecordDaoImpl implements RechargeRecordDaoExtend {
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ DBHelper dbHelper;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ MongoTemplate mongoTemplate;
|
|
|
+
|
|
|
@Override
|
|
|
- public List<RechargeRecord> queryListByWallet(Pageable pageable) {
|
|
|
- return null;
|
|
|
+ public List<RechargeRecord> ListByWallet(Wallet wallet, Long startTime, Long endTime) {
|
|
|
+ Criteria criteria = new Criteria();
|
|
|
+
|
|
|
+ if (ObjectUtils.isNotEmpty(wallet)){
|
|
|
+ criteria.and("wallet").is(wallet);
|
|
|
+ }
|
|
|
+
|
|
|
+ if (!CommonUtil.longIsEmpty(startTime)){
|
|
|
+ criteria.and("createTime").gte(startTime);
|
|
|
+ }
|
|
|
+
|
|
|
+ if (CommonUtil.longIsEmpty(endTime)){
|
|
|
+ criteria.and("createTime").lte(endTime);
|
|
|
+ }
|
|
|
+
|
|
|
+ return mongoTemplate.find(Query.query(criteria), RechargeRecord.class);
|
|
|
}
|
|
|
}
|