InvoiceManageExtendMapper.xml 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  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.invoice.mapper.InvoiceManageExtendMapper">
  4. <select id="listByModel" resultType="com.idea.invoice.dto.InvoiceManageDto">
  5. select i.*,cm.id contractId,cm.contract_number,cm.record_number,cm.buyer_name,cm.house_name,
  6. ifnull(cm.buyer_money,0) buyer_money,
  7. ifnull(cm.maintenance_total_price,0) maintenance_total_price,
  8. cm.collection_status,cm.fund_collection_status
  9. from invoice_manage i
  10. left join idea_settle_down.contract_manage cm on i.contract_id = cm.id
  11. <where>
  12. <if test="type !=null and type !=''">
  13. and i.type = #{type}
  14. </if>
  15. <if test="buyerName !=null and buyerName !=''">
  16. and cm.buyer_name like concat('%',#{buyerName},'%')
  17. </if>
  18. <if test="houseName !=null and houseName !=''">
  19. and cm.house_name like concat('%',#{houseName},'%')
  20. </if>
  21. <if test="sendStatus !=null and sendStatus !=''">
  22. and i.send_status = #{sendStatus}
  23. </if>
  24. <if test="sendDateFrom !=null and sendDateFrom !=''">
  25. and i.submit_time >= #{sendDateFrom}
  26. </if>
  27. <if test="sendDateTo !=null and sendDateTo !=''">
  28. and i.submit_time &lt;= #{sendDateTo}
  29. </if>
  30. <if test="invoiceStatus !=null and invoiceStatus !=''">
  31. and i.invoice_status = #{invoiceStatus}
  32. </if>
  33. <if test="invoiceDateFrom !=null and invoiceDateFrom !=''">
  34. and i.invoice_date >= #{invoiceDateFrom}
  35. </if>
  36. <if test="invoiceDateTo !=null and invoiceDateTo !=''">
  37. and i.invoice_date &lt;= #{sendDateTo}
  38. </if>
  39. </where>
  40. order by i.create_time desc
  41. </select>
  42. </mapper>