|
|
|
@@ -1,86 +1,80 @@ |
|
|
|
<?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.WxScoreHistoryMapper"> |
|
|
|
<resultMap id="BaseResultMap" type="com.iformall.domain.po.WxScoreHistory"> |
|
|
|
<id column="id" jdbcType="BIGINT" property="id" /> |
|
|
|
<result column="tenant_id" jdbcType="VARCHAR" property="tenantId" /> |
|
|
|
<result column="c_user_id" jdbcType="BIGINT" property="cUserId" /> |
|
|
|
<result column="create_date" jdbcType="TIMESTAMP" property="createDate" /> |
|
|
|
<result column="valid_date" jdbcType="TIMESTAMP" property="validDate" /> |
|
|
|
<result column="order_id" jdbcType="BIGINT" property="orderId" /> |
|
|
|
<result column="pay_type" jdbcType="INTEGER" property="payType" /> |
|
|
|
<result column="pay_amount" jdbcType="DECIMAL" property="payAmount" /> |
|
|
|
<result column="score_amount" jdbcType="INTEGER" property="scoreAmount" /> |
|
|
|
</resultMap> |
|
|
|
|
|
|
|
<sql id="allColumns"> |
|
|
|
`id`,`tenant_id`,`c_user_id`,`create_date`,`valid_date`,`order_id`,`pay_type`,`pay_amount`,`score_amount` |
|
|
|
</sql> |
|
|
|
<resultMap id="BaseResultMap" type="com.iformall.domain.po.WxScoreHistory"> |
|
|
|
<id column="id" jdbcType="BIGINT" property="id"/> |
|
|
|
<result column="tenant_id" jdbcType="VARCHAR" property="tenantId"/> |
|
|
|
<result column="c_user_id" jdbcType="BIGINT" property="cUserId"/> |
|
|
|
<result column="create_date" jdbcType="TIMESTAMP" property="createDate"/> |
|
|
|
<result column="score_type" jdbcType="INTEGER" property="scoreType"/> |
|
|
|
<result column="valid_date" jdbcType="TIMESTAMP" property="validDate"/> |
|
|
|
<result column="order_id" jdbcType="BIGINT" property="orderId"/> |
|
|
|
<result column="pay_type" jdbcType="INTEGER" property="payType"/> |
|
|
|
<result column="pay_amount" jdbcType="INTEGER" property="payAmount"/> |
|
|
|
<result column="score_amount" jdbcType="INTEGER" property="scoreAmount"/> |
|
|
|
</resultMap> |
|
|
|
|
|
|
|
<sql id="dynamicWhereConditions"> |
|
|
|
where 1 = 1 |
|
|
|
|
|
|
|
<if test=" null != id "> |
|
|
|
and `id` = #{id} |
|
|
|
|
|
|
|
</if> |
|
|
|
|
|
|
|
<if test=" null != tenantId "> |
|
|
|
and `tenant_id` = #{tenantId} |
|
|
|
|
|
|
|
</if> |
|
|
|
|
|
|
|
<if test=" null != cUserId "> |
|
|
|
and `c_user_id` = #{cUserId} |
|
|
|
|
|
|
|
</if> |
|
|
|
|
|
|
|
<if test=" null != createDate "> |
|
|
|
and `create_date` = #{createDate} |
|
|
|
|
|
|
|
</if> |
|
|
|
|
|
|
|
<if test=" null != validDate "> |
|
|
|
and `valid_date` = #{validDate} |
|
|
|
|
|
|
|
</if> |
|
|
|
|
|
|
|
<if test=" null != orderId "> |
|
|
|
and `order_id` = #{orderId} |
|
|
|
|
|
|
|
</if> |
|
|
|
|
|
|
|
<if test=" null != payType "> |
|
|
|
and `pay_type` = #{payType} |
|
|
|
|
|
|
|
</if> |
|
|
|
|
|
|
|
<if test=" null != payAmount "> |
|
|
|
and `pay_amount` = #{payAmount} |
|
|
|
|
|
|
|
</if> |
|
|
|
|
|
|
|
<if test=" null != scoreAmount "> |
|
|
|
and `score_amount` = #{scoreAmount} |
|
|
|
|
|
|
|
</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> |
|
|
|
<sql id="allColumns"> |
|
|
|
`id`,`tenant_id`,`c_user_id`,`create_date`,`score_type`,`valid_date`,`order_id`,`pay_type`,`pay_amount`,`score_amount` |
|
|
|
</sql> |
|
|
|
|
|
|
|
<select id="findList" parameterType="com.iformall.domain.po.WxScoreHistory" resultMap="BaseResultMap"> |
|
|
|
select <include refid="allColumns" /> from wx_score_history |
|
|
|
<include refid="dynamicWhereConditions" /> |
|
|
|
</select> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<sql id="dynamicWhereConditions"> |
|
|
|
where 1 = 1 |
|
|
|
|
|
|
|
<if test=" null != id "> |
|
|
|
and `id` = #{id} |
|
|
|
</if> |
|
|
|
|
|
|
|
<if test=" null != tenantId "> |
|
|
|
and `tenant_id` = #{tenantId} |
|
|
|
</if> |
|
|
|
|
|
|
|
<if test=" null != cUserId "> |
|
|
|
and `c_user_id` = #{cUserId} |
|
|
|
</if> |
|
|
|
|
|
|
|
<if test=" null != createDate "> |
|
|
|
and `create_date` = #{createDate} |
|
|
|
</if> |
|
|
|
|
|
|
|
<if test=" null != scoreType "> |
|
|
|
and `score_type` = #{scoreType} |
|
|
|
</if> |
|
|
|
|
|
|
|
<if test=" null != validDate "> |
|
|
|
and `valid_date` = #{validDate} |
|
|
|
</if> |
|
|
|
|
|
|
|
<if test=" null != orderId "> |
|
|
|
and `order_id` = #{orderId} |
|
|
|
</if> |
|
|
|
|
|
|
|
<if test=" null != payType "> |
|
|
|
and `pay_type` = #{payType} |
|
|
|
</if> |
|
|
|
|
|
|
|
<if test=" null != payAmount "> |
|
|
|
and `pay_amount` = #{payAmount} |
|
|
|
</if> |
|
|
|
|
|
|
|
<if test=" null != scoreAmount "> |
|
|
|
and `score_amount` = #{scoreAmount} |
|
|
|
</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> |
|
|
|
</sql> |
|
|
|
|
|
|
|
<select id="findList" parameterType="com.iformall.domain.po.WxScoreHistory" resultMap="BaseResultMap"> |
|
|
|
select |
|
|
|
<include refid="allColumns"/> |
|
|
|
from wx_score_history |
|
|
|
<include refid="dynamicWhereConditions"/> |
|
|
|
</select> |
|
|
|
|
|
|
|
|
|
|
|
</mapper> |