<?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.superdesk.uniorder.dao.mapper.sys.role.SysRoleExtDataSampleMapper">
  <resultMap id="BaseResultMap" type="cn.superdesk.uniorder.dao.entity.sys.role.SysRoleExtDataSample">

    <id column="id" jdbcType="BIGINT" property="id" />
    <result column="service_no" jdbcType="VARCHAR" property="serviceNo" />
    <result column="service_name" jdbcType="VARCHAR" property="serviceName" />
    <result column="source_from" jdbcType="VARCHAR" property="sourceFrom" />
    <result column="source_from_quote_id" jdbcType="BIGINT" property="sourceFromQuoteId" />
    <result column="source_from_quote_parent_id" jdbcType="BIGINT" property="sourceFromQuoteParentId" />
    <result column="permit_start_time" jdbcType="TIMESTAMP" property="permitStartTime" />
    <result column="permit_end_time" jdbcType="TIMESTAMP" property="permitEndTime" />
    <result column="is_bind_virt" jdbcType="TINYINT" property="isBindVirt" />
    <result column="sys_org_id" jdbcType="BIGINT" property="sysOrgId" />
    <result column="out_org_id" jdbcType="BIGINT" property="outOrgId" />
    <result column="sys_virt_ids" jdbcType="VARCHAR" property="sysVirtIds" />
    <result column="out_virt_ids" jdbcType="VARCHAR" property="outVirtIds" />
    <result column="deleted" jdbcType="TINYINT" property="deleted" />
    <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
    <result column="create_user_id" jdbcType="BIGINT" property="createUserId" />
    <result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
    <result column="update_user_id" jdbcType="BIGINT" property="updateUserId" />
  </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, service_no, service_name, source_from, source_from_quote_id, source_from_quote_parent_id, 
    permit_start_time, permit_end_time, is_bind_virt, sys_org_id, out_org_id, sys_virt_ids, 
    out_virt_ids, deleted, create_time, create_user_id, update_time, update_user_id
  </sql>
  <select id="selectByExample" parameterType="cn.superdesk.uniorder.dao.entity.sys.role.SysRoleExtDataSampleExample" resultMap="BaseResultMap">

    select
    <if test="distinct">
      distinct
    </if>
    <include refid="Base_Column_List" />
    from sys_role_ext_data_sample
    <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_role_ext_data_sample
    where id = #{id,jdbcType=BIGINT}
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">

    delete from sys_role_ext_data_sample
    where id = #{id,jdbcType=BIGINT}
  </delete>
  <delete id="deleteByExample" parameterType="cn.superdesk.uniorder.dao.entity.sys.role.SysRoleExtDataSampleExample">

    delete from sys_role_ext_data_sample
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
  </delete>
  <insert id="insert" parameterType="cn.superdesk.uniorder.dao.entity.sys.role.SysRoleExtDataSample">

    <selectKey keyProperty="id" order="AFTER" resultType="java.lang.Long">
      SELECT LAST_INSERT_ID()
    </selectKey>
    insert into sys_role_ext_data_sample (service_no, service_name, source_from, 
      source_from_quote_id, source_from_quote_parent_id, 
      permit_start_time, permit_end_time, is_bind_virt, 
      sys_org_id, out_org_id, sys_virt_ids, 
      out_virt_ids, deleted, create_time, 
      create_user_id, update_time, update_user_id
      )
    values (#{serviceNo,jdbcType=VARCHAR}, #{serviceName,jdbcType=VARCHAR}, #{sourceFrom,jdbcType=VARCHAR}, 
      #{sourceFromQuoteId,jdbcType=BIGINT}, #{sourceFromQuoteParentId,jdbcType=BIGINT}, 
      #{permitStartTime,jdbcType=TIMESTAMP}, #{permitEndTime,jdbcType=TIMESTAMP}, #{isBindVirt,jdbcType=TINYINT}, 
      #{sysOrgId,jdbcType=BIGINT}, #{outOrgId,jdbcType=BIGINT}, #{sysVirtIds,jdbcType=VARCHAR}, 
      #{outVirtIds,jdbcType=VARCHAR}, #{deleted,jdbcType=TINYINT}, #{createTime,jdbcType=TIMESTAMP}, 
      #{createUserId,jdbcType=BIGINT}, #{updateTime,jdbcType=TIMESTAMP}, #{updateUserId,jdbcType=BIGINT}
      )
  </insert>
  <insert id="insertSelective" parameterType="cn.superdesk.uniorder.dao.entity.sys.role.SysRoleExtDataSample">

    <selectKey keyProperty="id" order="AFTER" resultType="java.lang.Long">
      SELECT LAST_INSERT_ID()
    </selectKey>
    insert into sys_role_ext_data_sample
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="serviceNo != null">
        service_no,
      </if>
      <if test="serviceName != null">
        service_name,
      </if>
      <if test="sourceFrom != null">
        source_from,
      </if>
      <if test="sourceFromQuoteId != null">
        source_from_quote_id,
      </if>
      <if test="sourceFromQuoteParentId != null">
        source_from_quote_parent_id,
      </if>
      <if test="permitStartTime != null">
        permit_start_time,
      </if>
      <if test="permitEndTime != null">
        permit_end_time,
      </if>
      <if test="isBindVirt != null">
        is_bind_virt,
      </if>
      <if test="sysOrgId != null">
        sys_org_id,
      </if>
      <if test="outOrgId != null">
        out_org_id,
      </if>
      <if test="sysVirtIds != null">
        sys_virt_ids,
      </if>
      <if test="outVirtIds != null">
        out_virt_ids,
      </if>
      <if test="deleted != null">
        deleted,
      </if>
      <if test="createTime != null">
        create_time,
      </if>
      <if test="createUserId != null">
        create_user_id,
      </if>
      <if test="updateTime != null">
        update_time,
      </if>
      <if test="updateUserId != null">
        update_user_id,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides=",">
      <if test="serviceNo != null">
        #{serviceNo,jdbcType=VARCHAR},
      </if>
      <if test="serviceName != null">
        #{serviceName,jdbcType=VARCHAR},
      </if>
      <if test="sourceFrom != null">
        #{sourceFrom,jdbcType=VARCHAR},
      </if>
      <if test="sourceFromQuoteId != null">
        #{sourceFromQuoteId,jdbcType=BIGINT},
      </if>
      <if test="sourceFromQuoteParentId != null">
        #{sourceFromQuoteParentId,jdbcType=BIGINT},
      </if>
      <if test="permitStartTime != null">
        #{permitStartTime,jdbcType=TIMESTAMP},
      </if>
      <if test="permitEndTime != null">
        #{permitEndTime,jdbcType=TIMESTAMP},
      </if>
      <if test="isBindVirt != null">
        #{isBindVirt,jdbcType=TINYINT},
      </if>
      <if test="sysOrgId != null">
        #{sysOrgId,jdbcType=BIGINT},
      </if>
      <if test="outOrgId != null">
        #{outOrgId,jdbcType=BIGINT},
      </if>
      <if test="sysVirtIds != null">
        #{sysVirtIds,jdbcType=VARCHAR},
      </if>
      <if test="outVirtIds != null">
        #{outVirtIds,jdbcType=VARCHAR},
      </if>
      <if test="deleted != null">
        #{deleted,jdbcType=TINYINT},
      </if>
      <if test="createTime != null">
        #{createTime,jdbcType=TIMESTAMP},
      </if>
      <if test="createUserId != null">
        #{createUserId,jdbcType=BIGINT},
      </if>
      <if test="updateTime != null">
        #{updateTime,jdbcType=TIMESTAMP},
      </if>
      <if test="updateUserId != null">
        #{updateUserId,jdbcType=BIGINT},
      </if>
    </trim>
  </insert>
  <select id="countByExample" parameterType="cn.superdesk.uniorder.dao.entity.sys.role.SysRoleExtDataSampleExample" resultType="java.lang.Long">

    select count(*) from sys_role_ext_data_sample
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
  </select>
  <update id="updateByExampleSelective" parameterType="map">

    update sys_role_ext_data_sample
    <set>
      <if test="record.id != null">
        id = #{record.id,jdbcType=BIGINT},
      </if>
      <if test="record.serviceNo != null">
        service_no = #{record.serviceNo,jdbcType=VARCHAR},
      </if>
      <if test="record.serviceName != null">
        service_name = #{record.serviceName,jdbcType=VARCHAR},
      </if>
      <if test="record.sourceFrom != null">
        source_from = #{record.sourceFrom,jdbcType=VARCHAR},
      </if>
      <if test="record.sourceFromQuoteId != null">
        source_from_quote_id = #{record.sourceFromQuoteId,jdbcType=BIGINT},
      </if>
      <if test="record.sourceFromQuoteParentId != null">
        source_from_quote_parent_id = #{record.sourceFromQuoteParentId,jdbcType=BIGINT},
      </if>
      <if test="record.permitStartTime != null">
        permit_start_time = #{record.permitStartTime,jdbcType=TIMESTAMP},
      </if>
      <if test="record.permitEndTime != null">
        permit_end_time = #{record.permitEndTime,jdbcType=TIMESTAMP},
      </if>
      <if test="record.isBindVirt != null">
        is_bind_virt = #{record.isBindVirt,jdbcType=TINYINT},
      </if>
      <if test="record.sysOrgId != null">
        sys_org_id = #{record.sysOrgId,jdbcType=BIGINT},
      </if>
      <if test="record.outOrgId != null">
        out_org_id = #{record.outOrgId,jdbcType=BIGINT},
      </if>
      <if test="record.sysVirtIds != null">
        sys_virt_ids = #{record.sysVirtIds,jdbcType=VARCHAR},
      </if>
      <if test="record.outVirtIds != null">
        out_virt_ids = #{record.outVirtIds,jdbcType=VARCHAR},
      </if>
      <if test="record.deleted != null">
        deleted = #{record.deleted,jdbcType=TINYINT},
      </if>
      <if test="record.createTime != null">
        create_time = #{record.createTime,jdbcType=TIMESTAMP},
      </if>
      <if test="record.createUserId != null">
        create_user_id = #{record.createUserId,jdbcType=BIGINT},
      </if>
      <if test="record.updateTime != null">
        update_time = #{record.updateTime,jdbcType=TIMESTAMP},
      </if>
      <if test="record.updateUserId != null">
        update_user_id = #{record.updateUserId,jdbcType=BIGINT},
      </if>
    </set>
    <if test="_parameter != null">
      <include refid="Update_By_Example_Where_Clause" />
    </if>
  </update>
  <update id="updateByExample" parameterType="map">

    update sys_role_ext_data_sample
    set id = #{record.id,jdbcType=BIGINT},
      service_no = #{record.serviceNo,jdbcType=VARCHAR},
      service_name = #{record.serviceName,jdbcType=VARCHAR},
      source_from = #{record.sourceFrom,jdbcType=VARCHAR},
      source_from_quote_id = #{record.sourceFromQuoteId,jdbcType=BIGINT},
      source_from_quote_parent_id = #{record.sourceFromQuoteParentId,jdbcType=BIGINT},
      permit_start_time = #{record.permitStartTime,jdbcType=TIMESTAMP},
      permit_end_time = #{record.permitEndTime,jdbcType=TIMESTAMP},
      is_bind_virt = #{record.isBindVirt,jdbcType=TINYINT},
      sys_org_id = #{record.sysOrgId,jdbcType=BIGINT},
      out_org_id = #{record.outOrgId,jdbcType=BIGINT},
      sys_virt_ids = #{record.sysVirtIds,jdbcType=VARCHAR},
      out_virt_ids = #{record.outVirtIds,jdbcType=VARCHAR},
      deleted = #{record.deleted,jdbcType=TINYINT},
      create_time = #{record.createTime,jdbcType=TIMESTAMP},
      create_user_id = #{record.createUserId,jdbcType=BIGINT},
      update_time = #{record.updateTime,jdbcType=TIMESTAMP},
      update_user_id = #{record.updateUserId,jdbcType=BIGINT}
    <if test="_parameter != null">
      <include refid="Update_By_Example_Where_Clause" />
    </if>
  </update>
  <update id="updateByPrimaryKeySelective" parameterType="cn.superdesk.uniorder.dao.entity.sys.role.SysRoleExtDataSample">

    update sys_role_ext_data_sample
    <set>
      <if test="serviceNo != null">
        service_no = #{serviceNo,jdbcType=VARCHAR},
      </if>
      <if test="serviceName != null">
        service_name = #{serviceName,jdbcType=VARCHAR},
      </if>
      <if test="sourceFrom != null">
        source_from = #{sourceFrom,jdbcType=VARCHAR},
      </if>
      <if test="sourceFromQuoteId != null">
        source_from_quote_id = #{sourceFromQuoteId,jdbcType=BIGINT},
      </if>
      <if test="sourceFromQuoteParentId != null">
        source_from_quote_parent_id = #{sourceFromQuoteParentId,jdbcType=BIGINT},
      </if>
      <if test="permitStartTime != null">
        permit_start_time = #{permitStartTime,jdbcType=TIMESTAMP},
      </if>
      <if test="permitEndTime != null">
        permit_end_time = #{permitEndTime,jdbcType=TIMESTAMP},
      </if>
      <if test="isBindVirt != null">
        is_bind_virt = #{isBindVirt,jdbcType=TINYINT},
      </if>
      <if test="sysOrgId != null">
        sys_org_id = #{sysOrgId,jdbcType=BIGINT},
      </if>
      <if test="outOrgId != null">
        out_org_id = #{outOrgId,jdbcType=BIGINT},
      </if>
      <if test="sysVirtIds != null">
        sys_virt_ids = #{sysVirtIds,jdbcType=VARCHAR},
      </if>
      <if test="outVirtIds != null">
        out_virt_ids = #{outVirtIds,jdbcType=VARCHAR},
      </if>
      <if test="deleted != null">
        deleted = #{deleted,jdbcType=TINYINT},
      </if>
      <if test="createTime != null">
        create_time = #{createTime,jdbcType=TIMESTAMP},
      </if>
      <if test="createUserId != null">
        create_user_id = #{createUserId,jdbcType=BIGINT},
      </if>
      <if test="updateTime != null">
        update_time = #{updateTime,jdbcType=TIMESTAMP},
      </if>
      <if test="updateUserId != null">
        update_user_id = #{updateUserId,jdbcType=BIGINT},
      </if>
    </set>
    where id = #{id,jdbcType=BIGINT}
  </update>
  <update id="updateByPrimaryKey" parameterType="cn.superdesk.uniorder.dao.entity.sys.role.SysRoleExtDataSample">

    update sys_role_ext_data_sample
    set service_no = #{serviceNo,jdbcType=VARCHAR},
      service_name = #{serviceName,jdbcType=VARCHAR},
      source_from = #{sourceFrom,jdbcType=VARCHAR},
      source_from_quote_id = #{sourceFromQuoteId,jdbcType=BIGINT},
      source_from_quote_parent_id = #{sourceFromQuoteParentId,jdbcType=BIGINT},
      permit_start_time = #{permitStartTime,jdbcType=TIMESTAMP},
      permit_end_time = #{permitEndTime,jdbcType=TIMESTAMP},
      is_bind_virt = #{isBindVirt,jdbcType=TINYINT},
      sys_org_id = #{sysOrgId,jdbcType=BIGINT},
      out_org_id = #{outOrgId,jdbcType=BIGINT},
      sys_virt_ids = #{sysVirtIds,jdbcType=VARCHAR},
      out_virt_ids = #{outVirtIds,jdbcType=VARCHAR},
      deleted = #{deleted,jdbcType=TINYINT},
      create_time = #{createTime,jdbcType=TIMESTAMP},
      create_user_id = #{createUserId,jdbcType=BIGINT},
      update_time = #{updateTime,jdbcType=TIMESTAMP},
      update_user_id = #{updateUserId,jdbcType=BIGINT}
    where id = #{id,jdbcType=BIGINT}
  </update>
</mapper>