InsPlyIncomeMapper.java 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184
  1. package com.ydtech.modules.fnc.dao;
  2. import com.baomidou.mybatisplus.core.mapper.BaseMapper;
  3. import com.ydtech.modules.admin.model.report.financialReceivables.FinancialReceivablesAllMonthVo;
  4. import com.ydtech.modules.admin.model.report.financialReceivables.FinancialReceivablesQueryMonthVo;
  5. import com.ydtech.modules.admin.model.report.financialReceivables.FinancialReceivablesQueryVo;
  6. import com.ydtech.modules.admin.model.report.financialReceivables.FinancialReceivablesVo;
  7. import com.ydtech.modules.admin.model.report.profitAnalysis.ProfitAnalysisDto;
  8. import com.ydtech.modules.admin.model.report.profitAnalysis.ProfitAnalysisQueryDto;
  9. import com.ydtech.modules.fnc.dto.PlatformSettlementRecordDto;
  10. import com.ydtech.modules.fnc.entity.InsPlyIncome;
  11. import com.ydtech.modules.fnc.vo.InsPlyIncomeVo;
  12. import com.ydtech.modules.fnc.vo.InsPlySettleVo;
  13. import org.apache.ibatis.annotations.Mapper;
  14. import org.apache.ibatis.annotations.Param;
  15. import org.apache.ibatis.annotations.Select;
  16. import java.math.BigDecimal;
  17. import java.util.HashMap;
  18. import java.util.List;
  19. /**
  20. * <p>
  21. * 保司结算手续费 Mapper 接口
  22. * </p>
  23. *
  24. * @author gws
  25. * @since 2024-01-05
  26. */
  27. @Mapper
  28. public interface InsPlyIncomeMapper extends BaseMapper<InsPlyIncome> {
  29. @Select({"<script>"," " +
  30. "select a.*,b.`name` dept_name ,c.`name` companyName " +
  31. "from ins_ply_income a " +
  32. "left join sys_dept b on a.dept_id=b.id " +
  33. "left join esm_ins_company c on a.company_id=c.id " +
  34. "where 1=1 " +
  35. "<if test='startDate!=null and endDate!=null'>" +
  36. "and DATE_FORMAT(pay_date, '%Y-%m-%d') " +
  37. "between DATE_FORMAT(#{startDate}, '%Y-%m-%d') and DATE_FORMAT(#{endDate}, '%Y-%m-%d')" +
  38. "</if> "+
  39. "<if test='companyId!=\"\" and companyId!=null '>" +
  40. " and a.company_id=#{companyId} " +
  41. "</if> "+
  42. "<if test='deptId!=\"\" and deptId!=null '>" +
  43. " and a.dept_id like CONCAT(#{deptId}, '%') " +
  44. "</if> "+
  45. "<if test='agreementId!=\"\" and agreementId!=null '>" +
  46. " and a.agreement_id=#{agreementId} " +
  47. "</if> "+
  48. //待结算清单
  49. "<if test='flag==\"0\" '>" +
  50. " and a.all_fee_value!=IFNULL(a.final_fee_value,0)+IFNULL(a.doing_fee_value,0)" +
  51. "</if> "+
  52. "<if test='licenseno!=\"\" and licenseno!=null '>" +
  53. " and a.licenseno=#{licenseno} " +
  54. "</if> "
  55. ,"</script>"}
  56. )
  57. List<InsPlyIncome> selectByCondition(InsPlyIncomeVo insPlyIncomeVo);
  58. @Select({
  59. "select a.*,b.`name` dept_name ,c.`name` companyName " +
  60. "from ins_ply_income a " +
  61. "left join sys_dept b on a.dept_id=b.id " +
  62. "left join esm_ins_company c on a.company_id=c.id " +
  63. "where a.policyno= #{policyno}"
  64. }
  65. )
  66. InsPlyIncome selectByPlyno(String policyno);
  67. @Select({"<script>"," " +
  68. "select a.settleno,i.*,b.`name` dept_name ,c.`name` companyName " +
  69. "from ins_ply_settle_detail a " +
  70. "inner join ins_ply_income i on a.policyno=i.policyno " +
  71. "left join sys_dept b on i.dept_id=b.id " +
  72. "left join esm_ins_company c on i.company_id=c.id " +
  73. "where a.settleno =#{settleno} "
  74. ,"</script>"}
  75. )
  76. List<InsPlyIncome> selectSettleByCondition(InsPlySettleVo insPlySettleVo);
  77. List<InsPlyIncome> queryNew(HashMap<String, Object> params);
  78. List<InsPlyIncome> totalQuery(HashMap<String, Object> params);
  79. void uopdateByOrderno(InsPlyIncome insPlyIncome);
  80. List<InsPlyIncome> NonSettlementQuery(HashMap<String, Object> params);
  81. HashMap<String,Object> totalAmount(HashMap<String,Object> params);
  82. List<InsPlyIncome> totalPinAmount(HashMap<String, Object> params);
  83. List<InsPlyIncome> totalBxAmount(HashMap<String, Object> params);
  84. InsPlyIncome queryInvoicing(HashMap<String, Object> params);
  85. List<InsPlyIncome> allOtherAmount(HashMap<String, Object> params);
  86. InsPlyIncome findByLicenseno(HashMap<String, Object> params);
  87. InsPlyIncome bxTotalAmount(HashMap<String, Object> params);
  88. InsPlyIncome findByBxLicenseno(HashMap<String, Object> params);
  89. InsPlyIncome getById (@Param("id") String id);
  90. /**
  91. *
  92. * @param idArr 开票的id
  93. * @return
  94. */
  95. List<HashMap<String,Object>> groupByInvoic(HashMap<String,Object> params);
  96. List<InsPlyIncome> getIncomeIdList(HashMap<String, Object> params);
  97. List<HashMap<String,Object>> getOtherIds(HashMap<String, Object> params);
  98. InsPlyIncome getEntityById(@Param("id") String id);
  99. void updateByIds(String[] split);
  100. List<HashMap<String,Object>> otherTimeDetail(HashMap<String, Object> params);
  101. InsPlyIncome ptTotalAmount(HashMap<String, Object> params);
  102. /**
  103. * @version
  104. * @author: hxl
  105. * @Date: 2024/6/18 10:15
  106. * @Description: 根据合作公司id和结算状态查询数据
  107. */
  108. List<PlatformSettlementRecordDto> platformSettlementRecord(@Param("partnerCompaniesId") String partnerCompaniesId, @Param("handlingFeesStatus") String handlingFeesStatus,@Param("dockingPerson") String dockingPerson);
  109. /***
  110. *
  111. * @param insPlyIncomeVo
  112. * @return 返回私有 平台 应收 已收 未收
  113. */
  114. InsPlyIncome getTotalPtReceivables(InsPlyIncomeVo insPlyIncomeVo);
  115. /**
  116. * 根据签单日期月份分组
  117. * @param insPlyIncomeVo
  118. * @return 平台 私有 应收 已收
  119. */
  120. List<HashMap<String, Object>> ptSumGroupByMonth(HashMap<String, Object> params);
  121. /**
  122. * @version
  123. * @author: hxl
  124. * @Date: 2024/7/31 18:04
  125. * @Description: 查询数据
  126. */
  127. List<ProfitAnalysisDto> queryPage( @Param("vo") ProfitAnalysisQueryDto profitAnalysisQueryDto);
  128. /**
  129. * @version
  130. * @author: hxl
  131. * @Date: 2024/8/1 12:09
  132. * @Description: 查询应收总数据
  133. */
  134. BigDecimal queryDateByTypeSumAmount(@Param("vo") FinancialReceivablesQueryVo financialReceivablesQueryVo);
  135. /**
  136. * @version
  137. * @author: hxl
  138. * @Date: 2024/8/1 12:16
  139. * @Description: 查询应收列表数据 1-12月
  140. */
  141. List<FinancialReceivablesVo> queryDateByType(@Param("vo") FinancialReceivablesQueryVo financialReceivablesQueryVo);
  142. /**
  143. * @version
  144. * @author: hxl
  145. * @Date: 2024/8/5 10:06
  146. * @Description: 查询月份的统计数据
  147. */
  148. FinancialReceivablesAllMonthVo queryDateByTypeByMonth(FinancialReceivablesQueryMonthVo financialReceivablesQueryVo);
  149. }