InsPlyIncomeMapper.java 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. package com.ydtech.modules.fnc.dao;
  2. import com.ydtech.modules.fnc.entity.InsPlyIncome;
  3. import com.baomidou.mybatisplus.core.mapper.BaseMapper;
  4. import com.ydtech.modules.fnc.entity.InsPlySettleDetail;
  5. import com.ydtech.modules.fnc.vo.InsPlyIncomeVo;
  6. import com.ydtech.modules.fnc.vo.InsPlySettleVo;
  7. import org.apache.ibatis.annotations.Mapper;
  8. import org.apache.ibatis.annotations.Select;
  9. import java.util.List;
  10. /**
  11. * <p>
  12. * 保司结算手续费 Mapper 接口
  13. * </p>
  14. *
  15. * @author gws
  16. * @since 2024-01-05
  17. */
  18. @Mapper
  19. public interface InsPlyIncomeMapper extends BaseMapper<InsPlyIncome> {
  20. @Select({"<script>"," " +
  21. "select a.*,b.`name` dept_name ,c.`name` companyName " +
  22. "from ins_ply_income a " +
  23. "left join sys_dept b on a.dept_id=b.id " +
  24. "left join esm_ins_company c on a.company_id=c.id " +
  25. "where DATE_FORMAT(pay_date, '%Y-%m-%d') " +
  26. "between DATE_FORMAT(#{startDate}, '%Y-%m-%d') and DATE_FORMAT(#{endDate}, '%Y-%m-%d')" +
  27. "<if test='companyId!=\"\" '>" +
  28. " and a.company_id=#{companyId} " +
  29. "</if> "+
  30. "<if test='deptId!=\"\" '>" +
  31. " and a.dept_id like CONCAT(#{deptId}, '%') " +
  32. "</if> "+
  33. "<if test='agreementId!=\"\" '>" +
  34. " and a.agreement_id=#{agreementId} " +
  35. "</if> "+
  36. //待结算清单
  37. "<if test='flag==\"0\" '>" +
  38. " and a.all_fee_value!=IFNULL(a.final_fee_value,0)+IFNULL(a.doing_fee_value,0)" +
  39. "</if> "+
  40. "<if test='licenseno!=\"\" '>" +
  41. " and a.licenseno=#{licenseno} " +
  42. "</if> "
  43. ,"</script>"}
  44. )
  45. List<InsPlyIncome> selectByCondition(InsPlyIncomeVo insPlyIncomeVo);
  46. @Select({"<script>"," " +
  47. "select a.settleno,i.*,b.`name` dept_name ,c.`name` companyName " +
  48. "from ins_ply_settle_detail a " +
  49. "inner join ins_ply_income i on a.policyno=i.policyno " +
  50. "left join sys_dept b on i.dept_id=b.id " +
  51. "left join esm_ins_company c on i.company_id=c.id " +
  52. "where a.settleno =#{settleno} "
  53. ,"</script>"}
  54. )
  55. List<InsPlyIncome> selectSettleByCondition(InsPlySettleVo insPlySettleVo);
  56. }