<?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.neusoft.smart.pos.payorder.persistent.mapper.PayTypeDictMapper">
  <resultMap id="BaseResultMap" type="com.neusoft.smart.pos.payorder.persistent.domain.PayTypeDict">
    <id column="id" jdbcType="INTEGER" property="id" />
    <result column="pay_type" jdbcType="VARCHAR" property="payType" />
    <result column="pay_platform_type" jdbcType="VARCHAR" property="payPlatformType" />
    <result column="pay_platform_domain_url" jdbcType="VARCHAR" property="payPlatformDomainUrl" />
    <result column="name" jdbcType="VARCHAR" property="name" />
    <result column="bean_name" jdbcType="VARCHAR" property="beanName" />
    <result column="description" jdbcType="VARCHAR" property="description" />
    <result column="pay_fee_rate" jdbcType="DECIMAL" property="payFeeRate" />
    <result column="is_enable" jdbcType="CHAR" property="isEnable" />
    <result column="notify_url" jdbcType="VARCHAR" property="notifyUrl" />
    <result column="refund_notify_url" jdbcType="VARCHAR" property="refundNotifyUrl" />
    <result column="is_show_on_pos" jdbcType="CHAR" property="isShowOnPos" />
    <result column="is_show" jdbcType="CHAR" property="isShow" />
    <result column="priority" jdbcType="TINYINT" property="priority" />
    <result column="version" jdbcType="INTEGER" property="version" />
    <result column="created_at" jdbcType="TIMESTAMP" property="createdAt" />
    <result column="created_by" jdbcType="VARCHAR" property="createdBy" />
    <result column="updated_by" jdbcType="VARCHAR" property="updatedBy" />
    <result column="updated_at" jdbcType="TIMESTAMP" property="updatedAt" />
    <result column="image_url" jdbcType="VARCHAR" property="imageUrl" />
    <result column="image_url_thumb" jdbcType="VARCHAR" property="imageUrlThumb" />
    <result column="category_type" jdbcType="VARCHAR" property="categoryType" />
  </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, pay_type, pay_platform_type, pay_platform_domain_url, name, bean_name, description, 
    pay_fee_rate, is_enable, notify_url, refund_notify_url, is_show_on_pos, is_show, 
    priority, version, created_at, created_by, updated_by, updated_at, image_url, image_url_thumb, 
    category_type
  </sql>
  <select id="selectByExample" parameterType="com.neusoft.smart.pos.payorder.persistent.domain.PayTypeDictExample" resultMap="BaseResultMap">
    select
    <if test="distinct">
      distinct
    </if>
    <include refid="Base_Column_List" />
    from pay_type_dict_v2
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
    <if test="orderByClause != null">
      order by ${orderByClause}
    </if>
    <if test="offset != null and limit != null">
      limit ${offset}, ${limit}
    </if>
  </select>
  <select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
    select 
    <include refid="Base_Column_List" />
    from pay_type_dict_v2
    where id = #{id,jdbcType=INTEGER}
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
    delete from pay_type_dict_v2
    where id = #{id,jdbcType=INTEGER}
  </delete>
  <delete id="deleteByExample" parameterType="com.neusoft.smart.pos.payorder.persistent.domain.PayTypeDictExample">
    delete from pay_type_dict_v2
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
  </delete>
  <insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.neusoft.smart.pos.payorder.persistent.domain.PayTypeDict" useGeneratedKeys="true">
    insert into pay_type_dict_v2 (pay_type, pay_platform_type, pay_platform_domain_url, 
      name, bean_name, description, 
      pay_fee_rate, is_enable, notify_url, 
      refund_notify_url, is_show_on_pos, is_show, 
      priority, version, created_at, 
      created_by, updated_by, updated_at, 
      image_url, image_url_thumb, category_type
      )
    values (#{payType,jdbcType=VARCHAR}, #{payPlatformType,jdbcType=VARCHAR}, #{payPlatformDomainUrl,jdbcType=VARCHAR}, 
      #{name,jdbcType=VARCHAR}, #{beanName,jdbcType=VARCHAR}, #{description,jdbcType=VARCHAR}, 
      #{payFeeRate,jdbcType=DECIMAL}, #{isEnable,jdbcType=CHAR}, #{notifyUrl,jdbcType=VARCHAR}, 
      #{refundNotifyUrl,jdbcType=VARCHAR}, #{isShowOnPos,jdbcType=CHAR}, #{isShow,jdbcType=CHAR}, 
      #{priority,jdbcType=TINYINT}, #{version,jdbcType=INTEGER}, #{createdAt,jdbcType=TIMESTAMP}, 
      #{createdBy,jdbcType=VARCHAR}, #{updatedBy,jdbcType=VARCHAR}, #{updatedAt,jdbcType=TIMESTAMP}, 
      #{imageUrl,jdbcType=VARCHAR}, #{imageUrlThumb,jdbcType=VARCHAR}, #{categoryType,jdbcType=VARCHAR}
      )
  </insert>
  <insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.neusoft.smart.pos.payorder.persistent.domain.PayTypeDict" useGeneratedKeys="true">
    insert into pay_type_dict_v2
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="payType != null">
        pay_type,
      </if>
      <if test="payPlatformType != null">
        pay_platform_type,
      </if>
      <if test="payPlatformDomainUrl != null">
        pay_platform_domain_url,
      </if>
      <if test="name != null">
        name,
      </if>
      <if test="beanName != null">
        bean_name,
      </if>
      <if test="description != null">
        description,
      </if>
      <if test="payFeeRate != null">
        pay_fee_rate,
      </if>
      <if test="isEnable != null">
        is_enable,
      </if>
      <if test="notifyUrl != null">
        notify_url,
      </if>
      <if test="refundNotifyUrl != null">
        refund_notify_url,
      </if>
      <if test="isShowOnPos != null">
        is_show_on_pos,
      </if>
      <if test="isShow != null">
        is_show,
      </if>
      <if test="priority != null">
        priority,
      </if>
      <if test="version != null">
        version,
      </if>
      <if test="createdAt != null">
        created_at,
      </if>
      <if test="createdBy != null">
        created_by,
      </if>
      <if test="updatedBy != null">
        updated_by,
      </if>
      <if test="updatedAt != null">
        updated_at,
      </if>
      <if test="imageUrl != null">
        image_url,
      </if>
      <if test="imageUrlThumb != null">
        image_url_thumb,
      </if>
      <if test="categoryType != null">
        category_type,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides=",">
      <if test="payType != null">
        #{payType,jdbcType=VARCHAR},
      </if>
      <if test="payPlatformType != null">
        #{payPlatformType,jdbcType=VARCHAR},
      </if>
      <if test="payPlatformDomainUrl != null">
        #{payPlatformDomainUrl,jdbcType=VARCHAR},
      </if>
      <if test="name != null">
        #{name,jdbcType=VARCHAR},
      </if>
      <if test="beanName != null">
        #{beanName,jdbcType=VARCHAR},
      </if>
      <if test="description != null">
        #{description,jdbcType=VARCHAR},
      </if>
      <if test="payFeeRate != null">
        #{payFeeRate,jdbcType=DECIMAL},
      </if>
      <if test="isEnable != null">
        #{isEnable,jdbcType=CHAR},
      </if>
      <if test="notifyUrl != null">
        #{notifyUrl,jdbcType=VARCHAR},
      </if>
      <if test="refundNotifyUrl != null">
        #{refundNotifyUrl,jdbcType=VARCHAR},
      </if>
      <if test="isShowOnPos != null">
        #{isShowOnPos,jdbcType=CHAR},
      </if>
      <if test="isShow != null">
        #{isShow,jdbcType=CHAR},
      </if>
      <if test="priority != null">
        #{priority,jdbcType=TINYINT},
      </if>
      <if test="version != null">
        #{version,jdbcType=INTEGER},
      </if>
      <if test="createdAt != null">
        #{createdAt,jdbcType=TIMESTAMP},
      </if>
      <if test="createdBy != null">
        #{createdBy,jdbcType=VARCHAR},
      </if>
      <if test="updatedBy != null">
        #{updatedBy,jdbcType=VARCHAR},
      </if>
      <if test="updatedAt != null">
        #{updatedAt,jdbcType=TIMESTAMP},
      </if>
      <if test="imageUrl != null">
        #{imageUrl,jdbcType=VARCHAR},
      </if>
      <if test="imageUrlThumb != null">
        #{imageUrlThumb,jdbcType=VARCHAR},
      </if>
      <if test="categoryType != null">
        #{categoryType,jdbcType=VARCHAR},
      </if>
    </trim>
  </insert>
  <select id="countByExample" parameterType="com.neusoft.smart.pos.payorder.persistent.domain.PayTypeDictExample" resultType="java.lang.Integer">
    select count(*) from pay_type_dict_v2
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
  </select>
  <update id="updateByExampleSelective" parameterType="map">
    update pay_type_dict_v2
    <set>
      <if test="record.id != null">
        id = #{record.id,jdbcType=INTEGER},
      </if>
      <if test="record.payType != null">
        pay_type = #{record.payType,jdbcType=VARCHAR},
      </if>
      <if test="record.payPlatformType != null">
        pay_platform_type = #{record.payPlatformType,jdbcType=VARCHAR},
      </if>
      <if test="record.payPlatformDomainUrl != null">
        pay_platform_domain_url = #{record.payPlatformDomainUrl,jdbcType=VARCHAR},
      </if>
      <if test="record.name != null">
        name = #{record.name,jdbcType=VARCHAR},
      </if>
      <if test="record.beanName != null">
        bean_name = #{record.beanName,jdbcType=VARCHAR},
      </if>
      <if test="record.description != null">
        description = #{record.description,jdbcType=VARCHAR},
      </if>
      <if test="record.payFeeRate != null">
        pay_fee_rate = #{record.payFeeRate,jdbcType=DECIMAL},
      </if>
      <if test="record.isEnable != null">
        is_enable = #{record.isEnable,jdbcType=CHAR},
      </if>
      <if test="record.notifyUrl != null">
        notify_url = #{record.notifyUrl,jdbcType=VARCHAR},
      </if>
      <if test="record.refundNotifyUrl != null">
        refund_notify_url = #{record.refundNotifyUrl,jdbcType=VARCHAR},
      </if>
      <if test="record.isShowOnPos != null">
        is_show_on_pos = #{record.isShowOnPos,jdbcType=CHAR},
      </if>
      <if test="record.isShow != null">
        is_show = #{record.isShow,jdbcType=CHAR},
      </if>
      <if test="record.priority != null">
        priority = #{record.priority,jdbcType=TINYINT},
      </if>
      <if test="record.version != null">
        version = #{record.version,jdbcType=INTEGER},
      </if>
      <if test="record.createdAt != null">
        created_at = #{record.createdAt,jdbcType=TIMESTAMP},
      </if>
      <if test="record.createdBy != null">
        created_by = #{record.createdBy,jdbcType=VARCHAR},
      </if>
      <if test="record.updatedBy != null">
        updated_by = #{record.updatedBy,jdbcType=VARCHAR},
      </if>
      <if test="record.updatedAt != null">
        updated_at = #{record.updatedAt,jdbcType=TIMESTAMP},
      </if>
      <if test="record.imageUrl != null">
        image_url = #{record.imageUrl,jdbcType=VARCHAR},
      </if>
      <if test="record.imageUrlThumb != null">
        image_url_thumb = #{record.imageUrlThumb,jdbcType=VARCHAR},
      </if>
      <if test="record.categoryType != null">
        category_type = #{record.categoryType,jdbcType=VARCHAR},
      </if>
    </set>
    <if test="_parameter != null">
      <include refid="Update_By_Example_Where_Clause" />
    </if>
  </update>
  <update id="updateByExample" parameterType="map">
    update pay_type_dict_v2
    set id = #{record.id,jdbcType=INTEGER},
      pay_type = #{record.payType,jdbcType=VARCHAR},
      pay_platform_type = #{record.payPlatformType,jdbcType=VARCHAR},
      pay_platform_domain_url = #{record.payPlatformDomainUrl,jdbcType=VARCHAR},
      name = #{record.name,jdbcType=VARCHAR},
      bean_name = #{record.beanName,jdbcType=VARCHAR},
      description = #{record.description,jdbcType=VARCHAR},
      pay_fee_rate = #{record.payFeeRate,jdbcType=DECIMAL},
      is_enable = #{record.isEnable,jdbcType=CHAR},
      notify_url = #{record.notifyUrl,jdbcType=VARCHAR},
      refund_notify_url = #{record.refundNotifyUrl,jdbcType=VARCHAR},
      is_show_on_pos = #{record.isShowOnPos,jdbcType=CHAR},
      is_show = #{record.isShow,jdbcType=CHAR},
      priority = #{record.priority,jdbcType=TINYINT},
      version = #{record.version,jdbcType=INTEGER},
      created_at = #{record.createdAt,jdbcType=TIMESTAMP},
      created_by = #{record.createdBy,jdbcType=VARCHAR},
      updated_by = #{record.updatedBy,jdbcType=VARCHAR},
      updated_at = #{record.updatedAt,jdbcType=TIMESTAMP},
      image_url = #{record.imageUrl,jdbcType=VARCHAR},
      image_url_thumb = #{record.imageUrlThumb,jdbcType=VARCHAR},
      category_type = #{record.categoryType,jdbcType=VARCHAR}
    <if test="_parameter != null">
      <include refid="Update_By_Example_Where_Clause" />
    </if>
  </update>
  <update id="updateByPrimaryKeySelective" parameterType="com.neusoft.smart.pos.payorder.persistent.domain.PayTypeDict">
    update pay_type_dict_v2
    <set>
      <if test="payType != null">
        pay_type = #{payType,jdbcType=VARCHAR},
      </if>
      <if test="payPlatformType != null">
        pay_platform_type = #{payPlatformType,jdbcType=VARCHAR},
      </if>
      <if test="payPlatformDomainUrl != null">
        pay_platform_domain_url = #{payPlatformDomainUrl,jdbcType=VARCHAR},
      </if>
      <if test="name != null">
        name = #{name,jdbcType=VARCHAR},
      </if>
      <if test="beanName != null">
        bean_name = #{beanName,jdbcType=VARCHAR},
      </if>
      <if test="description != null">
        description = #{description,jdbcType=VARCHAR},
      </if>
      <if test="payFeeRate != null">
        pay_fee_rate = #{payFeeRate,jdbcType=DECIMAL},
      </if>
      <if test="isEnable != null">
        is_enable = #{isEnable,jdbcType=CHAR},
      </if>
      <if test="notifyUrl != null">
        notify_url = #{notifyUrl,jdbcType=VARCHAR},
      </if>
      <if test="refundNotifyUrl != null">
        refund_notify_url = #{refundNotifyUrl,jdbcType=VARCHAR},
      </if>
      <if test="isShowOnPos != null">
        is_show_on_pos = #{isShowOnPos,jdbcType=CHAR},
      </if>
      <if test="isShow != null">
        is_show = #{isShow,jdbcType=CHAR},
      </if>
      <if test="priority != null">
        priority = #{priority,jdbcType=TINYINT},
      </if>
      <if test="version != null">
        version = #{version,jdbcType=INTEGER},
      </if>
      <if test="createdAt != null">
        created_at = #{createdAt,jdbcType=TIMESTAMP},
      </if>
      <if test="createdBy != null">
        created_by = #{createdBy,jdbcType=VARCHAR},
      </if>
      <if test="updatedBy != null">
        updated_by = #{updatedBy,jdbcType=VARCHAR},
      </if>
      <if test="updatedAt != null">
        updated_at = #{updatedAt,jdbcType=TIMESTAMP},
      </if>
      <if test="imageUrl != null">
        image_url = #{imageUrl,jdbcType=VARCHAR},
      </if>
      <if test="imageUrlThumb != null">
        image_url_thumb = #{imageUrlThumb,jdbcType=VARCHAR},
      </if>
      <if test="categoryType != null">
        category_type = #{categoryType,jdbcType=VARCHAR},
      </if>
    </set>
    where id = #{id,jdbcType=INTEGER}
  </update>
  <update id="updateByPrimaryKey" parameterType="com.neusoft.smart.pos.payorder.persistent.domain.PayTypeDict">
    update pay_type_dict_v2
    set pay_type = #{payType,jdbcType=VARCHAR},
      pay_platform_type = #{payPlatformType,jdbcType=VARCHAR},
      pay_platform_domain_url = #{payPlatformDomainUrl,jdbcType=VARCHAR},
      name = #{name,jdbcType=VARCHAR},
      bean_name = #{beanName,jdbcType=VARCHAR},
      description = #{description,jdbcType=VARCHAR},
      pay_fee_rate = #{payFeeRate,jdbcType=DECIMAL},
      is_enable = #{isEnable,jdbcType=CHAR},
      notify_url = #{notifyUrl,jdbcType=VARCHAR},
      refund_notify_url = #{refundNotifyUrl,jdbcType=VARCHAR},
      is_show_on_pos = #{isShowOnPos,jdbcType=CHAR},
      is_show = #{isShow,jdbcType=CHAR},
      priority = #{priority,jdbcType=TINYINT},
      version = #{version,jdbcType=INTEGER},
      created_at = #{createdAt,jdbcType=TIMESTAMP},
      created_by = #{createdBy,jdbcType=VARCHAR},
      updated_by = #{updatedBy,jdbcType=VARCHAR},
      updated_at = #{updatedAt,jdbcType=TIMESTAMP},
      image_url = #{imageUrl,jdbcType=VARCHAR},
      image_url_thumb = #{imageUrlThumb,jdbcType=VARCHAR},
      category_type = #{categoryType,jdbcType=VARCHAR}
    where id = #{id,jdbcType=INTEGER}
  </update>
  <insert id="batchInsert">
    <if test="items.get(0) != null">
            insert into pay_type_dict_v2  (pay_type, pay_platform_type, pay_platform_domain_url, 
        name, bean_name, description, 
        pay_fee_rate, is_enable, notify_url, 
        refund_notify_url, is_show_on_pos, is_show, 
        priority, version, created_at, 
        created_by, updated_by, updated_at, 
        image_url, image_url_thumb, category_type
        )
      values
      <foreach collection="items" item="item" index="index" separator=",">
      (#{item.payType,jdbcType=VARCHAR}, #{item.payPlatformType,jdbcType=VARCHAR}, #{item.payPlatformDomainUrl,jdbcType=VARCHAR}, 
        #{item.name,jdbcType=VARCHAR}, #{item.beanName,jdbcType=VARCHAR}, #{item.description,jdbcType=VARCHAR}, 
        #{item.payFeeRate,jdbcType=DECIMAL}, #{item.isEnable,jdbcType=CHAR}, #{item.notifyUrl,jdbcType=VARCHAR}, 
        #{item.refundNotifyUrl,jdbcType=VARCHAR}, #{item.isShowOnPos,jdbcType=CHAR}, #{item.isShow,jdbcType=CHAR}, 
        #{item.priority,jdbcType=TINYINT}, #{item.version,jdbcType=INTEGER}, #{item.createdAt,jdbcType=TIMESTAMP}, 
        #{item.createdBy,jdbcType=VARCHAR}, #{item.updatedBy,jdbcType=VARCHAR}, #{item.updatedAt,jdbcType=TIMESTAMP}, 
        #{item.imageUrl,jdbcType=VARCHAR}, #{item.imageUrlThumb,jdbcType=VARCHAR}, #{item.categoryType,jdbcType=VARCHAR}
        )
      </foreach>
    </if>
  </insert>
</mapper>