TbAreaBlockMapper.xml 6.41 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.zteits.sys.mapper.TbAreaBlockMapper" >
  <resultMap id="BaseResultMap" type="com.zteits.sys.domain.TbAreaBlock" >
    <id column="id" property="id" jdbcType="BIGINT" />
    <result column="area_code" property="areaCode" jdbcType="BIGINT" />
    <result column="area_name" property="areaName" jdbcType="VARCHAR" />
    <result column="area_type" property="areaType" jdbcType="INTEGER" />
    <result column="parent_id" property="parentId" jdbcType="BIGINT" />
    <result column="org_id" property="orgId" jdbcType="BIGINT" />
    <result column="data_state" property="dataState" jdbcType="INTEGER" />
    <result column="create_empid" property="createEmpid" jdbcType="VARCHAR" />
    <result column="create_date" property="createDate" jdbcType="TIMESTAMP" />
    <result column="modfiy_empid" property="modfiyEmpid" jdbcType="VARCHAR" />
    <result column="modfiy_date" property="modfiyDate" jdbcType="TIMESTAMP" />
    <result column="remark" property="remark" jdbcType="VARCHAR" />
  </resultMap>
  <sql id="Base_Column_List" >
    id, area_code, area_name, area_type, parent_id, org_id, data_state, create_empid, 
    create_date, modfiy_empid, modfiy_date, remark
  </sql>
  <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Long" >
    select 
    <include refid="Base_Column_List" />
    from tb_area_block
    where id = #{id,jdbcType=BIGINT}
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.Long" >
    delete from tb_area_block
    where id = #{id,jdbcType=BIGINT}
  </delete>
  <insert id="insert" parameterType="com.zteits.sys.domain.TbAreaBlock" >
    <selectKey resultType="java.lang.Long" keyProperty="id" order="AFTER" >
      SELECT LAST_INSERT_ID()
    </selectKey>
    insert into tb_area_block (area_code, area_name, area_type, 
      parent_id, org_id, data_state, 
      create_empid, create_date, modfiy_empid, 
      modfiy_date, remark)
    values (#{areaCode,jdbcType=BIGINT}, #{areaName,jdbcType=VARCHAR}, #{areaType,jdbcType=INTEGER}, 
      #{parentId,jdbcType=BIGINT}, #{orgId,jdbcType=BIGINT}, #{dataState,jdbcType=INTEGER}, 
      #{createEmpid,jdbcType=VARCHAR}, #{createDate,jdbcType=TIMESTAMP}, #{modfiyEmpid,jdbcType=VARCHAR}, 
      #{modfiyDate,jdbcType=TIMESTAMP}, #{remark,jdbcType=VARCHAR})
  </insert>
  <insert id="insertSelective" parameterType="com.zteits.sys.domain.TbAreaBlock" >
    <selectKey resultType="java.lang.Long" keyProperty="id" order="AFTER" >
      SELECT LAST_INSERT_ID()
    </selectKey>
    insert into tb_area_block
    <trim prefix="(" suffix=")" suffixOverrides="," >
      <if test="areaCode != null" >
        area_code,
      </if>
      <if test="areaName != null" >
        area_name,
      </if>
      <if test="areaType != null" >
        area_type,
      </if>
      <if test="parentId != null" >
        parent_id,
      </if>
      <if test="orgId != null" >
        org_id,
      </if>
      <if test="dataState != null" >
        data_state,
      </if>
      <if test="createEmpid != null" >
        create_empid,
      </if>
      <if test="createDate != null" >
        create_date,
      </if>
      <if test="modfiyEmpid != null" >
        modfiy_empid,
      </if>
      <if test="modfiyDate != null" >
        modfiy_date,
      </if>
      <if test="remark != null" >
        remark,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides="," >
      <if test="areaCode != null" >
        #{areaCode,jdbcType=BIGINT},
      </if>
      <if test="areaName != null" >
        #{areaName,jdbcType=VARCHAR},
      </if>
      <if test="areaType != null" >
        #{areaType,jdbcType=INTEGER},
      </if>
      <if test="parentId != null" >
        #{parentId,jdbcType=BIGINT},
      </if>
      <if test="orgId != null" >
        #{orgId,jdbcType=BIGINT},
      </if>
      <if test="dataState != null" >
        #{dataState,jdbcType=INTEGER},
      </if>
      <if test="createEmpid != null" >
        #{createEmpid,jdbcType=VARCHAR},
      </if>
      <if test="createDate != null" >
        #{createDate,jdbcType=TIMESTAMP},
      </if>
      <if test="modfiyEmpid != null" >
        #{modfiyEmpid,jdbcType=VARCHAR},
      </if>
      <if test="modfiyDate != null" >
        #{modfiyDate,jdbcType=TIMESTAMP},
      </if>
      <if test="remark != null" >
        #{remark,jdbcType=VARCHAR},
      </if>
    </trim>
  </insert>
  <update id="updateByPrimaryKeySelective" parameterType="com.zteits.sys.domain.TbAreaBlock" >
    update tb_area_block
    <set >
      <if test="areaCode != null" >
        area_code = #{areaCode,jdbcType=BIGINT},
      </if>
      <if test="areaName != null" >
        area_name = #{areaName,jdbcType=VARCHAR},
      </if>
      <if test="areaType != null" >
        area_type = #{areaType,jdbcType=INTEGER},
      </if>
      <if test="parentId != null" >
        parent_id = #{parentId,jdbcType=BIGINT},
      </if>
      <if test="orgId != null" >
        org_id = #{orgId,jdbcType=BIGINT},
      </if>
      <if test="dataState != null" >
        data_state = #{dataState,jdbcType=INTEGER},
      </if>
      <if test="createEmpid != null" >
        create_empid = #{createEmpid,jdbcType=VARCHAR},
      </if>
      <if test="createDate != null" >
        create_date = #{createDate,jdbcType=TIMESTAMP},
      </if>
      <if test="modfiyEmpid != null" >
        modfiy_empid = #{modfiyEmpid,jdbcType=VARCHAR},
      </if>
      <if test="modfiyDate != null" >
        modfiy_date = #{modfiyDate,jdbcType=TIMESTAMP},
      </if>
      <if test="remark != null" >
        remark = #{remark,jdbcType=VARCHAR},
      </if>
    </set>
    where id = #{id,jdbcType=BIGINT}
  </update>
  <update id="updateByPrimaryKey" parameterType="com.zteits.sys.domain.TbAreaBlock" >
    update tb_area_block
    set area_code = #{areaCode,jdbcType=BIGINT},
      area_name = #{areaName,jdbcType=VARCHAR},
      area_type = #{areaType,jdbcType=INTEGER},
      parent_id = #{parentId,jdbcType=BIGINT},
      org_id = #{orgId,jdbcType=BIGINT},
      data_state = #{dataState,jdbcType=INTEGER},
      create_empid = #{createEmpid,jdbcType=VARCHAR},
      create_date = #{createDate,jdbcType=TIMESTAMP},
      modfiy_empid = #{modfiyEmpid,jdbcType=VARCHAR},
      modfiy_date = #{modfiyDate,jdbcType=TIMESTAMP},
      remark = #{remark,jdbcType=VARCHAR}
    where id = #{id,jdbcType=BIGINT}
  </update>
</mapper>