MassConditionMapper.xml 4.83 KB
<?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="cn.com.glsx.entmicro.mapper.MassConditionMapper">
  <resultMap id="BaseResultMap" type="cn.com.glsx.entmicro.entity.MassCondition">
    <!--@Table scrm_mass_condition-->
    <id column="id" jdbcType="INTEGER" property="id" />
    <result column="mass_id" jdbcType="INTEGER" property="massId" />
    <result column="sex" jdbcType="TINYINT" property="sex" />
    <result column="chat_id" jdbcType="VARCHAR" property="chatId" />
    <result column="start_time" jdbcType="TIMESTAMP" property="startTime" />
    <result column="end_time" jdbcType="TIMESTAMP" property="endTime" />
    <result column="tag_id" jdbcType="VARCHAR" property="tagId" />
    <result column="del_flag" jdbcType="TINYINT" property="delFlag" />
  </resultMap>
  <resultMap id="ResultMap" type="cn.com.glsx.entmicro.model.response.MassConditionResponse"
        extends="BaseResultMap">
  </resultMap>
  <sql id="Base_Column_List">
    id, mass_id, sex, chat_id, start_time, end_time, tag_id, del_flag
  </sql>
  <!--<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
    select
    <include refid="Base_Column_List" />
    from scrm_mass_condition
    where id = #{id,jdbcType=INTEGER}
  </select>
  <select id="selectByMassId" parameterType="java.lang.Integer" resultMap="ResultMap">
    select <include refid="Base_Column_List" /> from scrm_mass_condition
    where mass_id = #{id,jdbcType=INTEGER} and del_flag = 0 limit 1
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
    delete from scrm_mass_condition
    where id = #{id,jdbcType=INTEGER}
  </delete>
  <insert id="insert" keyColumn="id" keyProperty="id" parameterType="cn.com.glsx.entmicro.entity.MassCondition" useGeneratedKeys="true">
    insert into scrm_mass_condition (mass_id, sex, chat_id,
      start_time, end_time, tag_id, 
      del_flag)
    values (#{massId,jdbcType=INTEGER}, #{sex,jdbcType=TINYINT}, #{chatId,jdbcType=VARCHAR}, 
      #{startTime,jdbcType=TIMESTAMP}, #{endTime,jdbcType=TIMESTAMP}, #{tagId,jdbcType=VARCHAR}, 
      #{delFlag,jdbcType=TINYINT})
  </insert>
  <insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="cn.com.glsx.entmicro.entity.MassCondition" useGeneratedKeys="true">
    insert into scrm_mass_condition
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="massId != null">
        mass_id,
      </if>
      <if test="sex != null">
        sex,
      </if>
      <if test="chatId != null">
        chat_id,
      </if>
      <if test="startTime != null">
        start_time,
      </if>
      <if test="endTime != null">
        end_time,
      </if>
      <if test="tagId != null">
        tag_id,
      </if>
      <if test="delFlag != null">
        del_flag,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides=",">
      <if test="massId != null">
        #{massId,jdbcType=INTEGER},
      </if>
      <if test="sex != null">
        #{sex,jdbcType=TINYINT},
      </if>
      <if test="chatId != null">
        #{chatId,jdbcType=VARCHAR},
      </if>
      <if test="startTime != null">
        #{startTime,jdbcType=TIMESTAMP},
      </if>
      <if test="endTime != null">
        #{endTime,jdbcType=TIMESTAMP},
      </if>
      <if test="tagId != null">
        #{tagId,jdbcType=VARCHAR},
      </if>
      <if test="delFlag != null">
        #{delFlag,jdbcType=TINYINT},
      </if>
    </trim>
  </insert>
  <update id="updateByPrimaryKeySelective" parameterType="cn.com.glsx.entmicro.entity.MassCondition">
    update scrm_mass_condition
    <set>
      <if test="massId != null">
        mass_id = #{massId,jdbcType=INTEGER},
      </if>
      <if test="sex != null">
        sex = #{sex,jdbcType=TINYINT},
      </if>
      <if test="chatId != null">
        chat_id = #{chatId,jdbcType=VARCHAR},
      </if>
      <if test="startTime != null">
        start_time = #{startTime,jdbcType=TIMESTAMP},
      </if>
      <if test="endTime != null">
        end_time = #{endTime,jdbcType=TIMESTAMP},
      </if>
      <if test="tagId != null">
        tag_id = #{tagId,jdbcType=VARCHAR},
      </if>
      <if test="delFlag != null">
        del_flag = #{delFlag,jdbcType=TINYINT},
      </if>
    </set>
    where id = #{id,jdbcType=INTEGER}
  </update>
  <update id="updateByPrimaryKey" parameterType="cn.com.glsx.entmicro.entity.MassCondition">
    update scrm_mass_condition
    set mass_id = #{massId,jdbcType=INTEGER},
      sex = #{sex,jdbcType=TINYINT},
      chat_id = #{chatId,jdbcType=VARCHAR},
      start_time = #{startTime,jdbcType=TIMESTAMP},
      end_time = #{endTime,jdbcType=TIMESTAMP},
      tag_id = #{tagId,jdbcType=VARCHAR},
      del_flag = #{delFlag,jdbcType=TINYINT}
    where id = #{id,jdbcType=INTEGER}
  </update>-->
</mapper>