SysResMapper.xml 7.99 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.SysResMapper">
  <resultMap id="BaseResultMap" type="com.zteits.sys.domain.SysRes">
    <id column="id" jdbcType="BIGINT" property="id" />
    <result column="res_code" jdbcType="VARCHAR" property="resCode" />
    <result column="res_name" jdbcType="VARCHAR" property="resName" />
    <result column="res_type" jdbcType="INTEGER" property="resType" />
    <result column="res_url" jdbcType="VARCHAR" property="resUrl" />
    <result column="parent_res_id" jdbcType="BIGINT" property="parentResId" />
    <result column="res_icon" jdbcType="VARCHAR" property="resIcon" />
    <result column="res_desc" jdbcType="VARCHAR" property="resDesc" />
    <result column="sort_num" jdbcType="INTEGER" property="sortNum" />
    <result column="if_display" jdbcType="INTEGER" property="ifDisplay" />
    <result column="sys_code" jdbcType="VARCHAR" property="sysCode" />
    <result column="data_state" jdbcType="INTEGER" property="dataState" />
    <result column="create_empid" jdbcType="VARCHAR" property="createEmpid" />
    <result column="create_date" jdbcType="TIMESTAMP" property="createDate" />
    <result column="modfiy_empid" jdbcType="VARCHAR" property="modfiyEmpid" />
    <result column="modfiy_date" jdbcType="TIMESTAMP" property="modfiyDate" />
  </resultMap>
  <sql id="Base_Column_List">
    id, res_code, res_name, res_type, res_url, parent_res_id, res_icon, res_desc, sort_num, 
    if_display, sys_code, data_state, create_empid, create_date, modfiy_empid, modfiy_date
  </sql>
  <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
    select 
    <include refid="Base_Column_List" />
    from sys_res
    where id = #{id,jdbcType=BIGINT}
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
    delete from sys_res
    where id = #{id,jdbcType=BIGINT}
  </delete>
  <insert id="insert" parameterType="com.zteits.sys.domain.SysRes">
    <selectKey keyProperty="id" order="AFTER" resultType="java.lang.Long">
      SELECT LAST_INSERT_ID()
    </selectKey>
    insert into sys_res (res_code, res_name, res_type, 
      res_url, parent_res_id, res_icon, 
      res_desc, sort_num, if_display, 
      sys_code, data_state, create_empid, 
      create_date, modfiy_empid, modfiy_date
      )
    values (#{resCode,jdbcType=VARCHAR}, #{resName,jdbcType=VARCHAR}, #{resType,jdbcType=INTEGER}, 
      #{resUrl,jdbcType=VARCHAR}, #{parentResId,jdbcType=BIGINT}, #{resIcon,jdbcType=VARCHAR}, 
      #{resDesc,jdbcType=VARCHAR}, #{sortNum,jdbcType=INTEGER}, #{ifDisplay,jdbcType=INTEGER}, 
      #{sysCode,jdbcType=VARCHAR}, #{dataState,jdbcType=INTEGER}, #{createEmpid,jdbcType=VARCHAR}, 
      #{createDate,jdbcType=TIMESTAMP}, #{modfiyEmpid,jdbcType=VARCHAR}, #{modfiyDate,jdbcType=TIMESTAMP}
      )
  </insert>
  <insert id="insertSelective" parameterType="com.zteits.sys.domain.SysRes">
    <selectKey keyProperty="id" order="AFTER" resultType="java.lang.Long">
      SELECT LAST_INSERT_ID()
    </selectKey>
    insert into sys_res
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="resCode != null">
        res_code,
      </if>
      <if test="resName != null">
        res_name,
      </if>
      <if test="resType != null">
        res_type,
      </if>
      <if test="resUrl != null">
        res_url,
      </if>
      <if test="parentResId != null">
        parent_res_id,
      </if>
      <if test="resIcon != null">
        res_icon,
      </if>
      <if test="resDesc != null">
        res_desc,
      </if>
      <if test="sortNum != null">
        sort_num,
      </if>
      <if test="ifDisplay != null">
        if_display,
      </if>
      <if test="sysCode != null">
        sys_code,
      </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>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides=",">
      <if test="resCode != null">
        #{resCode,jdbcType=VARCHAR},
      </if>
      <if test="resName != null">
        #{resName,jdbcType=VARCHAR},
      </if>
      <if test="resType != null">
        #{resType,jdbcType=INTEGER},
      </if>
      <if test="resUrl != null">
        #{resUrl,jdbcType=VARCHAR},
      </if>
      <if test="parentResId != null">
        #{parentResId,jdbcType=BIGINT},
      </if>
      <if test="resIcon != null">
        #{resIcon,jdbcType=VARCHAR},
      </if>
      <if test="resDesc != null">
        #{resDesc,jdbcType=VARCHAR},
      </if>
      <if test="sortNum != null">
        #{sortNum,jdbcType=INTEGER},
      </if>
      <if test="ifDisplay != null">
        #{ifDisplay,jdbcType=INTEGER},
      </if>
      <if test="sysCode != null">
        #{sysCode,jdbcType=VARCHAR},
      </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>
    </trim>
  </insert>
  <update id="updateByPrimaryKeySelective" parameterType="com.zteits.sys.domain.SysRes">
    update sys_res
    <set>
      <if test="resCode != null">
        res_code = #{resCode,jdbcType=VARCHAR},
      </if>
      <if test="resName != null">
        res_name = #{resName,jdbcType=VARCHAR},
      </if>
      <if test="resType != null">
        res_type = #{resType,jdbcType=INTEGER},
      </if>
      <if test="resUrl != null">
        res_url = #{resUrl,jdbcType=VARCHAR},
      </if>
      <if test="parentResId != null">
        parent_res_id = #{parentResId,jdbcType=BIGINT},
      </if>
      <if test="resIcon != null">
        res_icon = #{resIcon,jdbcType=VARCHAR},
      </if>
      <if test="resDesc != null">
        res_desc = #{resDesc,jdbcType=VARCHAR},
      </if>
      <if test="sortNum != null">
        sort_num = #{sortNum,jdbcType=INTEGER},
      </if>
      <if test="ifDisplay != null">
        if_display = #{ifDisplay,jdbcType=INTEGER},
      </if>
      <if test="sysCode != null">
        sys_code = #{sysCode,jdbcType=VARCHAR},
      </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>
    </set>
    where id = #{id,jdbcType=BIGINT}
  </update>
  <update id="updateByPrimaryKey" parameterType="com.zteits.sys.domain.SysRes">
    update sys_res
    set res_code = #{resCode,jdbcType=VARCHAR},
      res_name = #{resName,jdbcType=VARCHAR},
      res_type = #{resType,jdbcType=INTEGER},
      res_url = #{resUrl,jdbcType=VARCHAR},
      parent_res_id = #{parentResId,jdbcType=BIGINT},
      res_icon = #{resIcon,jdbcType=VARCHAR},
      res_desc = #{resDesc,jdbcType=VARCHAR},
      sort_num = #{sortNum,jdbcType=INTEGER},
      if_display = #{ifDisplay,jdbcType=INTEGER},
      sys_code = #{sysCode,jdbcType=VARCHAR},
      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}
    where id = #{id,jdbcType=BIGINT}
  </update>
</mapper>