admin
2024-09-27 17caebabf7a6a529b7039c71e21e5a324e31ea20
src/main/resources/mapper/WxUserOrderCountMapper.xml
@@ -1,82 +1,83 @@
<?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.taoke.autopay.dao.WxUserOrderCountMapper">
  <resultMap id="BaseResultMap" type="com.taoke.autopay.entity.WxUserOrderCount">
    <id column="id" property="id" jdbcType="VARCHAR"/>
    <result column="day" property="day" jdbcType="VARCHAR"/>
    <result column="uid" property="uid" jdbcType="BIGINT"/>
    <result column="order_count" property="orderCount" jdbcType="VARCHAR"/>
    <result column="order_type" property="orderType" jdbcType="VARCHAR"/>
    <result column="create_time" property="createTime" jdbcType="TIMESTAMP"/>
<mapper namespace="com.taoke.autopay.dao.WxUserOrderCountMapper">
  <resultMap id="BaseResultMap" type="com.taoke.autopay.entity.WxUserOrderCount">
    <id column="id" property="id" jdbcType="VARCHAR"/>
    <result column="day" property="day" jdbcType="VARCHAR"/>
    <result column="uid" property="uid" jdbcType="BIGINT"/>
    <result column="order_count" property="orderCount" jdbcType="VARCHAR"/>
    <result column="order_type" property="orderType" jdbcType="VARCHAR"/>
    <result column="create_time" property="createTime" jdbcType="TIMESTAMP"/>
    <result column="update_time" property="updateTime" jdbcType="TIMESTAMP"/>
  </resultMap>
  <sql id="Base_Column_List">id,day,uid,order_count,order_type,create_time,update_time</sql>
  <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Long">select
    <result column="order_channel" property="orderChannel" jdbcType="VARCHAR"/>
  </resultMap>
  <sql id="Base_Column_List">id,day,uid,order_count,order_type,create_time,update_time,order_channel</sql>
  <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Long">select
    <include refid="Base_Column_List"/> from table_wx_user_order_count where id = #{id,jdbcType=BIGINT}
  </select>
  <select id="selectByPrimaryKeyForUpdate" resultMap="BaseResultMap" parameterType="java.lang.String">select
  </select>
  <select id="selectByPrimaryKeyForUpdate" resultMap="BaseResultMap" parameterType="java.lang.String">select
    <include refid="Base_Column_List"/> from table_wx_user_order_count where id = #{id,jdbcType=VARCHAR} for update
  </select>
  <sql id="listWhereSQL">
    <if test="query.id!=null">AND id = #{query.id}</if>
    <if test="query.day!=null">AND day = #{query.day}</if>
    <if test="query.uid!=null">AND uid = #{query.uid}</if>
    <if test="query.orderCount!=null">AND order_count = #{query.orderCount}</if>
  </select>
  <sql id="listWhereSQL">
    <if test="query.id!=null">AND id = #{query.id}</if>
    <if test="query.day!=null">AND day = #{query.day}</if>
    <if test="query.uid!=null">AND uid = #{query.uid}</if>
    <if test="query.orderCount!=null">AND order_count = #{query.orderCount}</if>
    <if test="query.orderType!=null">AND order_type = #{query.orderType}</if>
    <if test="query.minCreateTime!=null">AND create_time >= #{query.minCreateTime}</if>
    <if test="query.maxCreateTime!=null">AND #{query.maxCreateTime} > create_time</if>
    <if test="query.minUpdateTime!=null">AND update_time >= #{query.minUpdateTime}</if>
    <if test="query.maxUpdateTime!=null">AND #{query.maxUpdateTime} > update_time</if>
  </sql>
  <select id="list" resultMap="BaseResultMap">select
    <include refid="Base_Column_List"/> from table_wx_user_order_count where 1=1
    <include refid="listWhereSQL"/>
    <if test="query.sortList!=null">
      <foreach collection="query.sortList" item="item" open=" order by " separator=",">#{item}</foreach>
    <if test="query.orderChannel!=null">AND order_channel = #{query.orderChannel}</if>
    <if test="query.minCreateTime!=null">AND create_time &gt;= #{query.minCreateTime}</if>
    <if test="query.maxCreateTime!=null">AND #{query.maxCreateTime} &gt; create_time</if>
    <if test="query.minUpdateTime!=null">AND update_time &gt;= #{query.minUpdateTime}</if>
    <if test="query.maxUpdateTime!=null">AND #{query.maxUpdateTime} &gt; update_time</if>
  </sql>
  <select id="list" resultMap="BaseResultMap">select
    <include refid="Base_Column_List"/> from table_wx_user_order_count where 1=1
    <include refid="listWhereSQL"/>
    <if test="query.sortList!=null">
      <foreach collection="query.sortList" item="item" open=" order by " separator=",">#{item}</foreach>
    </if>limit #{query.start},#{query.count}
  </select>
  <select id="count" resultType="java.lang.Long">select count(*) from table_wx_user_order_count where 1=1
  <include refid="listWhereSQL"/>
