|
@@ -2,7 +2,13 @@ package me.zhengjie.dao.mybatis;
|
|
|
|
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
import lombok.RequiredArgsConstructor;
|
|
import lombok.RequiredArgsConstructor;
|
|
|
|
|
+import me.zhengjie.dao.mybatis.entity.BorrowerEntity;
|
|
|
|
|
+import me.zhengjie.dao.mybatis.entity.GuaranteeEntity;
|
|
|
|
|
+import me.zhengjie.dao.mybatis.entity.MortgageEntity;
|
|
|
import me.zhengjie.dao.mybatis.entity.NotaryOrderEntity;
|
|
import me.zhengjie.dao.mybatis.entity.NotaryOrderEntity;
|
|
|
|
|
+import me.zhengjie.dao.mybatis.mapper.BorrowerMapper;
|
|
|
|
|
+import me.zhengjie.dao.mybatis.mapper.GuaranteeMapper;
|
|
|
|
|
+import me.zhengjie.dao.mybatis.mapper.MortgageMapper;
|
|
|
import me.zhengjie.dao.mybatis.mapper.NotaryOrderMapper;
|
|
import me.zhengjie.dao.mybatis.mapper.NotaryOrderMapper;
|
|
|
import org.springframework.stereotype.Component;
|
|
import org.springframework.stereotype.Component;
|
|
|
|
|
|
|
@@ -11,6 +17,9 @@ import org.springframework.stereotype.Component;
|
|
|
public class OrderRepository {
|
|
public class OrderRepository {
|
|
|
|
|
|
|
|
final NotaryOrderMapper notaryOrderMapper;
|
|
final NotaryOrderMapper notaryOrderMapper;
|
|
|
|
|
+ final BorrowerMapper borrowerMapper;
|
|
|
|
|
+ final MortgageMapper mortgageMapper;
|
|
|
|
|
+ final GuaranteeMapper guaranteeMapper;
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
* 根据业务编号获取主订单
|
|
* 根据业务编号获取主订单
|
|
@@ -22,4 +31,37 @@ public class OrderRepository {
|
|
|
qw.eq("business_no", businessNo);
|
|
qw.eq("business_no", businessNo);
|
|
|
return notaryOrderMapper.selectOne(qw);
|
|
return notaryOrderMapper.selectOne(qw);
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 根据业务编号统计借款订单数量
|
|
|
|
|
+ * @param businessNo
|
|
|
|
|
+ * @return
|
|
|
|
|
+ */
|
|
|
|
|
+ public Long countBorrowerNumByBizNo(String businessNo) {
|
|
|
|
|
+ QueryWrapper<BorrowerEntity> qw = new QueryWrapper<>();
|
|
|
|
|
+ qw.eq("business_no", businessNo);
|
|
|
|
|
+ return borrowerMapper.selectCount(qw);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 根据业务编号统计抵押订单数量
|
|
|
|
|
+ * @param businessNo
|
|
|
|
|
+ * @return
|
|
|
|
|
+ */
|
|
|
|
|
+ public Long countMortgageNumByBizNo(String businessNo) {
|
|
|
|
|
+ QueryWrapper<MortgageEntity> qw = new QueryWrapper<>();
|
|
|
|
|
+ qw.eq("business_no", businessNo);
|
|
|
|
|
+ return mortgageMapper.selectCount(qw);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 根据业务编号统计担保订单数量
|
|
|
|
|
+ * @param businessNo
|
|
|
|
|
+ * @return
|
|
|
|
|
+ */
|
|
|
|
|
+ public Long countGuaranteeNumByBizNo(String businessNo) {
|
|
|
|
|
+ QueryWrapper<GuaranteeEntity> qw = new QueryWrapper<>();
|
|
|
|
|
+ qw.eq("business_no", businessNo);
|
|
|
|
|
+ return guaranteeMapper.selectCount(qw);
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|