<?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.dhcc.finance.main.dao.CwBdScenariofieldMapper">
  <resultMap id="BaseResultMap" type="com.dhcc.finance.main.domain.CwBdScenariofield">
    <id column="ID" jdbcType="VARCHAR" property="id" />
    <result column="FLOW_TYPE" jdbcType="VARCHAR" property="flowType" />
    <result column="SCENARIO_FIELD" jdbcType="VARCHAR" property="scenarioField" />
    <result column="FLOW_FIELD" jdbcType="VARCHAR" property="flowField" />
  </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, FLOW_TYPE, SCENARIO_FIELD, FLOW_FIELD
  </sql>
  <select id="selectByExample" parameterType="com.dhcc.finance.main.domain.CwBdScenariofieldExample" resultMap="BaseResultMap">
    select
    <if test="distinct">
      distinct
    </if>
    <include refid="Base_Column_List" />
    from cw_bd_scenariofield
    <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.String" resultMap="BaseResultMap">
    select 
    <include refid="Base_Column_List" />
    from cw_bd_scenariofield
    where ID = #{id,jdbcType=VARCHAR}
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.String">
    delete from cw_bd_scenariofield
    where ID = #{id,jdbcType=VARCHAR}
  </delete>
  <delete id="deleteByExample" parameterType="com.dhcc.finance.main.domain.CwBdScenariofieldExample">
    delete from cw_bd_scenariofield
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
  </delete>
  <insert id="insert" parameterType="com.dhcc.finance.main.domain.CwBdScenariofield">
    insert into cw_bd_scenariofield (ID, FLOW_TYPE, SCENARIO_FIELD, 
      FLOW_FIELD)
    values (#{id,jdbcType=VARCHAR}, #{flowType,jdbcType=VARCHAR}, #{scenarioField,jdbcType=VARCHAR}, 
      #{flowField,jdbcType=VARCHAR})
  </insert>
  <insert id="insertSelective" parameterType="com.dhcc.finance.main.domain.CwBdScenariofield">
    insert into cw_bd_scenariofield
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="id != null">
        ID,
      </if>
      <if test="flowType != null">
        FLOW_TYPE,
      </if>
      <if test="scenarioField != null">
        SCENARIO_FIELD,
      </if>
      <if test="flowField != null">
        FLOW_FIELD,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides=",">
      <if test="id != null">
        #{id,jdbcType=VARCHAR},
      </if>
      <if test="flowType != null">
        #{flowType,jdbcType=VARCHAR},
      </if>
      <if test="scenarioField != null">
        #{scenarioField,jdbcType=VARCHAR},
      </if>
      <if test="flowField != null">
        #{flowField,jdbcType=VARCHAR},
      </if>
    </trim>
  </insert>
  <select id="countByExample" parameterType="com.dhcc.finance.main.domain.CwBdScenariofieldExample" resultType="java.lang.Long">
    select count(*) from cw_bd_scenariofield
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
  </select>
  <update id="updateByExampleSelective" parameterType="map">
    update cw_bd_scenariofield
    <set>
      <if test="record.id != null">
        ID = #{record.id,jdbcType=VARCHAR},
      </if>
      <if test="record.flowType != null">
        FLOW_TYPE = #{record.flowType,jdbcType=VARCHAR},
      </if>
      <if test="record.scenarioField != null">
        SCENARIO_FIELD = #{record.scenarioField,jdbcType=VARCHAR},
      </if>
      <if test="record.flowField != null">
        FLOW_FIELD = #{record.flowField,jdbcType=VARCHAR},
      </if>
    </set>
    <if test="_parameter != null">
      <include refid="Update_By_Example_Where_Clause" />
    </if>
  </update>
  <update id="updateByExample" parameterType="map">
    update cw_bd_scenariofield
    set ID = #{record.id,jdbcType=VARCHAR},
      FLOW_TYPE = #{record.flowType,jdbcType=VARCHAR},
      SCENARIO_FIELD = #{record.scenarioField,jdbcType=VARCHAR},
      FLOW_FIELD = #{record.flowField,jdbcType=VARCHAR}
    <if test="_parameter != null">
      <include refid="Update_By_Example_Where_Clause" />
    </if>
  </update>
  <update id="updateByPrimaryKeySelective" parameterType="com.dhcc.finance.main.domain.CwBdScenariofield">
    update cw_bd_scenariofield
    <set>
      <if test="flowType != null">
        FLOW_TYPE = #{flowType,jdbcType=VARCHAR},
      </if>
      <if test="scenarioField != null">
        SCENARIO_FIELD = #{scenarioField,jdbcType=VARCHAR},
      </if>
      <if test="flowField != null">
        FLOW_FIELD = #{flowField,jdbcType=VARCHAR},
      </if>
    </set>
    where ID = #{id,jdbcType=VARCHAR}
  </update>
  <update id="updateByPrimaryKey" parameterType="com.dhcc.finance.main.domain.CwBdScenariofield">
    update cw_bd_scenariofield
    set FLOW_TYPE = #{flowType,jdbcType=VARCHAR},
      SCENARIO_FIELD = #{scenarioField,jdbcType=VARCHAR},
      FLOW_FIELD = #{flowField,jdbcType=VARCHAR}
    where ID = #{id,jdbcType=VARCHAR}
  </update>
    <select id="selectFlowField"  flushCache="true" parameterType="java.lang.String" resultMap="BaseResultMap">
    select 
    <include refid="Base_Column_List" />
    from cw_bd_scenariofield
    where FLOW_TYPE = #{flowType,jdbcType=VARCHAR} and 
      SCENARIO_FIELD = #{scenarioField,jdbcType=VARCHAR}
  </select>
   <select id="selectAllData"  flushCache="true" resultMap="BaseResultMap">
    select 
    <include refid="Base_Column_List" />
    from cw_bd_scenariofield
  </select>
</mapper>