You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

72 lines
3.1 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.WxRentContractRevenueSalesMapper">
  4. <resultMap id="BaseResultMap" type="com.iformall.domain.po.WxRentContractRevenueSales">
  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="rent_contract_id" jdbcType="BIGINT" property="rentContractId"/>
  11. <result column="property_contract_id" jdbcType="BIGINT" property="propertyContractId"/>
  12. <result column="bill_id" jdbcType="BIGINT" property="billId"/>
  13. <result column="bill_money" jdbcType="VARCHAR" property="billMoney"/>
  14. <result column="sale_money" jdbcType="VARCHAR" property="saleMoney"/>
  15. <result column="calcute_money" jdbcType="VARCHAR" property="calcuteMoney"/>
  16. <result column="remark" jdbcType="VARCHAR" property="remark"/>
  17. </resultMap>
  18. <sql id="allColumns">
  19. `id`,`tenant_id`,`parent_tenant_id`,`create_time`,`update_time`,`rent_contract_id`,`property_contract_id`,`bill_id`,`bill_money`,
  20. `sale_money`,`calcute_money`,`remark`
  21. </sql>
  22. <sql id="dynamicWhereConditions">
  23. where 1=1
  24. <if test=" null != id ">and `id` = #{id}</if>
  25. <if test=" null != tenantId and '' != tenantId">
  26. and `tenant_id` = #{tenantId}
  27. </if>
  28. <if test=" null != parentTenantId and '' != parentTenantId">
  29. and `parent_tenant_id` = #{parentTenantId}
  30. </if>
  31. <if test=" null != rentContractId ">and `rent_contract_id` = #{rentContractId}</if>
  32. <if test=" null != propertyContractId ">and `property_contract_id` = #{propertyContractId}</if>
  33. <if test=" null != billId ">and `bill_id` = #{billId}</if>
  34. <if test=" null != ids ">
  35. and id in
  36. <foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")">
  37. #{idItem}
  38. </foreach>
  39. </if>
  40. <if test=" null != sortColumns">order by ${sortColumns}</if>
  41. </sql>
  42. <select id="findList" parameterType="com.iformall.domain.po.WxRentContractRevenueSales" resultMap="BaseResultMap">
  43. select
  44. <include refid="allColumns"/>
  45. from wx_rent_contract_revenue_sales
  46. <include refid="dynamicWhereConditions"/>
  47. </select>
  48. <select id="selectById" parameterType="HashMap" resultMap="BaseResultMap">
  49. select
  50. <include refid="allColumns"/>
  51. from wx_rent_contract_revenue_sales where id = #{id} and `tenant_id` = #{tenantId}
  52. </select>
  53. <select id="findSumSalesMoney" parameterType="com.iformall.domain.po.WxRentContractRevenueSales" resultType="BigDecimal">
  54. select sum(CAST(sale_money AS DECIMAL(20,2))) receive_pay
  55. from wx_rent_contract_revenue_sales
  56. <include refid="dynamicWhereConditions"/>
  57. </select>
  58. <select id="findBillId" parameterType="com.iformall.domain.po.WxRentContractRevenueSales" resultType="Long">
  59. select distinct bill_id
  60. from wx_rent_contract_revenue_sales
  61. <include refid="dynamicWhereConditions"/>
  62. </select>
  63. </mapper>