ABTestTotalMapper.xml 2.6 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="com.monitor.mysql.mapper.ABTestTotalMapper" >
  <resultMap id="BaseResultMap" type="com.model.ABTestTotal" >
    <id column="id" property="id" jdbcType="INTEGER" />
    <result column="type" property="type" jdbcType="VARCHAR" />
    <result column="startTime" property="start_time" jdbcType="VARCHAR" />
    <result column="endTime" property="end_time" jdbcType="VARCHAR" />
    <result column="in_use" property="inUse" jdbcType="INTEGER" />
    <result column="app_type" property="appType" jdbcType="VARCHAR" />
    <result column="app_version" property="appVersion" jdbcType="VARCHAR" />
    <result column="modulo_num_start" property="moduloNumStart" jdbcType="VARCHAR" />
    <result column="modulo_num_end" property="moduloNumEnd" jdbcType="VARCHAR" />
  </resultMap>

  <sql id="Base_Column_List" >
    id, type, in_use, app_type, app_version, start_time ,end_time,modulo_num_start,modulo_num_end
  </sql>

  <insert id="insert" parameterType="com.model.ABTestTotal" >
    insert into ab_test_total
    (type, in_use, app_type, app_version, start_time ,end_time,modulo_num_start,modulo_num_end)
    values
    (#{type,jdbcType=VARCHAR},#{inUse,jdbcType=INTEGER},
    #{appType,jdbcType=VARCHAR},#{appVersion,jdbcType=VARCHAR},
    #{startTime,jdbcType=VARCHAR}, #{endTime,jdbcType=VARCHAR},
    #{moduloNumStart,jdbcType=VARCHAR}, #{moduloNumEnd,jdbcType=VARCHAR}
    )
  </insert>

  <update id="update" parameterType="com.model.ABTestTotal" >
    update ab_test_total
    set
    in_use = #{inUse,jdbcType=INTEGER},
    app_type = #{appType,jdbcType=VARCHAR},
    app_version = #{appVersion,jdbcType=VARCHAR},
    start_time = #{startTime,jdbcType=VARCHAR},
    end_time = #{endTime,jdbcType=VARCHAR},
    modulo_num_start = #{moduloNumStart,jdbcType=VARCHAR},
    modulo_num_end = #{moduloNumEnd,jdbcType=VARCHAR}
    where id = #{id,jdbcType=INTEGER}
  </update>

  <select id="selectAll" resultMap="BaseResultMap">
    select
    <include refid="Base_Column_List" />
    from ab_test_total
  </select>

  <delete id="delete" parameterType="java.lang.Integer" >
    delete from ab_test_total
    where id = #{id,jdbcType=INTEGER}
  </delete>

  <select id="selectById" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
    select
    <include refid="Base_Column_List" />
    from ab_test_total
    where id = #{id,jdbcType=INTEGER}
  </select>

  <select id="selectTypes" resultType="java.lang.String">
    SELECT type FROM ab_test_total order by id
  </select>

</mapper>