LandRouterConfigDao.xml 7.3 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.sy.mapper.LandRouterConfigDao">
  <resultMap id="BaseResultMap" type="com.sy.model.LandRouterConfig">
    <id column="id" jdbcType="INTEGER" property="id" />
    <result column="area_id" jdbcType="VARCHAR" property="areaId" />
    <result column="area_name" jdbcType="VARCHAR" property="areaName" />
    <result column="chanel_id" jdbcType="VARCHAR" property="chanelId" />
    <result column="chanel_name" jdbcType="VARCHAR" property="chanelName" />
    <result column="chanel_type" jdbcType="VARCHAR" property="chanelType" />
    <result column="business_type" jdbcType="VARCHAR" property="businessType" />
    <result column="g2_business_type" jdbcType="VARCHAR" property="g2BusinessType" />
    <result column="ie_type" jdbcType="VARCHAR" property="ieType" />
    <result column="identify_type" jdbcType="VARCHAR" property="identifyType" />
    <result column="gather_receiver" jdbcType="VARCHAR" property="gatherReceiver" />
    <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
    <result column="status" jdbcType="VARCHAR" property="status" />
  </resultMap>
  <sql id="Base_Column_List">
    id, area_id, area_name, chanel_id, chanel_name, chanel_type, business_type, g2_business_type,ie_type
    identify_type, gather_receiver, create_time, `status`
  </sql>
  <select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
    select
    <include refid="Base_Column_List" />
    from land_router_config
    where id = #{id,jdbcType=INTEGER}
  </select>

  <select id="selectByGatherInfo" parameterType="com.sy.model.LandRouterConfig" resultMap="BaseResultMap">
    select
    <include refid="Base_Column_List" />
    from land_router_config
    where chanel_id = #{chanelId,jdbcType=VARCHAR}
    and `status` = #{status,jdbcType=VARCHAR}
    and gather_receiver = #{gatherReceiver,jdbcType=VARCHAR}
    and business_type = #{businessType,jdbcType=VARCHAR}
  </select>

  <select id="selectByBussType" parameterType="com.sy.model.LandRouterConfig" resultMap="BaseResultMap">
    select
    <include refid="Base_Column_List" />
    from land_router_config
    where
     business_type = #{businessType,jdbcType=VARCHAR}
    and area_id =  #{areaId,jdbcType=VARCHAR}
    and gather_receiver = 'G2'
    and `status` = 'Y'
  </select>

  <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
    delete from land_router_config
    where id = #{id,jdbcType=INTEGER}
  </delete>
  <insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.sy.model.LandRouterConfig" useGeneratedKeys="true">
    insert into land_router_config (area_id, area_name, chanel_id,
      chanel_name, chanel_type, business_type,
      g2_business_type, identify_type, gather_receiver,
      create_time, `status`)
    values (#{areaId,jdbcType=VARCHAR}, #{areaName,jdbcType=VARCHAR}, #{chanelId,jdbcType=VARCHAR},
      #{chanelName,jdbcType=VARCHAR}, #{chanelType,jdbcType=VARCHAR}, #{businessType,jdbcType=VARCHAR},
      #{g2BusinessType,jdbcType=VARCHAR}, #{identifyType,jdbcType=VARCHAR}, #{gatherReceiver,jdbcType=VARCHAR},
      #{createTime,jdbcType=TIMESTAMP}, #{status,jdbcType=VARCHAR})
  </insert>
  <insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.sy.model.LandRouterConfig" useGeneratedKeys="true">
    insert into land_router_config
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="areaId != null">
        area_id,
      </if>
      <if test="areaName != null">
        area_name,
      </if>
      <if test="chanelId != null">
        chanel_id,
      </if>
      <if test="chanelName != null">
        chanel_name,
      </if>
      <if test="chanelType != null">
        chanel_type,
      </if>
      <if test="businessType != null">
        business_type,
      </if>
      <if test="g2BusinessType != null">
        g2_business_type,
      </if>
      <if test="identifyType != null">
        identify_type,
      </if>
      <if test="gatherReceiver != null">
        gather_receiver,
      </if>
      <if test="createTime != null">
        create_time,
      </if>
      <if test="status != null">
        `status`,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides=",">
      <if test="areaId != null">
        #{areaId,jdbcType=VARCHAR},
      </if>
      <if test="areaName != null">
        #{areaName,jdbcType=VARCHAR},
      </if>
      <if test="chanelId != null">
        #{chanelId,jdbcType=VARCHAR},
      </if>
      <if test="chanelName != null">
        #{chanelName,jdbcType=VARCHAR},
      </if>
      <if test="chanelType != null">
        #{chanelType,jdbcType=VARCHAR},
      </if>
      <if test="businessType != null">
        #{businessType,jdbcType=VARCHAR},
      </if>
      <if test="g2BusinessType != null">
        #{g2BusinessType,jdbcType=VARCHAR},
      </if>
      <if test="identifyType != null">
        #{identifyType,jdbcType=VARCHAR},
      </if>
      <if test="gatherReceiver != null">
        #{gatherReceiver,jdbcType=VARCHAR},
      </if>
      <if test="createTime != null">
        #{createTime,jdbcType=TIMESTAMP},
      </if>
      <if test="status != null">
        #{status,jdbcType=VARCHAR},
      </if>
    </trim>
  </insert>
  <update id="updateByPrimaryKeySelective" parameterType="com.sy.model.LandRouterConfig">
    update land_router_config
    <set>
      <if test="areaId != null">
        area_id = #{areaId,jdbcType=VARCHAR},
      </if>
      <if test="areaName != null">
        area_name = #{areaName,jdbcType=VARCHAR},
      </if>
      <if test="chanelId != null">
        chanel_id = #{chanelId,jdbcType=VARCHAR},
      </if>
      <if test="chanelName != null">
        chanel_name = #{chanelName,jdbcType=VARCHAR},
      </if>
      <if test="chanelType != null">
        chanel_type = #{chanelType,jdbcType=VARCHAR},
      </if>
      <if test="businessType != null">
        business_type = #{businessType,jdbcType=VARCHAR},
      </if>
      <if test="g2BusinessType != null">
        g2_business_type = #{g2BusinessType,jdbcType=VARCHAR},
      </if>
      <if test="identifyType != null">
        identify_type = #{identifyType,jdbcType=VARCHAR},
      </if>
      <if test="gatherReceiver != null">
        gather_receiver = #{gatherReceiver,jdbcType=VARCHAR},
      </if>
      <if test="createTime != null">
        create_time = #{createTime,jdbcType=TIMESTAMP},
      </if>
      <if test="status != null">
        `status` = #{status,jdbcType=VARCHAR},
      </if>
    </set>
    where id = #{id,jdbcType=INTEGER}
  </update>
  <update id="updateByPrimaryKey" parameterType="com.sy.model.LandRouterConfig">
    update land_router_config
    set area_id = #{areaId,jdbcType=VARCHAR},
      area_name = #{areaName,jdbcType=VARCHAR},
      chanel_id = #{chanelId,jdbcType=VARCHAR},
      chanel_name = #{chanelName,jdbcType=VARCHAR},
      chanel_type = #{chanelType,jdbcType=VARCHAR},
      business_type = #{businessType,jdbcType=VARCHAR},
      g2_business_type = #{g2BusinessType,jdbcType=VARCHAR},
      identify_type = #{identifyType,jdbcType=VARCHAR},
      gather_receiver = #{gatherReceiver,jdbcType=VARCHAR},
      create_time = #{createTime,jdbcType=TIMESTAMP},
      `status` = #{status,jdbcType=VARCHAR}
    where id = #{id,jdbcType=INTEGER}
  </update>
</mapper>