JavaApiInfoStaticsMapper.xml 2.61 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.JavaApiInfoStaticsMapper">
    <resultMap id="BaseResultMap" type="com.model.JavaApiInfoStatics">
        <result column="api_id" property="apiId" jdbcType="INTEGER"/>
        <result column="mobj_id" property="mobjId" jdbcType="INTEGER"/>
        <result column="is_exception" property="isException" jdbcType="TINYINT"/>
        <result column="exception" property="exception" jdbcType="VARCHAR"/>
        <result column="start_time" property="startTime" jdbcType="BIGINT"/>
        <result column="end_time" property="endTime" jdbcType="BIGINT"/>
    </resultMap>
    <insert id="insert" parameterType="com.model.JavaApiInfoStatics">
    insert into java_api_info_statics (api_id, mobj_id, is_exception, exception,start_time,end_time)
    values (#{apiId,jdbcType=INTEGER}, #{mobjId,jdbcType=INTEGER}, #{isException,jdbcType=TINYINT}, 
      #{exception,jdbcType=VARCHAR}, #{startTime,jdbcType=BIGINT}, #{endTime,jdbcType=BIGINT})
  </insert>
    <insert id="insertSelective" parameterType="com.model.JavaApiInfoStatics">
        insert into java_api_info_statics
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="apiId != null">
                api_id,
            </if>
            <if test="mobjId != null">
                mobj_id,
            </if>
            <if test="isException != null">
                is_exception,
            </if>
            <if test="exception != null">
                exception,
            </if>
        </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
            <if test="apiId != null">
                #{apiId,jdbcType=INTEGER},
            </if>
            <if test="mobjId != null">
                #{mobjId,jdbcType=INTEGER},
            </if>
            <if test="isException != null">
                #{isException,jdbcType=TINYINT},
            </if>
            <if test="exception != null">
                #{exception,jdbcType=VARCHAR},
            </if>
        </trim>
    </insert>
    <delete id="deleteAll">
      delete from java_api_info_statics
     </delete>


    <select id="selectJavaApiStaticsByIds" resultMap="BaseResultMap">
        select  api_id, mobj_id, is_exception, exception,start_time,end_time from   java_api_info_statics
        where
        <foreach collection="list" item="item" index="index" separator="or" open="(" close=")">
            (api_id = #{item.serviceId} and mobj_id= #{item.mObjectId} )
        </foreach>
    </select>

</mapper>