<?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.com.ty.lift.ud.payment.mapper.ApplyInvoiceMapper">
	<resultMap id="BaseResultMap" type="cn.com.ty.lift.ud.payment.mapper.entity.ApplyInvoiceEntity">
		<id column="id" property="id" jdbcType="INTEGER" />
<!-- 		<result column="name" property="name" jdbcType="VARCHAR" /> -->
<!-- 		<result column="telephone" property="telephone" jdbcType="VARCHAR" /> -->
		<result column="email" property="email" jdbcType="VARCHAR" />
		<result column="user_id" property="userId" jdbcType="INTEGER" />
		<result column="fpqqlsh" property="fpqqlsh" jdbcType="VARCHAR" />
		<result column="kplx" property="kplx" jdbcType="VARCHAR" />
		<result column="gmf_nsrsbm" property="gmfNsrsbm" jdbcType="VARCHAR" />
		<result column="gmf_mc" property="gmfMc" jdbcType="VARCHAR" />
<!-- 		<result column="gmf_dzdh" property="gmfDzdh" jdbcType="VARCHAR" /> -->
<!-- 		<result column="gmf_yhzh" property="gmfYhzh" jdbcType="VARCHAR" /> -->
		<result column="kpr" property="kpr" jdbcType="VARCHAR" />
		<result column="skr" property="skr" jdbcType="VARCHAR" />
		<result column="fhr" property="fhr" jdbcType="VARCHAR" />
		<result column="jshj" property="jshj" jdbcType="DECIMAL" />
		<result column="hjje" property="hjje" jdbcType="DECIMAL" />
		<result column="hjse" property="hjse" jdbcType="DECIMAL" />
		<result column="bz" property="bz" jdbcType="VARCHAR" />
		<result column="dm" property="dm" jdbcType="VARCHAR" />
		<result column="hm" property="hm" jdbcType="VARCHAR" />
		<result column="kqrq" property="kqrq" jdbcType="TIMESTAMP" />
		<result column="fpmw" property="fpmw" jdbcType="VARCHAR" />
		<result column="jym" property="jym" jdbcType="VARCHAR" />
		<result column="ewm" property="ewm" jdbcType="VARCHAR" />
		
		<result column="type" property="type" jdbcType="INTEGER" />
		<result column="gmf_yh" property="gmfYh" jdbcType="VARCHAR" />
		<result column="gmf_dz" property="gmfDz" jdbcType="VARCHAR" />
		<result column="gmf_dh" property="gmfDh" jdbcType="VARCHAR" />
		<result column="gmf_zh" property="gmfZh" jdbcType="VARCHAR" />
		
		<result column="statuz" property="statuz" jdbcType="INTEGER" />
		<result column="create_by" property="createBy" jdbcType="VARCHAR" />
		<result column="create_time" property="createTime" jdbcType="TIMESTAMP" />
		<result column="update_by" property="updateBy" jdbcType="VARCHAR" />
		<result column="update_time" property="updateTime" jdbcType="TIMESTAMP" />
	</resultMap>

	<sql id="Base_Column_List">
		id, email, user_id, fpqqlsh, kplx,user_invoice_id,
		gmf_nsrsbm, gmf_mc,type,gmf_yh,gmf_dz,gmf_dh,gmf_zh,
	    kpr, skr, fhr, jshj, hjje, hjse,
		bz, dm, hm, kqrq, fpmw, jym, ewm,
		statuz,
		create_by, create_time,
		update_by, update_time
	</sql>
	<select id="selectByPrimaryKey" resultType="cn.com.ty.lift.ud.payment.mapper.entity.ApplyInvoiceEntity"
		parameterType="java.lang.Long">
		select
		<include refid="Base_Column_List" />
		from apply_invoice
		where id = #{id,jdbcType=INTEGER}
	</select>
	<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
		delete from
		apply_invoice
		where id = #{id,jdbcType=INTEGER}
	</delete>
	<insert id="insertSelective"
		parameterType="cn.com.ty.lift.ud.payment.mapper.entity.ApplyInvoiceEntity">
		<!-- WARNING - @mbggenerated This element is automatically generated by 
			MyBatis Generator, do not modify. This element was generated on Sat Apr 25 
			10:41:17 CST 2020. -->
		insert into apply_invoice
		<trim prefix="(" suffix=")" suffixOverrides=",">
			<if test="id != null">
				id,
			</if>
			<if test="type != null">
				type,
			</if>
			<if test="gmfYh != null">
				gmf_yh,
			</if>
			<if test="gmfDz != null">
				gmf_dz,
			</if>
			<if test="gmfDh != null">
				gmf_dh,
			</if>
			<if test="gmfZh != null">
				gmf_zh,
			</if>
			<if test="email != null">
				email,
			</if>
			<if test="userId != null">
				user_id,
			</if>
			<if test="fpqqlsh != null">
				fpqqlsh,
			</if>
			<if test="kplx != null">
				kplx,
			</if>
			<if test="gmfNsrsbm != null">
				gmf_nsrsbm,
			</if>
			<if test="gmfMc != null">
				gmf_mc,
			</if>
			<if test="kpr != null">
				kpr,
			</if>
			<if test="skr != null">
				skr,
			</if>
			<if test="fhr != null">
				fhr,
			</if>
			<if test="jshj != null">
				jshj,
			</if>
			<if test="hjje != null">
				hjje,
			</if>
			<if test="hjse != null">
				hjse,
			</if>
			<if test="bz != null">
				bz,
			</if>
			<if test="dm != null">
				dm,
			</if>
			<if test="hm != null">
				hm,
			</if>
			<if test="kqrq != null">
				kqrq,
			</if>
			<if test="fpmw != null">
				fpmw,
			</if>
			<if test="jym != null">
				jym,
			</if>
			<if test="ewm != null">
				ewm,
			</if>
			<if test="statuz != null">
				statuz,
			</if>
			<if test="createBy != null">
				create_by,
			</if>
			<if test="createTime != null">
				create_time,
			</if>
			<if test="updateBy != null">
				update_by,
			</if>
			<if test="updateTime != null">
				update_time,
			</if>
		</trim>
		<trim prefix="values (" suffix=")" suffixOverrides=",">
			<if test="id != null">
				#{id,jdbcType=INTEGER},
			</if>
			<if test="type != null">
				#{type,jdbcType=INTEGER},
			</if>
			<if test="gmfYh != null">
				#{gmfYh,jdbcType=VARCHAR},
			</if>
			<if test="gmfDz != null">
				#{gmfDz,jdbcType=VARCHAR},
			</if>
			<if test="gmfDh != null">
				#{gmfDh,jdbcType=VARCHAR},
			</if>
			<if test="gmfZh != null">
				#{gmfZh,jdbcType=VARCHAR},
			</if>
			<if test="email != null">
				#{email,jdbcType=VARCHAR},
			</if>
			<if test="userId != null">
				#{userId,jdbcType=INTEGER},
			</if>
			<if test="fpqqlsh != null">
				#{fpqqlsh,jdbcType=VARCHAR},
			</if>
			<if test="kplx != null">
				#{kplx,jdbcType=VARCHAR},
			</if>
			<if test="gmfNsrsbm != null">
				#{gmfNsrsbm,jdbcType=VARCHAR},
			</if>
			<if test="gmfMc != null">
				#{gmfMc,jdbcType=VARCHAR},
			</if>
			<if test="kpr != null">
				#{kpr,jdbcType=VARCHAR},
			</if>
			<if test="skr != null">
				#{skr,jdbcType=VARCHAR},
			</if>
			<if test="fhr != null">
				#{fhr,jdbcType=VARCHAR},
			</if>
			<if test="jshj != null">
				#{jshj,jdbcType=DECIMAL},
			</if>
			<if test="hjje != null">
				#{hjje,jdbcType=DECIMAL},
			</if>
			<if test="hjse != null">
				#{hjse,jdbcType=DECIMAL},
			</if>
			<if test="bz != null">
				#{bz,jdbcType=VARCHAR},
			</if>
			<if test="dm != null">
				#{dm,jdbcType=VARCHAR},
			</if>
			<if test="hm != null">
				#{hm,jdbcType=VARCHAR},
			</if>
			<if test="kqrq != null">
				#{kqrq,jdbcType=TIMESTAMP},
			</if>
			<if test="fpmw != null">
				#{fpmw,jdbcType=VARCHAR},
			</if>
			<if test="jym != null">
				#{jym,jdbcType=VARCHAR},
			</if>
			<if test="ewm != null">
				#{ewm,jdbcType=VARCHAR},
			</if>
			<if test="statuz != null">
				#{statuz,jdbcType=INTEGER},
			</if>
			<if test="createBy != null">
				#{createBy,jdbcType=VARCHAR},
			</if>
			<if test="createTime != null">
				#{createTime,jdbcType=TIMESTAMP},
			</if>
			<if test="updateBy != null">
				#{updateBy,jdbcType=VARCHAR},
			</if>
			<if test="updateTime != null">
				#{updateTime,jdbcType=TIMESTAMP},
			</if>
		</trim>
	</insert>
	<update id="updateByPrimaryKeySelective"
		parameterType="cn.com.ty.lift.ud.payment.mapper.entity.ApplyInvoiceEntity">
		update apply_invoice
		<set>
			<if test="name != null">
				name = #{name,jdbcType=VARCHAR},
			</if>
			<if test="email != null">
				email = #{email,jdbcType=VARCHAR},
			</if>
			<if test="userId != null">
				user_id = #{userId,jdbcType=INTEGER},
			</if>
			<if test="fpqqlsh != null">
				fpqqlsh = #{fpqqlsh,jdbcType=VARCHAR},
			</if>
			<if test="kplx != null">
				kplx = #{kplx,jdbcType=VARCHAR},
			</if>
			<if test="gmfNsrsbm != null">
				gmf_nsrsbm = #{gmfNsrsbm,jdbcType=VARCHAR},
			</if>
			<if test="gmfMc != null">
				gmf_mc = #{gmfMc,jdbcType=VARCHAR},
			</if>
			<if test="gmfDzdh != null">
				gmf_dzdh = #{gmfDzdh,jdbcType=VARCHAR},
			</if>
			<if test="gmfYhzh != null">
				gmf_yhzh = #{gmfYhzh,jdbcType=VARCHAR},
			</if>
			<if test="kpr != null">
				kpr = #{kpr,jdbcType=VARCHAR},
			</if>
			<if test="skr != null">
				skr = #{skr,jdbcType=VARCHAR},
			</if>
			<if test="fhr != null">
				fhr = #{fhr,jdbcType=VARCHAR},
			</if>
			<if test="jshj != null">
				jshj = #{jshj,jdbcType=DECIMAL},
			</if>
			<if test="hjje != null">
				hjje = #{hjje,jdbcType=DECIMAL},
			</if>
			<if test="hjse != null">
				hjse = #{hjse,jdbcType=DECIMAL},
			</if>
			<if test="bz != null">
				bz = #{bz,jdbcType=VARCHAR},
			</if>
			<if test="dm != null">
				dm = #{dm,jdbcType=VARCHAR},
			</if>
			<if test="hm != null">
				hm = #{hm,jdbcType=VARCHAR},
			</if>
			<if test="kqrq != null">
				kqrq = #{kqrq,jdbcType=TIMESTAMP},
			</if>
			<if test="fpmw != null">
				fpmw = #{fpmw,jdbcType=VARCHAR},
			</if>
			<if test="jym != null">
				jym = #{jym,jdbcType=VARCHAR},
			</if>
			<if test="ewm != null">
				ewm = #{ewm,jdbcType=VARCHAR},
			</if>
			<if test="statuz != null">
				statuz = #{statuz,jdbcType=INTEGER},
			</if>
			<if test="createBy != null">
				create_by = #{createBy,jdbcType=VARCHAR},
			</if>
			<if test="createTime != null">
				create_time = #{createTime,jdbcType=TIMESTAMP},
			</if>
			<if test="updateBy != null">
				update_by = #{updateBy,jdbcType=VARCHAR},
			</if>
			<if test="updateTime != null">
				update_time = #{updateTime,jdbcType=TIMESTAMP},
			</if>
		</set>
		where id = #{id,jdbcType=INTEGER}
	</update>
	<update id="updateByPrimaryKey"
		parameterType="cn.com.ty.lift.ud.payment.mapper.entity.ApplyInvoiceEntity">
		update apply_invoice
		set name = #{name,jdbcType=VARCHAR},
		telephone = #{telephone,jdbcType=VARCHAR},
		email =
		#{email,jdbcType=VARCHAR},
		user_id = #{userId,jdbcType=INTEGER},
		fpqqlsh = #{fpqqlsh,jdbcType=VARCHAR},
		kplx = #{kplx,jdbcType=VARCHAR},
		gmf_nsrsbm = #{gmfNsrsbm,jdbcType=VARCHAR},
		gmf_mc =
		#{gmfMc,jdbcType=VARCHAR},
		gmf_dzdh = #{gmfDzdh,jdbcType=VARCHAR},
		gmf_yhzh = #{gmfYhzh,jdbcType=VARCHAR},
		kpr = #{kpr,jdbcType=VARCHAR},
		skr = #{skr,jdbcType=VARCHAR},
		fhr = #{fhr,jdbcType=VARCHAR},
		jshj =
		#{jshj,jdbcType=DECIMAL},
		hjje = #{hjje,jdbcType=DECIMAL},
		hjse =
		#{hjse,jdbcType=DECIMAL},
		bz = #{bz,jdbcType=VARCHAR},
		dm =
		#{dm,jdbcType=VARCHAR},
		hm = #{hm,jdbcType=VARCHAR},
		kqrq =
		#{kqrq,jdbcType=TIMESTAMP},
		fpmw = #{fpmw,jdbcType=VARCHAR},
		jym =
		#{jym,jdbcType=VARCHAR},
		ewm = #{ewm,jdbcType=VARCHAR},
		statuz =
		#{statuz,jdbcType=INTEGER},
		create_by = #{createBy,jdbcType=VARCHAR},
		create_time = #{createTime,jdbcType=TIMESTAMP},
		update_by =
		#{updateBy,jdbcType=VARCHAR},
		update_time =
		#{updateTime,jdbcType=TIMESTAMP}
		where id = #{id,jdbcType=INTEGER}
	</update>

	<select id="getInvoiceItemById" parameterType="int"
		resultType="cn.com.ty.lift.ud.payment.mapper.entity.ApplyInvoiceItemEntity">
		select * from apply_invoice_item where data_id = #{id}
	</select>
	<select id="getInvoiceImgById" parameterType="int"
		resultType="cn.com.ty.lift.ud.payment.mapper.entity.ApplyInvoiceImgEntity">
		select * from apply_invoice_img where data_id = #{id}
	</select>
	<!--  查看发票详情 end -->

</mapper>