InsPlyIncomeMapper.java 9.0 KB

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