<?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="cn.superdesk.uniorder.dao.mapper.sys.SysInvMapper">
	<resultMap id="BaseResultMap" type="cn.superdesk.uniorder.dao.entity.sys.SysInv">
		<id column="id" property="id" jdbcType="BIGINT"/>
		<result column="inv_name" property="invName" jdbcType="VARCHAR"/>
		<result column="bank_no" property="bankNo" jdbcType="VARCHAR"/>
		<result column="bank_name" property="bankName" jdbcType="VARCHAR"/>
	</resultMap>
	<sql id="Base_Column_List">
    id, inv_name, bank_no, bank_name
  </sql>
	<select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Long">
		select
		<include refid="Base_Column_List"/>
		from sys_inv
		where id = #{id,jdbcType=BIGINT}
	</select>
	<delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
    delete from sys_inv
    where id = #{id,jdbcType=BIGINT}
  </delete>
	<insert id="insert" parameterType="cn.superdesk.uniorder.dao.entity.sys.SysInv">
		<selectKey resultType="java.lang.Long" keyProperty="id" order="AFTER">
			SELECT LAST_INSERT_ID()
		</selectKey>
		insert into sys_inv (inv_name, bank_no, bank_name
		)
		values (#{invName,jdbcType=VARCHAR}, #{bankNo,jdbcType=VARCHAR}, #{bankName,jdbcType=VARCHAR}
		)
	</insert>
	<insert id="insertSelective" parameterType="cn.superdesk.uniorder.dao.entity.sys.SysInv">
		<selectKey resultType="java.lang.Long" keyProperty="id" order="AFTER">
			SELECT LAST_INSERT_ID()
		</selectKey>
		insert into sys_inv
		<trim prefix="(" suffix=")" suffixOverrides=",">
			<if test="invName != null">
				inv_name,
			</if>
			<if test="bankNo != null">
				bank_no,
			</if>
			<if test="bankName != null">
				bank_name,
			</if>
		</trim>
		<trim prefix="values (" suffix=")" suffixOverrides=",">
			<if test="invName != null">
				#{invName,jdbcType=VARCHAR},
			</if>
			<if test="bankNo != null">
				#{bankNo,jdbcType=VARCHAR},
			</if>
			<if test="bankName != null">
				#{bankName,jdbcType=VARCHAR},
			</if>
		</trim>
	</insert>
	<update id="updateByPrimaryKeySelective" parameterType="cn.superdesk.uniorder.dao.entity.sys.SysInv">
		update sys_inv
		<set>
			<if test="invName != null">
				inv_name = #{invName,jdbcType=VARCHAR},
			</if>
			<if test="bankNo != null">
				bank_no = #{bankNo,jdbcType=VARCHAR},
			</if>
			<if test="bankName != null">
				bank_name = #{bankName,jdbcType=VARCHAR},
			</if>
		</set>
		where id = #{id,jdbcType=BIGINT}
	</update>
	<update id="updateByPrimaryKey" parameterType="cn.superdesk.uniorder.dao.entity.sys.SysInv">
    update sys_inv
    set inv_name = #{invName,jdbcType=VARCHAR},
      bank_no = #{bankNo,jdbcType=VARCHAR},
      bank_name = #{bankName,jdbcType=VARCHAR}
    where id = #{id,jdbcType=BIGINT}
  </update>
</mapper>