FinanceInvoiceMapper.xml 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  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.dayou.mapper.FinanceInvoiceMapper">
  4. <!-- 通用查询映射结果 -->
  5. <resultMap id="BaseResultMap" type="com.dayou.entity.FinanceInvoice">
  6. <result column="id" property="id" />
  7. <result column="deleted" property="deleted" />
  8. <result column="modified" property="modified" />
  9. <result column="created" property="created" />
  10. <result column="production_fund_id" property="productionFundId" />
  11. <result column="title" property="title" />
  12. <result column="type" property="type" />
  13. <result column="tax_no" property="taxNo" />
  14. <result column="plan_amount" property="planAmount" />
  15. <result column="real_amount" property="realAmount" />
  16. <result column="plan_make_date" property="planMakeDate" />
  17. <result column="real_make_date" property="realMakeDate" />
  18. <result column="state" property="state" />
  19. <result column="reason" property="reason" />
  20. <result column="apply_id" property="applyId" />
  21. <result column="checker_id" property="checkerId" />
  22. <result column="maker_id" property="makerId" />
  23. <result column="bank_name" property="bankName" />
  24. <result column="bank_account" property="bankAccount" />
  25. <result column="bank_address" property="bankAddress" />
  26. <result column="bank_tel" property="bankTel" />
  27. <result column="make_item" property="makeItem" />
  28. <result column="item_quantity" property="itemQuantity" />
  29. <result column="item_unit" property="itemUnit" />
  30. <result column="tax_rate" property="taxRate" />
  31. <result column="tax_amount" property="taxAmount" />
  32. <result column="remark" property="remark" />
  33. </resultMap>
  34. <!-- 通用查询结果列 -->
  35. <sql id="Base_Column_List">
  36. id,
  37. deleted,
  38. modified,
  39. created,
  40. production_fund_id, title, type, tax_no, plan_amount, real_amount, plan_make_date, real_make_date, state, reason, apply_id, checker_id, maker_id, bank_name, bank_account, bank_address, bank_tel, make_item, item_quantity, item_unit, tax_rate, tax_amount, remark
  41. </sql>
  42. <select id="getPage" parameterType="com.dayou.entity.FinanceInvoice" resultType="com.dayou.entity.FinanceInvoice">
  43. SELECT
  44. fi.*,
  45. orf.business_type,
  46. orf.order_id,
  47. orf.order_name,
  48. (orf.should_amount=orf.real_amount) as isPayAll,
  49. u.name AS applyName
  50. FROM
  51. finance_invoice fi
  52. LEFT JOIN order_fund orf ON fi.order_fund_id = orf.id
  53. LEFT JOIN user u ON u.id = fi.apply_id
  54. where fi.deleted = 0 and orf.deleted = 0
  55. <if test="keyword!=null and keyword!='' ">
  56. and (
  57. fi.title like concat ('%',#{keyword},'%')
  58. or orf.order_name like concat('%',#{keyword},'%')
  59. or orf.order_id like concat('%',#{keyword},'%')
  60. or orf.business_type like concat('%',#{keyword},'%')
  61. or u.name like concat('%',#{keyword},'%')
  62. or fi.type like concat('%',#{keyword},'%')
  63. or fi.tax_no like concat('%',#{keyword},'%')
  64. or fi.plan_amount like concat('%',#{keyword},'%')
  65. or fi.state like concat('%',#{keyword},'%')
  66. or fi.remark like concat('%',#{keyword},'%')
  67. )
  68. </if>
  69. <if test="vo!=null and vo.pStartDate!=null and vo.pStartDate!=''">
  70. and fi.plan_make_date &gt;= #{vo.pStartDate}
  71. </if>
  72. <if test="vo!=null and vo.pEndDate!=null and vo.pEndDate!=''">
  73. and fi.plan_make_date &lt;= #{vo.pEndDate}
  74. </if>
  75. <if test="vo!=null and vo.aStartDate!=null and vo.aStartDate!=''">
  76. and fi.created &gt;= #{vo.aStartDate}
  77. </if>
  78. <if test="vo!=null and vo.aEndDate!=null and vo.aEndDate!=''">
  79. and fi.created &lt;= #{vo.aEndDate}
  80. </if>
  81. order by fi.created DESC
  82. </select>
  83. </mapper>