| | |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | |
| | | <mapper namespace="com.ks.vip.mapper.VipCenterRecordMapper"> |
| | | <resultMap id="BaseResultMap" type="com.ks.vip.pojo.DO.VipCenterRecord"> |
| | | <id column="r_id" property="id" jdbcType="BIGINT"/> |
| | | <result column="r_uid" property="uid" jdbcType="VARCHAR"/> |
| | | <result column="r_order_id" property="orderId" jdbcType="BIGINT"/> |
| | | <result column="r_grade_id" property="gradeId" jdbcType="BIGINT"/> |
| | | <result column="r_start_time" property="startTime" jdbcType="TIMESTAMP"/> |
| | | <result column="r_end_time" property="endTime" jdbcType="TIMESTAMP"/> |
| | | <result column="r_state" property="state" jdbcType="INTEGER"/> |
| | | <result column="r_creator_id" property="creatorId" jdbcType="BIGINT"/> |
| | | <result column="r_create_time" property="createTime" jdbcType="TIMESTAMP"/> |
| | | <result column="r_updator_id" property="updatorId" jdbcType="BIGINT"/> |
| | | <result column="r_update_time" property="updateTime" jdbcType="TIMESTAMP"/> |
| | | </resultMap> |
| | | <sql id="Base_Column_List">r_id,r_uid,r_order_id,r_grade_id,r_start_time,r_end_time,r_state,r_creator_id,r_create_time,r_updator_id,r_update_time</sql> |
| | | <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Long">select |
| | | <include refid="Base_Column_List"/>from vip_center_record where r_id = #{id,jdbcType=BIGINT} |
| | | </select> |
| | | <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">delete from vip_center_record where r_id = #{id,jdbcType=BIGINT}</delete> |
| | | <insert id="insert" parameterType="com.ks.vip.pojo.DO.VipCenterRecord" useGeneratedKeys="true" keyProperty="id">insert into vip_center_record (r_id,r_uid,r_order_id,r_grade_id,r_start_time,r_end_time,r_state,r_creator_id,r_create_time,r_updator_id,r_update_time) values (#{id,jdbcType=BIGINT},#{uid,jdbcType=VARCHAR},#{orderId,jdbcType=BIGINT},#{gradeId,jdbcType=BIGINT},#{startTime,jdbcType=TIMESTAMP},#{endTime,jdbcType=TIMESTAMP},#{state,jdbcType=INTEGER},#{creatorId,jdbcType=BIGINT},#{createTime,jdbcType=TIMESTAMP},#{updatorId,jdbcType=BIGINT},#{updateTime,jdbcType=TIMESTAMP})</insert> |
| | | <insert id="insertSelective" parameterType="com.ks.vip.pojo.DO.VipCenterRecord" useGeneratedKeys="true" keyProperty="id">insert into vip_center_record |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | | <if test="id != null">r_id,</if> |
| | | <if test="uid != null">r_uid,</if> |
| | | <if test="orderId != null">r_order_id,</if> |
| | | <if test="gradeId != null">r_grade_id,</if> |
| | | <if test="startTime != null">r_start_time,</if> |
| | | <if test="endTime != null">r_end_time,</if> |
| | | <if test="state != null">r_state,</if> |
| | | <if test="creatorId != null">r_creator_id,</if> |
| | | <if test="createTime != null">r_create_time,</if> |
| | | <if test="updatorId != null">r_updator_id,</if> |
| | | <if test="updateTime != null">r_update_time,</if> |
| | | </trim>values |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | | <if test="id != null">#{id,jdbcType=BIGINT},</if> |
| | | <if test="uid != null">#{uid,jdbcType=VARCHAR},</if> |
| | | <if test="orderId != null">#{orderId,jdbcType=BIGINT},</if> |
| | | <if test="gradeId != null">#{gradeId,jdbcType=BIGINT},</if> |
| | | <if test="startTime != null">#{startTime,jdbcType=TIMESTAMP},</if> |
| | | <if test="endTime != null">#{endTime,jdbcType=TIMESTAMP},</if> |
| | | <if test="state != null">#{state,jdbcType=INTEGER},</if> |
| | | <if test="creatorId != null">#{creatorId,jdbcType=BIGINT},</if> |
| | | <if test="createTime != null">#{createTime,jdbcType=TIMESTAMP},</if> |
| | | <if test="updatorId != null">#{updatorId,jdbcType=BIGINT},</if> |
| | | <if test="updateTime != null">#{updateTime,jdbcType=TIMESTAMP},</if> |
| | | </trim> |
| | | </insert> |
| | | <update id="updateByPrimaryKey" parameterType="com.ks.vip.pojo.DO.VipCenterRecord">update vip_center_record set r_uid = #{uid,jdbcType=VARCHAR},r_order_id = #{orderId,jdbcType=BIGINT},r_grade_id = #{gradeId,jdbcType=BIGINT},r_start_time = #{startTime,jdbcType=TIMESTAMP},r_end_time = #{endTime,jdbcType=TIMESTAMP},r_state = #{state,jdbcType=INTEGER},r_creator_id = #{creatorId,jdbcType=BIGINT},r_create_time = #{createTime,jdbcType=TIMESTAMP},r_updator_id = #{updatorId,jdbcType=BIGINT},r_update_time = #{updateTime,jdbcType=TIMESTAMP} where r_id = #{id,jdbcType=BIGINT}</update> |
| | | <update id="updateByPrimaryKeySelective" parameterType="com.ks.vip.pojo.DO.VipCenterRecord">update vip_center_record |
| | | <set> |
| | | <if test="uid != null">r_uid=#{uid,jdbcType=VARCHAR},</if> |
| | | <if test="orderId != null">r_order_id=#{orderId,jdbcType=BIGINT},</if> |
| | | <if test="gradeId != null">r_grade_id=#{gradeId,jdbcType=BIGINT},</if> |
| | | <if test="startTime != null">r_start_time=#{startTime,jdbcType=TIMESTAMP},</if> |
| | | <if test="endTime != null">r_end_time=#{endTime,jdbcType=TIMESTAMP},</if> |
| | | <if test="state != null">r_state=#{state,jdbcType=INTEGER},</if> |
| | | <if test="creatorId != null">r_creator_id=#{creatorId,jdbcType=BIGINT},</if> |
| | | <if test="createTime != null">r_create_time=#{createTime,jdbcType=TIMESTAMP},</if> |
| | | <if test="updatorId != null">r_updator_id=#{updatorId,jdbcType=BIGINT},</if> |
| | | <if test="updateTime != null">r_update_time=#{updateTime,jdbcType=TIMESTAMP},</if> |
| | | </set> where r_id = #{id,jdbcType=BIGINT} |
| | | </update> |
| | | <resultMap id="BaseResultMap" type="com.ks.vip.pojo.DO.VipCenterRecord"> |
| | | <id column="r_id" property="id" jdbcType="BIGINT"/> |
| | | <result column="r_uid" property="uid" jdbcType="VARCHAR"/> |
| | | <result column="r_order_id" property="orderId" jdbcType="BIGINT"/> |
| | | <result column="r_grade_id" property="gradeId" jdbcType="BIGINT"/> |
| | | <result column="r_start_time" property="startTime" jdbcType="TIMESTAMP"/> |
| | | <result column="r_end_time" property="endTime" jdbcType="TIMESTAMP"/> |
| | | <result column="r_state" property="state" jdbcType="INTEGER"/> |
| | | <result column="r_creator_id" property="creatorId" jdbcType="BIGINT"/> |
| | | <result column="r_create_time" property="createTime" jdbcType="TIMESTAMP"/> |
| | | <result column="r_updator_id" property="updatorId" jdbcType="BIGINT"/> |
| | | <result column="r_update_time" property="updateTime" jdbcType="TIMESTAMP"/> |
| | | </resultMap> |
| | | <sql id="Base_Column_List">r_id,r_uid,r_order_id,r_grade_id,r_start_time,r_end_time,r_state,r_creator_id,r_create_time,r_updator_id,r_update_time</sql> |
| | | <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Long">select |
| | | <include refid="Base_Column_List"/>from vip_center_record where r_id = #{id,jdbcType=BIGINT} |
| | | </select> |
| | | |
| | | |
| | | <select id="list" resultMap="BaseResultMap"> |
| | | select |
| | | <include refid="Base_Column_List"/>from vip_center_record where 1=1 |
| | | |
| | | <if test="query.uid!=null"> |
| | | AND r_uid= #{query.uid} |
| | | </if> |
| | | |
| | | <if test="query.date!=null"> |
| | | AND #{query.date}>=r_start_time AND r_end_time>#{query.date}; |
| | | </if> |
| | | </select> |
| | | |
| | | |
| | | <delete id="deleteByPrimaryKey" |
| | | parameterType="java.lang.Long">delete from vip_center_record where r_id = #{id,jdbcType=BIGINT}</delete> |
| | | <insert id="insert" parameterType="com.ks.vip.pojo.DO.VipCenterRecord" useGeneratedKeys="true" |
| | | keyProperty="id">insert into vip_center_record (r_id,r_uid,r_order_id,r_grade_id,r_start_time,r_end_time,r_state,r_creator_id,r_create_time,r_updator_id,r_update_time) values (#{id,jdbcType=BIGINT},#{uid,jdbcType=VARCHAR},#{orderId,jdbcType=BIGINT},#{gradeId,jdbcType=BIGINT},#{startTime,jdbcType=TIMESTAMP},#{endTime,jdbcType=TIMESTAMP},#{state,jdbcType=INTEGER},#{creatorId,jdbcType=BIGINT},#{createTime,jdbcType=TIMESTAMP},#{updatorId,jdbcType=BIGINT},#{updateTime,jdbcType=TIMESTAMP})</insert> |
| | | <insert id="insertSelective" parameterType="com.ks.vip.pojo.DO.VipCenterRecord" useGeneratedKeys="true" |
| | | keyProperty="id">insert into vip_center_record |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | | <if test="id != null">r_id,</if> |
| | | <if test="uid != null">r_uid,</if> |
| | | <if test="orderId != null">r_order_id,</if> |
| | | <if test="gradeId != null">r_grade_id,</if> |
| | | <if test="startTime != null">r_start_time,</if> |
| | | <if test="endTime != null">r_end_time,</if> |
| | | <if test="state != null">r_state,</if> |
| | | <if test="creatorId != null">r_creator_id,</if> |
| | | <if test="createTime != null">r_create_time,</if> |
| | | <if test="updatorId != null">r_updator_id,</if> |
| | | <if test="updateTime != null">r_update_time,</if> |
| | | </trim> |
| | | values |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | | <if test="id != null">#{id,jdbcType=BIGINT},</if> |
| | | <if test="uid != null">#{uid,jdbcType=VARCHAR},</if> |
| | | <if test="orderId != null">#{orderId,jdbcType=BIGINT},</if> |
| | | <if test="gradeId != null">#{gradeId,jdbcType=BIGINT},</if> |
| | | <if test="startTime != null">#{startTime,jdbcType=TIMESTAMP},</if> |
| | | <if test="endTime != null">#{endTime,jdbcType=TIMESTAMP},</if> |
| | | <if test="state != null">#{state,jdbcType=INTEGER},</if> |
| | | <if test="creatorId != null">#{creatorId,jdbcType=BIGINT},</if> |
| | | <if test="createTime != null">#{createTime,jdbcType=TIMESTAMP},</if> |
| | | <if test="updatorId != null">#{updatorId,jdbcType=BIGINT},</if> |
| | | <if test="updateTime != null">#{updateTime,jdbcType=TIMESTAMP},</if> |
| | | </trim> |
| | | </insert> |
| | | <update id="updateByPrimaryKey" |
| | | parameterType="com.ks.vip.pojo.DO.VipCenterRecord">update vip_center_record set r_uid = #{uid,jdbcType=VARCHAR},r_order_id = #{orderId,jdbcType=BIGINT},r_grade_id = #{gradeId,jdbcType=BIGINT},r_start_time = #{startTime,jdbcType=TIMESTAMP},r_end_time = #{endTime,jdbcType=TIMESTAMP},r_state = #{state,jdbcType=INTEGER},r_creator_id = #{creatorId,jdbcType=BIGINT},r_create_time = #{createTime,jdbcType=TIMESTAMP},r_updator_id = #{updatorId,jdbcType=BIGINT},r_update_time = #{updateTime,jdbcType=TIMESTAMP} where r_id = #{id,jdbcType=BIGINT}</update> |
| | | <update id="updateByPrimaryKeySelective" parameterType="com.ks.vip.pojo.DO.VipCenterRecord">update vip_center_record |
| | | <set> |
| | | <if test="uid != null">r_uid=#{uid,jdbcType=VARCHAR},</if> |
| | | <if test="orderId != null">r_order_id=#{orderId,jdbcType=BIGINT},</if> |
| | | <if test="gradeId != null">r_grade_id=#{gradeId,jdbcType=BIGINT},</if> |
| | | <if test="startTime != null">r_start_time=#{startTime,jdbcType=TIMESTAMP},</if> |
| | | <if test="endTime != null">r_end_time=#{endTime,jdbcType=TIMESTAMP},</if> |
| | | <if test="state != null">r_state=#{state,jdbcType=INTEGER},</if> |
| | | <if test="creatorId != null">r_creator_id=#{creatorId,jdbcType=BIGINT},</if> |
| | | <if test="createTime != null">r_create_time=#{createTime,jdbcType=TIMESTAMP},</if> |
| | | <if test="updatorId != null">r_updator_id=#{updatorId,jdbcType=BIGINT},</if> |
| | | <if test="updateTime != null">r_update_time=#{updateTime,jdbcType=TIMESTAMP},</if> |
| | | </set> |
| | | where r_id = #{id,jdbcType=BIGINT} |
| | | </update> |
| | | </mapper> |