Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.
 
 
 
 
 

127 строки
5.4 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_cus_name" jdbcType="VARCHAR" property="billCusName"/>
  12. <result column="shop_id" jdbcType="BIGINT" property="shopId"/>
  13. <result column="fees_id" jdbcType="BIGINT" property="feesId"/>
  14. <result column="pay_way" jdbcType="BIGINT" property="payWay"/>
  15. <result column="receive_id" jdbcType="BIGINT" property="receiveId"/>
  16. <result column="receive" jdbcType="VARCHAR" property="receive"/>
  17. <result column="pay" jdbcType="VARCHAR" property="pay"/>
  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_cus_name`,`shop_id`,`fees_id`,
  26. `pay_way`,`receive_id`,`receive`,`pay`,`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 != billCusName and '' != billCusName">
  39. and `bill_cus_name` like concat('%',#{billCusName},'%')
  40. </if>
  41. <if test=" null != shopId ">and `shop_id` = #{shopId}</if>
  42. <if test=" null != feesId ">and `fees_id` = #{feesId}</if>
  43. <if test=" null != payWay ">and `pay_way` = #{payWay}</if>
  44. <if test=" null != receiveId ">and `receive_id` = #{receiveId}</if>
  45. <if test=" null != isDel ">and `is_del` = #{isDel}</if>
  46. <if test=" null != createTimeBegin ">and `create_time` &gt;= #{createTimeBegin}</if>
  47. <if test=" null != createTimeEnd ">and `create_time` &lt;= #{createTimeEnd}</if>
  48. <if test=" null != starttime ">and `starttime` &gt;= #{starttime}</if>
  49. <if test=" null != endtime ">and `endtime` &lt;= #{endtime}</if>
  50. <if test=" 1 == noReduce ">and `pay_way` != 4 </if>
  51. <if test=" null != type ">and type = #{type} </if>
  52. <if test=" null != shopIdList ">
  53. and shop_id in
  54. <foreach collection="shopIdList" index="index" item="shidItem" open="(" separator="," close=")">
  55. #{shidItem}
  56. </foreach>
  57. </if>
  58. <if test=" null != feesIdList ">
  59. and fees_id in
  60. <foreach collection="feesIdList" index="index" item="fidItem" open="(" separator="," close=")">
  61. #{fidItem}
  62. </foreach>
  63. </if>
  64. <if test=" null != payWayList ">
  65. and pay_way in
  66. <foreach collection="payWayList" index="index" item="paidItem" open="(" separator="," close=")">
  67. #{paidItem}
  68. </foreach>
  69. </if>
  70. <if test=" null != ids ">
  71. and id in
  72. <foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")">
  73. #{idItem}
  74. </foreach>
  75. </if>
  76. <if test=" null != sortColumns">order by ${sortColumns}</if>
  77. </sql>
  78. <select id="findList" parameterType="com.iformall.domain.po.WxFinanceReceiveBill" resultMap="BaseResultMap">
  79. select
  80. <include refid="allColumns"/>
  81. from wx_finance_receive_bill
  82. <include refid="dynamicWhereConditions"/>
  83. </select>
  84. <select id="selectById" parameterType="HashMap" resultMap="BaseResultMap">
  85. select
  86. <include refid="allColumns"/>
  87. from wx_finance_receive_bill where id = #{id} and `tenant_id` = #{tenantId}
  88. </select>
  89. <update id = "deleteByConditon" parameterType="com.iformall.domain.po.WxFinanceReceiveBill">
  90. update wx_finance_receive_bill set is_del = 1 ,update_time = #{updateTime}
  91. <include refid="dynamicWhereConditions"/>
  92. </update>
  93. <select id="findBillIdList" parameterType="com.iformall.domain.po.WxFinanceReceiveBill" resultType="Long">
  94. select distinct bill_id
  95. from wx_finance_receive_bill
  96. <include refid="dynamicWhereConditions"/>
  97. </select>
  98. <select id="findReceiveIdList" parameterType="com.iformall.domain.po.WxFinanceReceiveBill" resultType="Long">
  99. select distinct receive_id
  100. from wx_finance_receive_bill
  101. <include refid="dynamicWhereConditions"/>
  102. </select>
  103. <resultMap id="sumResultMap" type="com.iformall.domain.vo.WxFinanceReceiveBillSum">
  104. <result column="receive" jdbcType="VARCHAR" property="receive"/>
  105. <result column="pay" jdbcType="VARCHAR" property="pay" />
  106. </resultMap>
  107. <select id="findSum" parameterType="com.iformall.domain.po.WxFinanceReceiveBill" resultMap="sumResultMap">
  108. select
  109. sum(CAST(ifnull(receive,'0') AS DECIMAL(20,2))) receive ,
  110. sum(CAST(ifnull(pay,'0') AS DECIMAL(20,2))) pay
  111. from wx_finance_receive_bill
  112. <include refid="dynamicWhereConditions"/>
  113. </select>
  114. </mapper>