<?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.xhpc.pp.mapper.IccardInfoMapper">
  <resultMap id="BaseResultMap" type="com.xhpc.common.domain.IccardInfo">
    <id column="id" jdbcType="INTEGER" property="id"/>
    <result column="cardID" jdbcType="VARCHAR" property="cardid"/>
    <result column="cardNo" jdbcType="VARCHAR" property="cardno"/>
    <result column="cardType" jdbcType="TINYINT" property="cardtype"/>
    <result column="password" jdbcType="VARCHAR" property="password"/>
    <result column="userIndex" jdbcType="INTEGER" property="userindex"/>
    <result column="corpNo" jdbcType="VARCHAR" property="corpno"/>
    <result column="cashPledge" jdbcType="INTEGER" property="cashpledge"/>
    <result column="balance" jdbcType="INTEGER" property="balance"/>
    <result column="status" jdbcType="TINYINT" property="status"/>
    <result column="createTime" jdbcType="TIMESTAMP" property="createtime"/>
  </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, cardID, cardNo, cardType, `password`, userIndex, corpNo, cashPledge, balance,
    `status`, createTime
  </sql>
  <select id="selectByExample" parameterType="com.xhpc.common.domain.IccardInfoExample" resultMap="BaseResultMap">
    select
    <if test="distinct">
      distinct
    </if>
    <include refid="Base_Column_List"/>
    from t_iccard_info
    <if test="_parameter != null">
      <include refid="Example_Where_Clause"/>
    </if>
    <if test="orderByClause != null">
      order by ${orderByClause}
    </if>
    <if test="limit != null">
      <if test="offset != null">
        limit ${offset}, ${limit}
      </if>
      <if test="offset == null">
        limit ${limit}
      </if>
    </if>
    <if test="forUpdate != null and forUpdate == true">
      for update
    </if>
  </select>
  <select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
    select
    <include refid="Base_Column_List"/>
    from t_iccard_info
    where id = #{id,jdbcType=INTEGER}
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
    delete
    from t_iccard_info
    where id = #{id,jdbcType=INTEGER}
  </delete>
  <delete id="deleteByExample" parameterType="com.xhpc.common.domain.IccardInfoExample">
    delete from t_iccard_info
    <if test="_parameter != null">
      <include refid="Example_Where_Clause"/>
    </if>
  </delete>
  <insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.xhpc.common.domain.IccardInfo"
          useGeneratedKeys="true">
    insert into t_iccard_info (cardID, cardNo, cardType,
                               `password`, userIndex, corpNo,
                               cashPledge, balance, `status`,
                               createTime)
    values (#{cardid,jdbcType=VARCHAR}, #{cardno,jdbcType=VARCHAR}, #{cardtype,jdbcType=TINYINT},
            #{password,jdbcType=VARCHAR}, #{userindex,jdbcType=INTEGER}, #{corpno,jdbcType=VARCHAR},
            #{cashpledge,jdbcType=INTEGER}, #{balance,jdbcType=INTEGER}, #{status,jdbcType=TINYINT},
            #{createtime,jdbcType=TIMESTAMP})
  </insert>
  <insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.xhpc.common.domain.IccardInfo"
          useGeneratedKeys="true">
    insert into t_iccard_info
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="cardid != null">
        cardID,
      </if>
      <if test="cardno != null">
        cardNo,
      </if>
      <if test="cardtype != null">
        cardType,
      </if>
      <if test="password != null">
        `password`,
      </if>
      <if test="userindex != null">
        userIndex,
      </if>
      <if test="corpno != null">
        corpNo,
      </if>
      <if test="cashpledge != null">
        cashPledge,
      </if>
      <if test="balance != null">
        balance,
      </if>
      <if test="status != null">
        `status`,
      </if>
      <if test="createtime != null">
        createTime,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides=",">
      <if test="cardid != null">
        #{cardid,jdbcType=VARCHAR},
      </if>
      <if test="cardno != null">
        #{cardno,jdbcType=VARCHAR},
      </if>
      <if test="cardtype != null">
        #{cardtype,jdbcType=TINYINT},
      </if>
      <if test="password != null">
        #{password,jdbcType=VARCHAR},
      </if>
      <if test="userindex != null">
        #{userindex,jdbcType=INTEGER},
      </if>
      <if test="corpno != null">
        #{corpno,jdbcType=VARCHAR},
      </if>
      <if test="cashpledge != null">
        #{cashpledge,jdbcType=INTEGER},
      </if>
      <if test="balance != null">
        #{balance,jdbcType=INTEGER},
      </if>
      <if test="status != null">
        #{status,jdbcType=TINYINT},
      </if>
      <if test="createtime != null">
        #{createtime,jdbcType=TIMESTAMP},
      </if>
    </trim>
  </insert>
  <select id="countByExample" parameterType="com.xhpc.common.domain.IccardInfoExample" resultType="java.lang.Long">
    select count(*) from t_iccard_info
    <if test="_parameter != null">
      <include refid="Example_Where_Clause"/>
    </if>
  </select>
  <update id="updateByExampleSelective" parameterType="map">
    update t_iccard_info
    <set>
      <if test="record.id != null">
        id = #{record.id,jdbcType=INTEGER},
      </if>
      <if test="record.cardid != null">
        cardID = #{record.cardid,jdbcType=VARCHAR},
      </if>
      <if test="record.cardno != null">
        cardNo = #{record.cardno,jdbcType=VARCHAR},
      </if>
      <if test="record.cardtype != null">
        cardType = #{record.cardtype,jdbcType=TINYINT},
      </if>
      <if test="record.password != null">
        `password` = #{record.password,jdbcType=VARCHAR},
      </if>
      <if test="record.userindex != null">
        userIndex = #{record.userindex,jdbcType=INTEGER},
      </if>
      <if test="record.corpno != null">
        corpNo = #{record.corpno,jdbcType=VARCHAR},
      </if>
      <if test="record.cashpledge != null">
        cashPledge = #{record.cashpledge,jdbcType=INTEGER},
      </if>
      <if test="record.balance != null">
        balance = #{record.balance,jdbcType=INTEGER},
      </if>
      <if test="record.status != null">
        `status` = #{record.status,jdbcType=TINYINT},
      </if>
      <if test="record.createtime != null">
        createTime = #{record.createtime,jdbcType=TIMESTAMP},
      </if>
    </set>
    <if test="_parameter != null">
      <include refid="Update_By_Example_Where_Clause"/>
    </if>
  </update>
  <update id="updateByExample" parameterType="map">
    update t_iccard_info
    set id = #{record.id,jdbcType=INTEGER},
    cardID = #{record.cardid,jdbcType=VARCHAR},
    cardNo = #{record.cardno,jdbcType=VARCHAR},
    cardType = #{record.cardtype,jdbcType=TINYINT},
    `password` = #{record.password,jdbcType=VARCHAR},
    userIndex = #{record.userindex,jdbcType=INTEGER},
    corpNo = #{record.corpno,jdbcType=VARCHAR},
    cashPledge = #{record.cashpledge,jdbcType=INTEGER},
    balance = #{record.balance,jdbcType=INTEGER},
    `status` = #{record.status,jdbcType=TINYINT},
    createTime = #{record.createtime,jdbcType=TIMESTAMP}
    <if test="_parameter != null">
      <include refid="Update_By_Example_Where_Clause"/>
    </if>
  </update>
  <update id="updateByPrimaryKeySelective" parameterType="com.xhpc.common.domain.IccardInfo">
    update t_iccard_info
    <set>
      <if test="cardid != null">
        cardID = #{cardid,jdbcType=VARCHAR},
      </if>
      <if test="cardno != null">
        cardNo = #{cardno,jdbcType=VARCHAR},
      </if>
      <if test="cardtype != null">
        cardType = #{cardtype,jdbcType=TINYINT},
      </if>
      <if test="password != null">
        `password` = #{password,jdbcType=VARCHAR},
      </if>
      <if test="userindex != null">
        userIndex = #{userindex,jdbcType=INTEGER},
      </if>
      <if test="corpno != null">
        corpNo = #{corpno,jdbcType=VARCHAR},
      </if>
      <if test="cashpledge != null">
        cashPledge = #{cashpledge,jdbcType=INTEGER},
      </if>
      <if test="balance != null">
        balance = #{balance,jdbcType=INTEGER},
      </if>
      <if test="status != null">
        `status` = #{status,jdbcType=TINYINT},
      </if>
      <if test="createtime != null">
        createTime = #{createtime,jdbcType=TIMESTAMP},
      </if>
    </set>
    where id = #{id,jdbcType=INTEGER}
  </update>
  <update id="updateByPrimaryKey" parameterType="com.xhpc.common.domain.IccardInfo">
    update t_iccard_info
    set cardID     = #{cardid,jdbcType=VARCHAR},
        cardNo     = #{cardno,jdbcType=VARCHAR},
        cardType   = #{cardtype,jdbcType=TINYINT},
        `password` = #{password,jdbcType=VARCHAR},
        userIndex  = #{userindex,jdbcType=INTEGER},
        corpNo     = #{corpno,jdbcType=VARCHAR},
        cashPledge = #{cashpledge,jdbcType=INTEGER},
        balance    = #{balance,jdbcType=INTEGER},
        `status`   = #{status,jdbcType=TINYINT},
        createTime = #{createtime,jdbcType=TIMESTAMP}
    where id = #{id,jdbcType=INTEGER}
  </update>
</mapper>
