<?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.chaozhanggui.dao.system.dao.TbPlussDeviceBsjMapper">
  <resultMap id="BaseResultMap" type="com.chaozhanggui.dao.system.entity.TbPlussDeviceBsj">
    <id column="snNo" jdbcType="VARCHAR" property="snno" />
    <result column="deviceNo" jdbcType="VARCHAR" property="deviceno" />
    <result column="imei" jdbcType="VARCHAR" property="imei" />
    <result column="iccid" jdbcType="VARCHAR" property="iccid" />
    <result column="sim" jdbcType="VARCHAR" property="sim" />
    <result column="simExpireTime" jdbcType="TIMESTAMP" property="simexpiretime" />
  </resultMap>
  <sql id="Base_Column_List">
    snNo, deviceNo, imei, iccid, sim, simExpireTime
  </sql>
  <select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="BaseResultMap">
    select 
    <include refid="Base_Column_List" />
    from tb_pluss_device_bsj
    where snNo = #{snno,jdbcType=VARCHAR}
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.String">
    delete from tb_pluss_device_bsj
    where snNo = #{snno,jdbcType=VARCHAR}
  </delete>
  <insert id="insert" parameterType="com.chaozhanggui.dao.system.entity.TbPlussDeviceBsj">
    insert into tb_pluss_device_bsj (snNo, deviceNo, imei, 
      iccid, sim, simExpireTime
      )
    values (#{snno,jdbcType=VARCHAR}, #{deviceno,jdbcType=VARCHAR}, #{imei,jdbcType=VARCHAR}, 
      #{iccid,jdbcType=VARCHAR}, #{sim,jdbcType=VARCHAR}, #{simexpiretime,jdbcType=TIMESTAMP}
      )
  </insert>
  <insert id="insertSelective" parameterType="com.chaozhanggui.dao.system.entity.TbPlussDeviceBsj">
    insert into tb_pluss_device_bsj
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="snno != null">
        snNo,
      </if>
      <if test="deviceno != null">
        deviceNo,
      </if>
      <if test="imei != null">
        imei,
      </if>
      <if test="iccid != null">
        iccid,
      </if>
      <if test="sim != null">
        sim,
      </if>
      <if test="simexpiretime != null">
        simExpireTime,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides=",">
      <if test="snno != null">
        #{snno,jdbcType=VARCHAR},
      </if>
      <if test="deviceno != null">
        #{deviceno,jdbcType=VARCHAR},
      </if>
      <if test="imei != null">
        #{imei,jdbcType=VARCHAR},
      </if>
      <if test="iccid != null">
        #{iccid,jdbcType=VARCHAR},
      </if>
      <if test="sim != null">
        #{sim,jdbcType=VARCHAR},
      </if>
      <if test="simexpiretime != null">
        #{simexpiretime,jdbcType=TIMESTAMP},
      </if>
    </trim>
  </insert>
  <update id="updateByPrimaryKeySelective" parameterType="com.chaozhanggui.dao.system.entity.TbPlussDeviceBsj">
    update tb_pluss_device_bsj
    <set>
      <if test="deviceno != null">
        deviceNo = #{deviceno,jdbcType=VARCHAR},
      </if>
      <if test="imei != null">
        imei = #{imei,jdbcType=VARCHAR},
      </if>
      <if test="iccid != null">
        iccid = #{iccid,jdbcType=VARCHAR},
      </if>
      <if test="sim != null">
        sim = #{sim,jdbcType=VARCHAR},
      </if>
      <if test="simexpiretime != null">
        simExpireTime = #{simexpiretime,jdbcType=TIMESTAMP},
      </if>
    </set>
    where snNo = #{snno,jdbcType=VARCHAR}
  </update>
  <update id="updateByPrimaryKey" parameterType="com.chaozhanggui.dao.system.entity.TbPlussDeviceBsj">
    update tb_pluss_device_bsj
    set deviceNo = #{deviceno,jdbcType=VARCHAR},
      imei = #{imei,jdbcType=VARCHAR},
      iccid = #{iccid,jdbcType=VARCHAR},
      sim = #{sim,jdbcType=VARCHAR},
      simExpireTime = #{simexpiretime,jdbcType=TIMESTAMP}
    where snNo = #{snno,jdbcType=VARCHAR}
  </update>
</mapper>