CenterRoleMapper.xml 7.63 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="org.nafmii.nafmiimbg.mapper.CenterRoleMapper">
  <resultMap id="BaseResultMap" type="org.nafmii.nafmiimbg.model.CenterRole">
    <id column="ID" jdbcType="BIGINT" property="id" />
    <result column="R_NAME" jdbcType="VARCHAR" property="rName" />
    <result column="CREAT_TIME" jdbcType="TIMESTAMP" property="creatTime" />
    <result column="UPDATE_TIME" jdbcType="TIMESTAMP" property="updateTime" />
    <result column="IS_ENABLE" jdbcType="VARCHAR" property="isEnable" />
  </resultMap>
  <sql id="Example_Where_Clause">
    <where>
      <foreach collection="oredCriteria" item="criteria" separator="or">
        <if test="criteria.valid">
          <trim prefix="(" prefixOverrides="and" suffix=")">
            <foreach collection="criteria.criteria" item="criterion">
              <choose>
                <when test="criterion.noValue">
                  and ${criterion.condition}
                </when>
                <when test="criterion.singleValue">
                  and ${criterion.condition} #{criterion.value}
                </when>
                <when test="criterion.betweenValue">
                  and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
                </when>
                <when test="criterion.listValue">
                  and ${criterion.condition}
                  <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
                    #{listItem}
                  </foreach>
                </when>
              </choose>
            </foreach>
          </trim>
        </if>
      </foreach>
    </where>
  </sql>
  <sql id="Update_By_Example_Where_Clause">
    <where>
      <foreach collection="example.oredCriteria" item="criteria" separator="or">
        <if test="criteria.valid">
          <trim prefix="(" prefixOverrides="and" suffix=")">
            <foreach collection="criteria.criteria" item="criterion">
              <choose>
                <when test="criterion.noValue">
                  and ${criterion.condition}
                </when>
                <when test="criterion.singleValue">
                  and ${criterion.condition} #{criterion.value}
                </when>
                <when test="criterion.betweenValue">
                  and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
                </when>
                <when test="criterion.listValue">
                  and ${criterion.condition}
                  <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
                    #{listItem}
                  </foreach>
                </when>
              </choose>
            </foreach>
          </trim>
        </if>
      </foreach>
    </where>
  </sql>
  <sql id="Base_Column_List">
    ID, R_NAME, CREAT_TIME, UPDATE_TIME, IS_ENABLE
  </sql>
  <select id="selectByExample" parameterType="org.nafmii.nafmiimbg.model.CenterRoleExample" resultMap="BaseResultMap">
    select
    <if test="distinct">
      distinct
    </if>
    <include refid="Base_Column_List" />
    from CENTER_ROLE
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
    <if test="orderByClause != null">
      order by ${orderByClause}
    </if>
  </select>
  <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
    select 
    <include refid="Base_Column_List" />
    from CENTER_ROLE
    where ID = #{id,jdbcType=BIGINT}
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
    delete from CENTER_ROLE
    where ID = #{id,jdbcType=BIGINT}
  </delete>
  <delete id="deleteByExample" parameterType="org.nafmii.nafmiimbg.model.CenterRoleExample">
    delete from CENTER_ROLE
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
  </delete>
  <insert id="insert" parameterType="org.nafmii.nafmiimbg.model.CenterRole">
    insert into CENTER_ROLE (ID, R_NAME, CREAT_TIME, 
      UPDATE_TIME, IS_ENABLE)
    values (#{id,jdbcType=BIGINT}, #{rName,jdbcType=VARCHAR}, #{creatTime,jdbcType=TIMESTAMP}, 
      #{updateTime,jdbcType=TIMESTAMP}, #{isEnable,jdbcType=VARCHAR})
  </insert>
  <insert id="insertSelective" parameterType="org.nafmii.nafmiimbg.model.CenterRole">
    insert into CENTER_ROLE
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="id != null">
        ID,
      </if>
      <if test="rName != null">
        R_NAME,
      </if>
      <if test="creatTime != null">
        CREAT_TIME,
      </if>
      <if test="updateTime != null">
        UPDATE_TIME,
      </if>
      <if test="isEnable != null">
        IS_ENABLE,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides=",">
      <if test="id != null">
        #{id,jdbcType=BIGINT},
      </if>
      <if test="rName != null">
        #{rName,jdbcType=VARCHAR},
      </if>
      <if test="creatTime != null">
        #{creatTime,jdbcType=TIMESTAMP},
      </if>
      <if test="updateTime != null">
        #{updateTime,jdbcType=TIMESTAMP},
      </if>
      <if test="isEnable != null">
        #{isEnable,jdbcType=VARCHAR},
      </if>
    </trim>
  </insert>
  <select id="countByExample" parameterType="org.nafmii.nafmiimbg.model.CenterRoleExample" resultType="java.lang.Long">
    select count(*) from CENTER_ROLE
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
  </select>
  <update id="updateByExampleSelective" parameterType="map">
    update CENTER_ROLE
    <set>
      <if test="record.id != null">
        ID = #{record.id,jdbcType=BIGINT},
      </if>
      <if test="record.rName != null">
        R_NAME = #{record.rName,jdbcType=VARCHAR},
      </if>
      <if test="record.creatTime != null">
        CREAT_TIME = #{record.creatTime,jdbcType=TIMESTAMP},
      </if>
      <if test="record.updateTime != null">
        UPDATE_TIME = #{record.updateTime,jdbcType=TIMESTAMP},
      </if>
      <if test="record.isEnable != null">
        IS_ENABLE = #{record.isEnable,jdbcType=VARCHAR},
      </if>
    </set>
    <if test="_parameter != null">
      <include refid="Update_By_Example_Where_Clause" />
    </if>
  </update>
  <update id="updateByExample" parameterType="map">
    update CENTER_ROLE
    set ID = #{record.id,jdbcType=BIGINT},
      R_NAME = #{record.rName,jdbcType=VARCHAR},
      CREAT_TIME = #{record.creatTime,jdbcType=TIMESTAMP},
      UPDATE_TIME = #{record.updateTime,jdbcType=TIMESTAMP},
      IS_ENABLE = #{record.isEnable,jdbcType=VARCHAR}
    <if test="_parameter != null">
      <include refid="Update_By_Example_Where_Clause" />
    </if>
  </update>
  <update id="updateByPrimaryKeySelective" parameterType="org.nafmii.nafmiimbg.model.CenterRole">
    update CENTER_ROLE
    <set>
      <if test="rName != null">
        R_NAME = #{rName,jdbcType=VARCHAR},
      </if>
      <if test="creatTime != null">
        CREAT_TIME = #{creatTime,jdbcType=TIMESTAMP},
      </if>
      <if test="updateTime != null">
        UPDATE_TIME = #{updateTime,jdbcType=TIMESTAMP},
      </if>
      <if test="isEnable != null">
        IS_ENABLE = #{isEnable,jdbcType=VARCHAR},
      </if>
    </set>
    where ID = #{id,jdbcType=BIGINT}
  </update>
  <update id="updateByPrimaryKey" parameterType="org.nafmii.nafmiimbg.model.CenterRole">
    update CENTER_ROLE
    set R_NAME = #{rName,jdbcType=VARCHAR},
      CREAT_TIME = #{creatTime,jdbcType=TIMESTAMP},
      UPDATE_TIME = #{updateTime,jdbcType=TIMESTAMP},
      IS_ENABLE = #{isEnable,jdbcType=VARCHAR}
    where ID = #{id,jdbcType=BIGINT}
  </update>
</mapper>