SysCodeValueMapper.xml 14.4 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.job.mapper.SysCodeValueMapper">
  <resultMap id="BaseResultMap" type="com.zteits.job.domain.SysCodeValue">
    <id column="id" jdbcType="BIGINT" property="id" />
    <result column="code_kind" jdbcType="VARCHAR" property="codeKind" />
    <result column="code_value" jdbcType="VARCHAR" property="codeValue" />
    <result column="code_value_name" jdbcType="VARCHAR" property="codeValueName" />
    <result column="code_value_alias" jdbcType="VARCHAR" property="codeValueAlias" />
    <result column="code_value_desc" jdbcType="VARCHAR" property="codeValueDesc" />
    <result column="code_value_order" jdbcType="INTEGER" property="codeValueOrder" />
    <result column="code_value_icon" jdbcType="VARCHAR" property="codeValueIcon" />
    <result column="code_value_color" jdbcType="VARCHAR" property="codeValueColor" />
    <result column="data_state" jdbcType="INTEGER" property="dataState" />
    <result column="creator" jdbcType="BIGINT" property="creator" />
    <result column="create_date" jdbcType="TIMESTAMP" property="createDate" />
    <result column="modifier" jdbcType="BIGINT" property="modifier" />
    <result column="modify_date" jdbcType="TIMESTAMP" property="modifyDate" />
    <result column="parent_code_kind" jdbcType="BIGINT" property="parentCodeKind" />
  </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, code_kind, code_value, code_value_name, code_value_alias, code_value_desc, code_value_order, 
    code_value_icon, code_value_color, data_state, creator, create_date, modifier, modify_date, 
    parent_code_kind
  </sql>
  <select id="selectByExample" parameterType="com.zteits.job.domain.SysCodeValueExample" resultMap="BaseResultMap">
    select
    <if test="distinct">
      distinct
    </if>
    'true' as QUERYID,
    <include refid="Base_Column_List" />
    from sys_code_value
    <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 sys_code_value
    where id = #{id,jdbcType=BIGINT}
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
    delete from sys_code_value
    where id = #{id,jdbcType=BIGINT}
  </delete>
  <delete id="deleteByExample" parameterType="com.zteits.job.domain.SysCodeValueExample">
    delete from sys_code_value
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
  </delete>
  <insert id="insert" parameterType="com.zteits.job.domain.SysCodeValue">
    <selectKey keyProperty="id" order="AFTER" resultType="java.lang.Long">
      SELECT LAST_INSERT_ID()
    </selectKey>
    insert into sys_code_value (code_kind, code_value, code_value_name, 
      code_value_alias, code_value_desc, code_value_order, 
      code_value_icon, code_value_color, data_state, 
      creator, create_date, modifier, 
      modify_date, parent_code_kind)
    values (#{codeKind,jdbcType=VARCHAR}, #{codeValue,jdbcType=VARCHAR}, #{codeValueName,jdbcType=VARCHAR}, 
      #{codeValueAlias,jdbcType=VARCHAR}, #{codeValueDesc,jdbcType=VARCHAR}, #{codeValueOrder,jdbcType=INTEGER}, 
      #{codeValueIcon,jdbcType=VARCHAR}, #{codeValueColor,jdbcType=VARCHAR}, #{dataState,jdbcType=INTEGER}, 
      #{creator,jdbcType=BIGINT}, #{createDate,jdbcType=TIMESTAMP}, #{modifier,jdbcType=BIGINT}, 
      #{modifyDate,jdbcType=TIMESTAMP}, #{parentCodeKind,jdbcType=BIGINT})
  </insert>
  <insert id="insertSelective" parameterType="com.zteits.job.domain.SysCodeValue">
    <selectKey keyProperty="id" order="AFTER" resultType="java.lang.Long">
      SELECT LAST_INSERT_ID()
    </selectKey>
    insert into sys_code_value
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="codeKind != null">
        code_kind,
      </if>
      <if test="codeValue != null">
        code_value,
      </if>
      <if test="codeValueName != null">
        code_value_name,
      </if>
      <if test="codeValueAlias != null">
        code_value_alias,
      </if>
      <if test="codeValueDesc != null">
        code_value_desc,
      </if>
      <if test="codeValueOrder != null">
        code_value_order,
      </if>
      <if test="codeValueIcon != null">
        code_value_icon,
      </if>
      <if test="codeValueColor != null">
        code_value_color,
      </if>
      <if test="dataState != null">
        data_state,
      </if>
      <if test="creator != null">
        creator,
      </if>
      <if test="createDate != null">
        create_date,
      </if>
      <if test="modifier != null">
        modifier,
      </if>
      <if test="modifyDate != null">
        modify_date,
      </if>
      <if test="parentCodeKind != null">
        parent_code_kind,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides=",">
      <if test="codeKind != null">
        #{codeKind,jdbcType=VARCHAR},
      </if>
      <if test="codeValue != null">
        #{codeValue,jdbcType=VARCHAR},
      </if>
      <if test="codeValueName != null">
        #{codeValueName,jdbcType=VARCHAR},
      </if>
      <if test="codeValueAlias != null">
        #{codeValueAlias,jdbcType=VARCHAR},
      </if>
      <if test="codeValueDesc != null">
        #{codeValueDesc,jdbcType=VARCHAR},
      </if>
      <if test="codeValueOrder != null">
        #{codeValueOrder,jdbcType=INTEGER},
      </if>
      <if test="codeValueIcon != null">
        #{codeValueIcon,jdbcType=VARCHAR},
      </if>
      <if test="codeValueColor != null">
        #{codeValueColor,jdbcType=VARCHAR},
      </if>
      <if test="dataState != null">
        #{dataState,jdbcType=INTEGER},
      </if>
      <if test="creator != null">
        #{creator,jdbcType=BIGINT},
      </if>
      <if test="createDate != null">
        #{createDate,jdbcType=TIMESTAMP},
      </if>
      <if test="modifier != null">
        #{modifier,jdbcType=BIGINT},
      </if>
      <if test="modifyDate != null">
        #{modifyDate,jdbcType=TIMESTAMP},
      </if>
      <if test="parentCodeKind != null">
        #{parentCodeKind,jdbcType=BIGINT},
      </if>
    </trim>
  </insert>
  <select id="countByExample" parameterType="com.zteits.job.domain.SysCodeValueExample" resultType="java.lang.Long">
    select count(*) from sys_code_value
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
  </select>
  <update id="updateByExampleSelective" parameterType="map">
    update sys_code_value
    <set>
      <if test="record.id != null">
        id = #{record.id,jdbcType=BIGINT},
      </if>
      <if test="record.codeKind != null">
        code_kind = #{record.codeKind,jdbcType=VARCHAR},
      </if>
      <if test="record.codeValue != null">
        code_value = #{record.codeValue,jdbcType=VARCHAR},
      </if>
      <if test="record.codeValueName != null">
        code_value_name = #{record.codeValueName,jdbcType=VARCHAR},
      </if>
      <if test="record.codeValueAlias != null">
        code_value_alias = #{record.codeValueAlias,jdbcType=VARCHAR},
      </if>
      <if test="record.codeValueDesc != null">
        code_value_desc = #{record.codeValueDesc,jdbcType=VARCHAR},
      </if>
      <if test="record.codeValueOrder != null">
        code_value_order = #{record.codeValueOrder,jdbcType=INTEGER},
      </if>
      <if test="record.codeValueIcon != null">
        code_value_icon = #{record.codeValueIcon,jdbcType=VARCHAR},
      </if>
      <if test="record.codeValueColor != null">
        code_value_color = #{record.codeValueColor,jdbcType=VARCHAR},
      </if>
      <if test="record.dataState != null">
        data_state = #{record.dataState,jdbcType=INTEGER},
      </if>
      <if test="record.creator != null">
        creator = #{record.creator,jdbcType=BIGINT},
      </if>
      <if test="record.createDate != null">
        create_date = #{record.createDate,jdbcType=TIMESTAMP},
      </if>
      <if test="record.modifier != null">
        modifier = #{record.modifier,jdbcType=BIGINT},
      </if>
      <if test="record.modifyDate != null">
        modify_date = #{record.modifyDate,jdbcType=TIMESTAMP},
      </if>
      <if test="record.parentCodeKind != null">
        parent_code_kind = #{record.parentCodeKind,jdbcType=BIGINT},
      </if>
    </set>
    <if test="_parameter != null">
      <include refid="Update_By_Example_Where_Clause" />
    </if>
  </update>
  <update id="updateByExample" parameterType="map">
    update sys_code_value
    set id = #{record.id,jdbcType=BIGINT},
      code_kind = #{record.codeKind,jdbcType=VARCHAR},
      code_value = #{record.codeValue,jdbcType=VARCHAR},
      code_value_name = #{record.codeValueName,jdbcType=VARCHAR},
      code_value_alias = #{record.codeValueAlias,jdbcType=VARCHAR},
      code_value_desc = #{record.codeValueDesc,jdbcType=VARCHAR},
      code_value_order = #{record.codeValueOrder,jdbcType=INTEGER},
      code_value_icon = #{record.codeValueIcon,jdbcType=VARCHAR},
      code_value_color = #{record.codeValueColor,jdbcType=VARCHAR},
      data_state = #{record.dataState,jdbcType=INTEGER},
      creator = #{record.creator,jdbcType=BIGINT},
      create_date = #{record.createDate,jdbcType=TIMESTAMP},
      modifier = #{record.modifier,jdbcType=BIGINT},
      modify_date = #{record.modifyDate,jdbcType=TIMESTAMP},
      parent_code_kind = #{record.parentCodeKind,jdbcType=BIGINT}
    <if test="_parameter != null">
      <include refid="Update_By_Example_Where_Clause" />
    </if>
  </update>
  <update id="updateByPrimaryKeySelective" parameterType="com.zteits.job.domain.SysCodeValue">
    update sys_code_value
    <set>
      <if test="codeKind != null">
        code_kind = #{codeKind,jdbcType=VARCHAR},
      </if>
      <if test="codeValue != null">
        code_value = #{codeValue,jdbcType=VARCHAR},
      </if>
      <if test="codeValueName != null">
        code_value_name = #{codeValueName,jdbcType=VARCHAR},
      </if>
      <if test="codeValueAlias != null">
        code_value_alias = #{codeValueAlias,jdbcType=VARCHAR},
      </if>
      <if test="codeValueDesc != null">
        code_value_desc = #{codeValueDesc,jdbcType=VARCHAR},
      </if>
      <if test="codeValueOrder != null">
        code_value_order = #{codeValueOrder,jdbcType=INTEGER},
      </if>
      <if test="codeValueIcon != null">
        code_value_icon = #{codeValueIcon,jdbcType=VARCHAR},
      </if>
      <if test="codeValueColor != null">
        code_value_color = #{codeValueColor,jdbcType=VARCHAR},
      </if>
      <if test="dataState != null">
        data_state = #{dataState,jdbcType=INTEGER},
      </if>
      <if test="creator != null">
        creator = #{creator,jdbcType=BIGINT},
      </if>
      <if test="createDate != null">
        create_date = #{createDate,jdbcType=TIMESTAMP},
      </if>
      <if test="modifier != null">
        modifier = #{modifier,jdbcType=BIGINT},
      </if>
      <if test="modifyDate != null">
        modify_date = #{modifyDate,jdbcType=TIMESTAMP},
      </if>
      <if test="parentCodeKind != null">
        parent_code_kind = #{parentCodeKind,jdbcType=BIGINT},
      </if>
    </set>
    where id = #{id,jdbcType=BIGINT}
  </update>
  <update id="updateByPrimaryKey" parameterType="com.zteits.job.domain.SysCodeValue">
    update sys_code_value
    set code_kind = #{codeKind,jdbcType=VARCHAR},
      code_value = #{codeValue,jdbcType=VARCHAR},
      code_value_name = #{codeValueName,jdbcType=VARCHAR},
      code_value_alias = #{codeValueAlias,jdbcType=VARCHAR},
      code_value_desc = #{codeValueDesc,jdbcType=VARCHAR},
      code_value_order = #{codeValueOrder,jdbcType=INTEGER},
      code_value_icon = #{codeValueIcon,jdbcType=VARCHAR},
      code_value_color = #{codeValueColor,jdbcType=VARCHAR},
      data_state = #{dataState,jdbcType=INTEGER},
      creator = #{creator,jdbcType=BIGINT},
      create_date = #{createDate,jdbcType=TIMESTAMP},
      modifier = #{modifier,jdbcType=BIGINT},
      modify_date = #{modifyDate,jdbcType=TIMESTAMP},
      parent_code_kind = #{parentCodeKind,jdbcType=BIGINT}
    where id = #{id,jdbcType=BIGINT}
  </update>
</mapper>