RefundManageExtendMapper.xml 1.4 KB

123456789101112131415161718192021222324252627282930313233
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  3. <mapper namespace="com.idea.paymentManagement.mapper.RefundManageExtendMapper">
  4. <select id="listByModel" resultType="com.idea.paymentManagement.dto.RefundManageDto">
  5. select contract_manage.id contractId,
  6. contract_manage.buyer_name,
  7. contract_manage.house_name,
  8. contract_manage.contract_number,
  9. contract_manage.customer_management_id,
  10. refund_manage.*
  11. from refund_manage
  12. left join contract_manage on contract_manage.id = refund_manage.contract_id
  13. <where>
  14. <if test="houseName != null and houseName != ''">
  15. and house_name like concat('%',#{houseName},'%')
  16. </if>
  17. <if test="refundDateFrom != null and refundDateFrom != ''">
  18. and date_format(refund_manage.created_at, '%Y-%m-%d') &gt;= #{refundDateFrom}
  19. </if>
  20. <if test="refundDateTo != null and refundDateTo != ''">
  21. and date_format(refund_manage.created_at, '%Y-%m-%d') &lt;= #{refundDateTo}
  22. </if>
  23. <if test="buyerName != null and buyerName != ''">
  24. and refund_manage.buyer_name concat('%',#{buyerName},'%')
  25. </if>
  26. <if test="applicant != null and applicant != ''">
  27. and applicant like concat('%',#{applicant},'%')
  28. </if>
  29. </where>
  30. </select>
  31. </mapper>