</select>
  <select id="sumOrderCount" resultType="java.lang.Long">select sum(order_count) from table_wx_user_order_count where 1=1
    <include refid="listWhereSQL"/>
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">delete from table_wx_user_order_count where id = #{id,jdbcType=BIGINT}</delete>
  <insert id="insert" parameterType="com.taoke.autopay.entity.WxUserOrderCount" useGeneratedKeys="true" keyProperty="id">insert into table_wx_user_order_count (id,day,uid,order_count,order_type,create_time,update_time) values (#{id,jdbcType=VARCHAR},#{day,jdbcType=VARCHAR},#{uid,jdbcType=BIGINT},#{orderCount,jdbcType=VARCHAR},#{orderType,jdbcType=VARCHAR},#{createTime,jdbcType=TIMESTAMP},#{updateTime,jdbcType=TIMESTAMP})</insert>
  <insert id="insertSelective" parameterType="com.taoke.autopay.entity.WxUserOrderCount" useGeneratedKeys="true" keyProperty="id">insert into table_wx_user_order_count
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="id != null">id,</if>
      <if test="day != null">day,</if>
      <if test="uid != null">uid,</if>
      <if test="orderCount != null">order_count,</if>
      <if test="orderType != null">order_type,</if>
      <if test="createTime != null">create_time,</if>
      <if test="updateTime != null">update_time,</if>
    </trim>values
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="id != null">#{id,jdbcType=VARCHAR},</if>
      <if test="day != null">#{day,jdbcType=VARCHAR},</if>
      <if test="uid != null">#{uid,jdbcType=BIGINT},</if>
      <if test="orderCount != null">#{orderCount,jdbcType=VARCHAR},</if>
      <if test="orderType != null">#{orderType,jdbcType=VARCHAR},</if>
      <if test="createTime != null">#{createTime,jdbcType=TIMESTAMP},</if>
      <if test="updateTime != null">#{updateTime,jdbcType=TIMESTAMP},</if>
    </trim>
  </insert>
  <update id="updateByPrimaryKey" parameterType="com.taoke.autopay.entity.WxUserOrderCount">update table_wx_user_order_count set day = #{day,jdbcType=VARCHAR},uid = #{uid,jdbcType=BIGINT},order_count = #{orderCount,jdbcType=VARCHAR},order_type = #{orderType,jdbcType=VARCHAR},create_time = #{createTime,jdbcType=TIMESTAMP},update_time = #{updateTime,jdbcType=TIMESTAMP} where id = #{id,jdbcType=VARCHAR}</update>
  <update id="updateByPrimaryKeySelective" parameterType="com.taoke.autopay.entity.WxUserOrderCount">update table_wx_user_order_count
    <set>
  </select>
  <select id="count" resultType="java.lang.Long">select count(*) from table_wx_user_order_count where 1=1
    <include refid="listWhereSQL"/>
  </select>
  <select id="sumOrderCount" resultType="java.lang.Long">select sum(order_count) from table_wx_user_order_count where 1=1
    <include refid="listWhereSQL"/>
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">delete from table_wx_user_order_count where id = #{id,jdbcType=BIGINT}</delete>
  <insert id="insert" parameterType="com.taoke.autopay.entity.WxUserOrderCount" useGeneratedKeys="true" keyProperty="id">insert into table_wx_user_order_count (id,day,uid,order_count,order_type,create_time,update_time,order_channel) values (#{id,jdbcType=VARCHAR},#{day,jdbcType=VARCHAR},#{uid,jdbcType=BIGINT},#{orderCount,jdbcType=VARCHAR},#{orderType,jdbcType=VARCHAR},#{createTime,jdbcType=TIMESTAMP},#{updateTime,jdbcType=TIMESTAMP},#{orderChannel,jdbcType=VARCHAR})</insert>
  <insert id="insertSelective" parameterType="com.taoke.autopay.entity.WxUserOrderCount" useGeneratedKeys="true" keyProperty="id">insert into table_wx_user_order_count
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="id != null">id,</if>
      <if test="day != null">day,</if>
      <if test="uid != null">uid,</if>
      <if test="orderCount != null">order_count,</if>
      <if test="orderType != null">order_type,</if>
      <if test="createTime != null">create_time,</if>
      <if test="updateTime != null">update_time,</if>
      <if test="orderChannel != null">order_channel,</if>
    </trim>values
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="id != null">#{id,jdbcType=VARCHAR},</if>
      <if test="day != null">#{day,jdbcType=VARCHAR},</if>
      <if test="uid != null">#{uid,jdbcType=BIGINT},</if>
      <if test="orderCount != null">#{orderCount,jdbcType=VARCHAR},</if>
      <if test="orderType != null">#{orderType,jdbcType=VARCHAR},</if>
      <if test="createTime != null">#{createTime,jdbcType=TIMESTAMP},</if>
      <if test="updateTime != null">#{updateTime,jdbcType=TIMESTAMP},</if>
      <if test="orderChannel != null">#{orderChannel,jdbcType=VARCHAR}</if>
    </trim>
  </insert>
  <update id="updateByPrimaryKey" parameterType="com.taoke.autopay.entity.WxUserOrderCount">update table_wx_user_order_count set day = #{day,jdbcType=VARCHAR},uid = #{uid,jdbcType=BIGINT},order_count = #{orderCount,jdbcType=VARCHAR},order_type = #{orderType,jdbcType=VARCHAR},create_time = #{createTime,jdbcType=TIMESTAMP},update_time = #{updateTime,jdbcType=TIMESTAMP} ,order_channel =#{orderChannel,jdbcType=VARCHAR} where id = #{id,jdbcType=VARCHAR}</update>
  <update id="updateByPrimaryKeySelective" parameterType="com.taoke.autopay.entity.WxUserOrderCount">update table_wx_user_order_count
    <set>
      <if test="day != null">day=#{day,jdbcType=VARCHAR},</if>
      <if test="uid != null">uid=#{uid,jdbcType=BIGINT},</if>
      <if test="orderCount != null">order_count=#{orderCount,jdbcType=VARCHAR},</if>
      <if test="orderType != null">order_type=#{orderType,jdbcType=VARCHAR},</if>
      <if test="createTime != null">create_time=#{createTime,jdbcType=TIMESTAMP},</if>
      <if test="updateTime != null">update_time=#{updateTime,jdbcType=TIMESTAMP},</if>
      <if test="orderChannel !=null">order_channel =#{orderChannel,jdbcType=VARCHAR},</if>
    </set> where id = #{id,jdbcType=VARCHAR}
  </update>
  </update>
</mapper>