<?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.zheng.pay.dao.mapper.PayOutOrderDetailMapper">
  <resultMap id="BaseResultMap" type="com.zheng.pay.dao.model.PayOutOrderDetail">
    <id column="pay_out_order_detail_id" jdbcType="INTEGER" property="payOutOrderDetailId" />
    <result column="pay_out_order_id" jdbcType="INTEGER" property="payOutOrderId" />
    <result column="remark" jdbcType="VARCHAR" property="remark" />
  </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">
    pay_out_order_detail_id, pay_out_order_id, remark
  </sql>
  <select id="selectByExample" parameterType="com.zheng.pay.dao.model.PayOutOrderDetailExample" resultMap="BaseResultMap">
    select
    <if test="distinct">
      distinct
    </if>
    <include refid="Base_Column_List" />
    from pay_out_order_detail
    <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.Integer" resultMap="BaseResultMap">
    select 
    <include refid="Base_Column_List" />
    from pay_out_order_detail
    where pay_out_order_detail_id = #{payOutOrderDetailId,jdbcType=INTEGER}
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
    delete from pay_out_order_detail
    where pay_out_order_detail_id = #{payOutOrderDetailId,jdbcType=INTEGER}
  </delete>
  <delete id="deleteByExample" parameterType="com.zheng.pay.dao.model.PayOutOrderDetailExample">
    delete from pay_out_order_detail
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
  </delete>
  <insert id="insert" parameterType="com.zheng.pay.dao.model.PayOutOrderDetail">
    insert into pay_out_order_detail (pay_out_order_detail_id, pay_out_order_id, 
      remark)
    values (#{payOutOrderDetailId,jdbcType=INTEGER}, #{payOutOrderId,jdbcType=INTEGER}, 
      #{remark,jdbcType=VARCHAR})
  </insert>
  <insert id="insertSelective" parameterType="com.zheng.pay.dao.model.PayOutOrderDetail">
    insert into pay_out_order_detail
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="payOutOrderDetailId != null">
        pay_out_order_detail_id,
      </if>
      <if test="payOutOrderId != null">
        pay_out_order_id,
      </if>
      <if test="remark != null">
        remark,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides=",">
      <if test="payOutOrderDetailId != null">
        #{payOutOrderDetailId,jdbcType=INTEGER},
      </if>
      <if test="payOutOrderId != null">
        #{payOutOrderId,jdbcType=INTEGER},
      </if>
      <if test="remark != null">
        #{remark,jdbcType=VARCHAR},
      </if>
    </trim>
  </insert>
  <select id="countByExample" parameterType="com.zheng.pay.dao.model.PayOutOrderDetailExample" resultType="java.lang.Long">
    select count(*) from pay_out_order_detail
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
  </select>
  <update id="updateByExampleSelective" parameterType="map">
    update pay_out_order_detail
    <set>
      <if test="record.payOutOrderDetailId != null">
        pay_out_order_detail_id = #{record.payOutOrderDetailId,jdbcType=INTEGER},
      </if>
      <if test="record.payOutOrderId != null">
        pay_out_order_id = #{record.payOutOrderId,jdbcType=INTEGER},
      </if>
      <if test="record.remark != null">
        remark = #{record.remark,jdbcType=VARCHAR},
      </if>
    </set>
    <if test="_parameter != null">
      <include refid="Update_By_Example_Where_Clause" />
    </if>
  </update>
  <update id="updateByExample" parameterType="map">
    update pay_out_order_detail
    set pay_out_order_detail_id = #{record.payOutOrderDetailId,jdbcType=INTEGER},
      pay_out_order_id = #{record.payOutOrderId,jdbcType=INTEGER},
      remark = #{record.remark,jdbcType=VARCHAR}
    <if test="_parameter != null">
      <include refid="Update_By_Example_Where_Clause" />
    </if>
  </update>
  <update id="updateByPrimaryKeySelective" parameterType="com.zheng.pay.dao.model.PayOutOrderDetail">
    update pay_out_order_detail
    <set>
      <if test="payOutOrderId != null">
        pay_out_order_id = #{payOutOrderId,jdbcType=INTEGER},
      </if>
      <if test="remark != null">
        remark = #{remark,jdbcType=VARCHAR},
      </if>
    </set>
    where pay_out_order_detail_id = #{payOutOrderDetailId,jdbcType=INTEGER}
  </update>
  <update id="updateByPrimaryKey" parameterType="com.zheng.pay.dao.model.PayOutOrderDetail">
    update pay_out_order_detail
    set pay_out_order_id = #{payOutOrderId,jdbcType=INTEGER},
      remark = #{remark,jdbcType=VARCHAR}
    where pay_out_order_detail_id = #{payOutOrderDetailId,jdbcType=INTEGER}
  </update>
  <cache type="org.mybatis.caches.ehcache.LoggingEhcache" />
</mapper>