|
- <?xml version="1.0" encoding="UTF-8"?>
- <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
- <mapper namespace="com.iformall.mapper.WxMerchantTradeDailyHistoryMapper">
- <resultMap id="BaseResultMap" type="com.iformall.domain.po.WxMerchantTradeDailyHistory">
- <id column="id" jdbcType="BIGINT" property="id" />
- <result column="tenant_id" jdbcType="VARCHAR" property="tenantId" />
- <result column="parent_tenant_id" jdbcType="VARCHAR" property="parentTenantId"/>
- <result column="merchant_id" jdbcType="BIGINT" property="merchantId" />
- <result column="b_user_id" jdbcType="BIGINT" property="bUserId" />
- <result column="trade_amt" jdbcType="DECIMAL" property="tradeAmt" />
- <result column="create_date" jdbcType="TIMESTAMP" property="createDate" />
- <result column="update_date" jdbcType="TIMESTAMP" property="updateDate" />
- <result column="report_date" jdbcType="VARCHAR" property="reportDate" />
- <result column="date_type" jdbcType="INTEGER" property="dateType" />
- <result column="trade_count" jdbcType="INTEGER" property="tradeCount" />
- <result column="proof" jdbcType="VARCHAR" property="proof"/>
- <result column="trade_daily_id" jdbcType="BIGINT" property="tradeDailyId" />
- <result column="mall_user_id" jdbcType="BIGINT" property="mallUserId" />
- </resultMap>
-
- <sql id="allColumns">
- `id`,`tenant_id`,`parent_tenant_id`,`merchant_id`,`b_user_id`,`trade_amt`,`create_date`,`update_date`,
- `report_date`,`date_type`,`trade_count`,`proof`,`trade_daily_id`,`mall_user_id`
- </sql>
-
- <sql id="dynamicWhereConditions">
- where 1 = 1
-
- <if test=" null != id ">
- and `id` = #{id}
- </if>
-
- <if test=" null != tenantId and '' != tenantId">
- and `tenant_id` = #{tenantId}
- </if>
- <if test=" null != parentTenantId and '' != parentTenantId">
- and `parent_tenant_id` = #{parentTenantId}
- </if>
-
- <if test=" null != tradeDailyId ">
- and `trade_daily_id` = #{tradeDailyId}
- </if>
-
- <if test=" null != mallUserId ">
- and `mall_user_id` = #{mallUserId}
- </if>
-
- <if test=" null != merchantId ">
- and `merchant_id` = #{merchantId}
- </if>
-
- <if test=" null != bUserId ">
- and `b_user_id` = #{bUserId}
- </if>
-
- <if test=" null != tradeAmt ">
- and `trade_amt` = #{tradeAmt}
- </if>
-
- <if test=" null != createDate ">
- and `create_date` = #{createDate}
- </if>
-
- <if test=" null != updateDate ">
- and `update_date` = #{updateDate}
- </if>
-
- <if test=" null != reportDate ">
- and `report_date` = #{reportDate}
- </if>
-
- <if test=" null != month ">
- and date_format(create_date,'%Y-%m')=#{month}
- </if>
-
- <if test=" null != ids ">
- and id in
- <foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")">
- #{idItem}
- </foreach>
- </if>
-
- <if test=" null != sortColumns"> order by ${sortColumns} </if>
- <if test=" null == sortColumns"> order by report_date desc </if>
- </sql>
-
- <select id="findList" parameterType="com.iformall.domain.po.WxMerchantTradeDailyHistory" resultMap="BaseResultMap">
- select
- <include refid="allColumns"/>
- from wx_merchant_trade_daily_history
- <include refid="dynamicWhereConditions" />
- </select>
-
- </mapper>
|