選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。
 
 
 
 
 

95 行
3.2 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.WxMerchantTradeDailyHistoryMapper">
  4. <resultMap id="BaseResultMap" type="com.iformall.domain.po.WxMerchantTradeDailyHistory">
  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="merchant_id" jdbcType="BIGINT" property="merchantId" />
  9. <result column="b_user_id" jdbcType="BIGINT" property="bUserId" />
  10. <result column="trade_amt" jdbcType="DECIMAL" property="tradeAmt" />
  11. <result column="create_date" jdbcType="TIMESTAMP" property="createDate" />
  12. <result column="update_date" jdbcType="TIMESTAMP" property="updateDate" />
  13. <result column="report_date" jdbcType="VARCHAR" property="reportDate" />
  14. <result column="date_type" jdbcType="INTEGER" property="dateType" />
  15. <result column="trade_count" jdbcType="INTEGER" property="tradeCount" />
  16. <result column="proof" jdbcType="VARCHAR" property="proof"/>
  17. <result column="trade_daily_id" jdbcType="BIGINT" property="tradeDailyId" />
  18. <result column="mall_user_id" jdbcType="BIGINT" property="mallUserId" />
  19. </resultMap>
  20. <sql id="allColumns">
  21. `id`,`tenant_id`,`parent_tenant_id`,`merchant_id`,`b_user_id`,`trade_amt`,`create_date`,`update_date`,
  22. `report_date`,`date_type`,`trade_count`,`proof`,`trade_daily_id`,`mall_user_id`
  23. </sql>
  24. <sql id="dynamicWhereConditions">
  25. where 1 = 1
  26. <if test=" null != id ">
  27. and `id` = #{id}
  28. </if>
  29. <if test=" null != tenantId and '' != tenantId">
  30. and `tenant_id` = #{tenantId}
  31. </if>
  32. <if test=" null != parentTenantId and '' != parentTenantId">
  33. and `parent_tenant_id` = #{parentTenantId}
  34. </if>
  35. <if test=" null != tradeDailyId ">
  36. and `trade_daily_id` = #{tradeDailyId}
  37. </if>
  38. <if test=" null != mallUserId ">
  39. and `mall_user_id` = #{mallUserId}
  40. </if>
  41. <if test=" null != merchantId ">
  42. and `merchant_id` = #{merchantId}
  43. </if>
  44. <if test=" null != bUserId ">
  45. and `b_user_id` = #{bUserId}
  46. </if>
  47. <if test=" null != tradeAmt ">
  48. and `trade_amt` = #{tradeAmt}
  49. </if>
  50. <if test=" null != createDate ">
  51. and `create_date` = #{createDate}
  52. </if>
  53. <if test=" null != updateDate ">
  54. and `update_date` = #{updateDate}
  55. </if>
  56. <if test=" null != reportDate ">
  57. and `report_date` = #{reportDate}
  58. </if>
  59. <if test=" null != month ">
  60. and date_format(create_date,'%Y-%m')=#{month}
  61. </if>
  62. <if test=" null != ids ">
  63. and id in
  64. <foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")">
  65. #{idItem}
  66. </foreach>
  67. </if>
  68. <if test=" null != sortColumns"> order by ${sortColumns} </if>
  69. <if test=" null == sortColumns"> order by report_date desc </if>
  70. </sql>
  71. <select id="findList" parameterType="com.iformall.domain.po.WxMerchantTradeDailyHistory" resultMap="BaseResultMap">
  72. select
  73. <include refid="allColumns"/>
  74. from wx_merchant_trade_daily_history
  75. <include refid="dynamicWhereConditions" />
  76. </select>
  77. </mapper>