Ви не можете вибрати більше 25 тем Теми мають розпочинатися з літери або цифри, можуть містити дефіси (-) і не повинні перевищувати 35 символів.
 
 
 
 
 

123 рядки
5.3 KiB

  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.iformall.mapper.WxFinanceReceiveBillMapper">
  4. <resultMap id="BaseResultMap" type="com.iformall.domain.po.WxFinanceReceiveBill">
  5. <id column="id" jdbcType="BIGINT" property="id"/>
  6. <result column="tenant_id" jdbcType="VARCHAR" property="tenantId"/>
  7. <result column="parent_tenant_id" jdbcType="VARCHAR" property="parentTenantId" />
  8. <result column="create_time" jdbcType="TIMESTAMP" property="createTime"/>
  9. <result column="update_time" jdbcType="TIMESTAMP" property="updateTime"/>
  10. <result column="bill_id" jdbcType="BIGINT" property="billId"/>
  11. <result column="bill_type" jdbcType="INTEGER" property="billType"/>
  12. <result column="fees_id" jdbcType="BIGINT" property="feesId"/>
  13. <result column="pay_way" jdbcType="BIGINT" property="payWay"/>
  14. <result column="receive_id" jdbcType="BIGINT" property="receiveId"/>
  15. <result column="receive" jdbcType="VARCHAR" property="receive"/>
  16. <result column="pay" jdbcType="VARCHAR" property="pay"/>
  17. <result column="merchant_id" jdbcType="BIGINT" property="merchantId"/>
  18. <result column="starttime" jdbcType="TIMESTAMP" property="starttime"/>
  19. <result column="endtime" jdbcType="TIMESTAMP" property="endtime"/>
  20. <result column="is_del" jdbcType="INTEGER" property="isDel"/>
  21. <result column="type" jdbcType="INTEGER" property="type"/>
  22. <result column="receive_date" jdbcType="TIMESTAMP" property="receiveDate"/>
  23. </resultMap>
  24. <sql id="allColumns">
  25. `id`,`tenant_id`,`parent_tenant_id`,`create_time`,`update_time`,`bill_id`,`bill_type`,`fees_id`,
  26. `pay_way`,`receive_id`,`receive`,`pay`,`merchant_id`,`starttime`,`endtime`,`is_del`,`type`,`receive_date`
  27. </sql>
  28. <sql id="dynamicWhereConditions">
  29. where 1=1
  30. <if test=" null != id ">and `id` = #{id}</if>
  31. <if test=" null != tenantId and '' != tenantId">
  32. and `tenant_id` = #{tenantId}
  33. </if>
  34. <if test=" null != parentTenantId and '' != parentTenantId">
  35. and `parent_tenant_id` = #{parentTenantId}
  36. </if>
  37. <if test=" null != billId ">and `bill_id` = #{billId}</if>
  38. <if test=" null != billType ">and `bill_type` = #{billType}</if>
  39. <if test=" null != feesId ">and `fees_id` = #{feesId}</if>
  40. <if test=" null != payWay ">and `pay_way` = #{payWay}</if>
  41. <if test=" null != receiveId ">and `receive_id` = #{receiveId}</if>
  42. <if test=" null != merchantId ">and `merchant_id` = #{merchantId}</if>
  43. <if test=" null != isDel ">and `is_del` = #{isDel}</if>
  44. <if test=" null != createTimeBegin ">and `create_time` &gt;= #{createTimeBegin}</if>
  45. <if test=" null != createTimeEnd ">and `create_time` &lt;= #{createTimeEnd}</if>
  46. <if test=" null != starttime ">and `starttime` &gt;= #{starttime}</if>
  47. <if test=" null != endtime ">and `endtime` &lt;= #{endtime}</if>
  48. <if test=" 1 == noReduce ">and `pay_way` != 4 </if>
  49. <if test=" null != type ">and type = #{type} </if>
  50. <if test=" null != merchantIdList ">
  51. and merchant_id in
  52. <foreach collection="merchantIdList" index="index" item="midItem" open="(" separator="," close=")">
  53. #{midItem}
  54. </foreach>
  55. </if>
  56. <if test=" null != feesIdList ">
  57. and fees_id in
  58. <foreach collection="feesIdList" index="index" item="fidItem" open="(" separator="," close=")">
  59. #{fidItem}
  60. </foreach>
  61. </if>
  62. <if test=" null != payWayList ">
  63. and pay_way in
  64. <foreach collection="payWayList" index="index" item="paidItem" open="(" separator="," close=")">
  65. #{paidItem}
  66. </foreach>
  67. </if>
  68. <if test=" null != ids ">
  69. and id in
  70. <foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")">
  71. #{idItem}
  72. </foreach>
  73. </if>
  74. <if test=" null != sortColumns">order by ${sortColumns}</if>
  75. </sql>
  76. <select id="findList" parameterType="com.iformall.domain.po.WxFinanceReceiveBill" resultMap="BaseResultMap">
  77. select
  78. <include refid="allColumns"/>
  79. from wx_finance_receive_bill
  80. <include refid="dynamicWhereConditions"/>
  81. </select>
  82. <select id="selectById" parameterType="HashMap" resultMap="BaseResultMap">
  83. select
  84. <include refid="allColumns"/>
  85. from wx_finance_receive_bill where id = #{id} and `tenant_id` = #{tenantId}
  86. </select>
  87. <update id = "deleteByConditon" parameterType="com.iformall.domain.po.WxFinanceReceiveBill">
  88. update wx_finance_receive_bill set is_del = 1 ,update_time = #{updateTime}
  89. <include refid="dynamicWhereConditions"/>
  90. </update>
  91. <select id="findBillIdList" parameterType="com.iformall.domain.po.WxFinanceReceiveBill" resultType="Long">
  92. select distinct bill_id
  93. from wx_finance_receive_bill
  94. <include refid="dynamicWhereConditions"/>
  95. </select>
  96. <select id="findReceiveIdList" parameterType="com.iformall.domain.po.WxFinanceReceiveBill" resultType="Long">
  97. select distinct receive_id
  98. from wx_finance_receive_bill
  99. <include refid="dynamicWhereConditions"/>
  100. </select>
  101. <resultMap id="sumResultMap" type="com.iformall.domain.vo.WxFinanceReceiveBillSum">
  102. <result column="receive" jdbcType="VARCHAR" property="receive"/>
  103. <result column="pay" jdbcType="VARCHAR" property="pay" />
  104. </resultMap>
  105. <select id="findSum" parameterType="com.iformall.domain.po.WxFinanceReceiveBill" resultMap="sumResultMap">
  106. select
  107. sum(CAST(ifnull(receive,'0') AS DECIMAL(20,2))) receive ,
  108. sum(CAST(ifnull(pay,'0') AS DECIMAL(20,2))) pay
  109. from wx_finance_receive_bill
  110. <include refid="dynamicWhereConditions"/>
  111. </select>
  112. </mapper>