|
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122 |
- <?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="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"/>
- <result column="reason" jdbcType="VARCHAR" property="reason"/>
- </resultMap>
-
- <sql id="allColumns">
- `id`,`tenant_id`,`c_user_id`,`create_date`,`score_type`,`valid_date`,`order_id`,`pay_type`,`pay_amount`,`score_amount`,`reason`
- </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 != 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 != reason ">
- and `reason` = #{reason}
- </if>
- <if test=" null != startdate and null!=enddate">
- and `create_date` between #{startdate} and #{enddate}
- </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>
-
- <select id="selectById" parameterType="java.util.HashMap" resultMap="BaseResultMap">
- select <include refid="allColumns"/> from wx_score_history where id = #{id} and tenant_id = #{tenantId}
- </select>
-
- <select id="countTodayList" parameterType="com.iformall.domain.po.WxScoreHistory" resultType="java.lang.Integer">
- select count(1)
- from wx_score_history
- where tenant_id = #{tenantId}
- <if test=" null != cUserId ">
- and `c_user_id` = #{cUserId}
- </if>
- <if test=" null != scoreType ">
- and `score_type` = #{scoreType}
- </if>
- and DATEDIFF(`create_date`,now())=0
- </select>
-
- <select id="countList" parameterType="com.iformall.domain.po.WxScoreHistory" resultType="java.lang.Integer">
- select count(1)
- from wx_score_history
- where 1=1
- <if test=" null != tenantId and '' != tenantId">
- and `tenant_id` = #{tenantId}
- </if>
- <if test=" null != cUserId ">
- and `c_user_id` = #{cUserId}
- </if>
- <if test=" null != scoreType ">
- and `score_type` = #{scoreType}
- </if>
- </select>
-
- <delete id="deleteById" parameterType="java.util.HashMap">
- delete from wx_score_history where id = #{id} and tenant_id = #{tenantId}
- </delete>
-
- </mapper>
|