<?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.agent.ChannelAgentSharingRatioMapper">
|
<resultMap id="BaseResultMap" type="com.taoke.autopay.entity.agent.ChannelAgentSharingRatio">
|
<id column="_id" property="id" jdbcType="BIGINT"/>
|
<result column="_agent_id" property="agengId" jdbcType="BIGINT"/>
|
<result column="_order_channel" property="orderChannel" jdbcType="VARCHAR"/>
|
<result column="_share_type" property="shareType" jdbcType="INTEGER"/>
|
<result column="_share_value" property="shareValue" jdbcType="DECIMAL"/>
|
<result column="_create_time" property="createTime" jdbcType="TIMESTAMP"/>
|
<result column="_update_time" property="updateTime" jdbcType="TIMESTAMP"/>
|
</resultMap>
|
<sql id="Base_Column_List">_id,_agent_id,_order_channel,_share_type,_share_value,_create_time,_update_time</sql>
|
<select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Long">select
|
<include refid="Base_Column_List"/> from table_agent_sharing_ratio where _id = #{id,jdbcType=BIGINT}
|
</select>
|
<select id="selectByPrimaryKeyForUpdate" resultMap="BaseResultMap" parameterType="java.lang.Long">select
|
<include refid="Base_Column_List"/> from table_agent_sharing_ratio where _id = #{id,jdbcType=BIGINT} for update
|
</select>
|
<sql id="listWhereSQL">
|
<if test="query.id!=null">AND _id = #{query.id}</if>
|
<if test="query.agengId!=null">AND _agent_id = #{query.agengId}</if>
|
<if test="query.orderChannel!=null">AND _order_channel = #{query.orderChannel}</if>
|
<if test="query.shareType!=null">AND _share_type = #{query.shareType}</if>
|
<if test="query.shareValue!=null">AND _share_value = #{query.shareValue}</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_agent_sharing_ratio 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_agent_sharing_ratio where 1=1
|
<include refid="listWhereSQL"/>
|
</select>
|
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long">delete from table_agent_sharing_ratio where _id = #{id,jdbcType=BIGINT}</delete>
|
<insert id="insert" parameterType="com.taoke.autopay.entity.agent.ChannelAgentSharingRatio" useGeneratedKeys="true" keyProperty="id">insert into table_agent_sharing_ratio (_id,_agent_id,_order_channel,_share_type,_share_value,_create_time,_update_time) values (#{id,jdbcType=BIGINT},#{agengId,jdbcType=BIGINT},#{orderChannel,jdbcType=VARCHAR},#{shareType,jdbcType=INTEGER},#{shareValue,jdbcType=DECIMAL},#{createTime,jdbcType=TIMESTAMP},#{updateTime,jdbcType=TIMESTAMP})</insert>
|
<insert id="insertSelective" parameterType="com.taoke.autopay.entity.agent.ChannelAgentSharingRatio" useGeneratedKeys="true" keyProperty="id">insert into table_agent_sharing_ratio
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
<if test="id != null">_id,</if>
|
<if test="agengId != null">_agent_id,</if>
|
<if test="orderChannel != null">_order_channel,</if>
|
<if test="shareType != null">_share_type,</if>
|
<if test="shareValue != null">_share_value,</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=BIGINT},</if>
|
<if test="agengId != null">#{agengId,jdbcType=BIGINT},</if>
|
<if test="orderChannel != null">#{orderChannel,jdbcType=VARCHAR},</if>
|
<if test="shareType != null">#{shareType,jdbcType=INTEGER},</if>
|
<if test="shareValue != null">#{shareValue,jdbcType=DECIMAL},</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.agent.ChannelAgentSharingRatio">update table_agent_sharing_ratio set _agent_id = #{agengId,jdbcType=BIGINT},_order_channel = #{orderChannel,jdbcType=VARCHAR},_share_type = #{shareType,jdbcType=INTEGER},_share_value = #{shareValue,jdbcType=DECIMAL},_create_time = #{createTime,jdbcType=TIMESTAMP},_update_time = #{updateTime,jdbcType=TIMESTAMP} where _id = #{id,jdbcType=BIGINT}</update>
|
<update id="updateByPrimaryKeySelective" parameterType="com.taoke.autopay.entity.agent.ChannelAgentSharingRatio">update table_agent_sharing_ratio
|
<set>
|
<if test="agengId != null">_agent_id=#{agengId,jdbcType=BIGINT},</if>
|
<if test="orderChannel != null">_order_channel=#{orderChannel,jdbcType=VARCHAR},</if>
|
<if test="shareType != null">_share_type=#{shareType,jdbcType=INTEGER},</if>
|
<if test="shareValue != null">_share_value=#{shareValue,jdbcType=DECIMAL},</if>
|
<if test="createTime != null">_create_time=#{createTime,jdbcType=TIMESTAMP},</if>
|
<if test="updateTime != null">_update_time=#{updateTime,jdbcType=TIMESTAMP},</if>
|
</set> where _id = #{id,jdbcType=BIGINT}
|
</update>
|
</mapper>
|