AccountMapper.xml 6.05 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="cn.runsa.portal.base.dao.AccountMapper" >
  <resultMap id="BaseResultMap" type="cn.runsa.portal.base.entity.Account" >
    <id column="acId" property="id" jdbcType="INTEGER" />
    <result column="beId" property="beid" jdbcType="INTEGER" />
    <result column="acCode" property="code" jdbcType="VARCHAR" />
    <result column="acName" property="name" jdbcType="VARCHAR" />
    <result column="acDesc" property="desc" jdbcType="VARCHAR" />
    <result column="ptRemark" property="remark" jdbcType="VARCHAR" />
    <result column="ptValid" property="valid" jdbcType="SMALLINT" />
    <result column="ptRemark1" property="remark1" jdbcType="VARCHAR" />
    <result column="ptRemark2" property="remark2" jdbcType="VARCHAR" />
    <result column="ptRemark3" property="remark3" jdbcType="VARCHAR" />
    <result column="ptUpTime" property="uptime" jdbcType="TIMESTAMP" />
    <result column="ptUpdater" property="updater" jdbcType="INTEGER" />
  </resultMap>
  <sql id="Base_Column_List" >
    acId, beId, acCode, acName, acDesc, ptRemark, ptValid, ptRemark1, ptRemark2, ptRemark3, 
    ptUpTime, ptUpdater
  </sql>
  <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
    select 
    <include refid="Base_Column_List" />
    from mtaccount
    where acId = #{id,jdbcType=INTEGER}
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
    delete from mtaccount
    where acId = #{id,jdbcType=INTEGER}
    delete from 
  </delete>
  <insert id="insert" parameterType="cn.runsa.portal.base.entity.Account" >
    <selectKey resultType="java.lang.Integer" keyProperty="id" order="AFTER" >
      SELECT LAST_INSERT_ID()
    </selectKey>
    insert into mtaccount (beId, acCode, acName, 
      acDesc, ptRemark, ptValid, 
      ptRemark1, ptRemark2, ptRemark3, 
      ptUpTime, ptUpdater)
    values (#{beid,jdbcType=INTEGER}, #{code,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, 
      #{desc,jdbcType=VARCHAR}, #{remark,jdbcType=VARCHAR}, #{valid,jdbcType=SMALLINT}, 
      #{remark1,jdbcType=VARCHAR}, #{remark2,jdbcType=VARCHAR}, #{remark3,jdbcType=VARCHAR}, 
      #{uptime,jdbcType=TIMESTAMP}, #{updater,jdbcType=INTEGER})
  </insert>
  <insert id="insertSelective" parameterType="cn.runsa.portal.base.entity.Account" >
    <selectKey resultType="java.lang.Integer" keyProperty="id" order="AFTER" >
      SELECT LAST_INSERT_ID()
    </selectKey>
    insert into mtaccount
    <trim prefix="(" suffix=")" suffixOverrides="," >
      <if test="beid != null" >
        beId,
      </if>
      <if test="code != null" >
        acCode,
      </if>
      <if test="name != null" >
        acName,
      </if>
      <if test="desc != null" >
        acDesc,
      </if>
      <if test="remark != null" >
        ptRemark,
      </if>
      <if test="valid != null" >
        ptValid,
      </if>
      <if test="remark1 != null" >
        ptRemark1,
      </if>
      <if test="remark2 != null" >
        ptRemark2,
      </if>
      <if test="remark3 != null" >
        ptRemark3,
      </if>
      <if test="uptime != null" >
        ptUpTime,
      </if>
      <if test="updater != null" >
        ptUpdater,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides="," >
      <if test="beid != null" >
        #{beid,jdbcType=INTEGER},
      </if>
      <if test="code != null" >
        #{code,jdbcType=VARCHAR},
      </if>
      <if test="name != null" >
        #{name,jdbcType=VARCHAR},
      </if>
      <if test="desc != null" >
        #{desc,jdbcType=VARCHAR},
      </if>
      <if test="remark != null" >
        #{remark,jdbcType=VARCHAR},
      </if>
      <if test="valid != null" >
        #{valid,jdbcType=SMALLINT},
      </if>
      <if test="remark1 != null" >
        #{remark1,jdbcType=VARCHAR},
      </if>
      <if test="remark2 != null" >
        #{remark2,jdbcType=VARCHAR},
      </if>
      <if test="remark3 != null" >
        #{remark3,jdbcType=VARCHAR},
      </if>
      <if test="uptime != null" >
        #{uptime,jdbcType=TIMESTAMP},
      </if>
      <if test="updater != null" >
        #{updater,jdbcType=INTEGER},
      </if>
    </trim>
  </insert>
  <update id="updateByPrimaryKeySelective" parameterType="cn.runsa.portal.base.entity.Account" >
    update mtaccount
    <set >
      <if test="beid != null" >
        beId = #{beid,jdbcType=INTEGER},
      </if>
      <if test="code != null" >
        acCode = #{code,jdbcType=VARCHAR},
      </if>
      <if test="name != null" >
        acName = #{name,jdbcType=VARCHAR},
      </if>
      <if test="desc != null" >
        acDesc = #{desc,jdbcType=VARCHAR},
      </if>
      <if test="remark != null" >
        ptRemark = #{remark,jdbcType=VARCHAR},
      </if>
      <if test="valid != null" >
        ptValid = #{valid,jdbcType=SMALLINT},
      </if>
      <if test="remark1 != null" >
        ptRemark1 = #{remark1,jdbcType=VARCHAR},
      </if>
      <if test="remark2 != null" >
        ptRemark2 = #{remark2,jdbcType=VARCHAR},
      </if>
      <if test="remark3 != null" >
        ptRemark3 = #{remark3,jdbcType=VARCHAR},
      </if>
      <if test="uptime != null" >
        ptUpTime = #{uptime,jdbcType=TIMESTAMP},
      </if>
      <if test="updater != null" >
        ptUpdater = #{updater,jdbcType=INTEGER},
      </if>
    </set>
    where acId = #{id,jdbcType=INTEGER}
  </update>
  <update id="updateByPrimaryKey" parameterType="cn.runsa.portal.base.entity.Account" >
    update mtaccount
    set beId = #{beid,jdbcType=INTEGER},
      acCode = #{code,jdbcType=VARCHAR},
      acName = #{name,jdbcType=VARCHAR},
      acDesc = #{desc,jdbcType=VARCHAR},
      ptRemark = #{remark,jdbcType=VARCHAR},
      ptValid = #{valid,jdbcType=SMALLINT},
      ptRemark1 = #{remark1,jdbcType=VARCHAR},
      ptRemark2 = #{remark2,jdbcType=VARCHAR},
      ptRemark3 = #{remark3,jdbcType=VARCHAR},
      ptUpTime = #{uptime,jdbcType=TIMESTAMP},
      ptUpdater = #{updater,jdbcType=INTEGER}
    where acId = #{id,jdbcType=INTEGER}
  </update>
</mapper>