<?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.hzya.frame.sys.voucher.dao.impl.VoucherDaoImpl">
	<resultMap id="get-VoucherEntity-result" type="com.hzya.frame.sys.voucher.entity.VoucherEntity">
		<!--主键ID -->
		<result property="id" column="id" />
		<!--单据类型 -->
		<result property="receipt_type" column="receipt_type" />
		<!--单据id -->
		<result property="receipt_id" column="receipt_id" />
		<!--单据标题 -->
		<result property="receipt_title" column="receipt_title" />
		<!--单据日期 -->
		<result property="receipt_date" column="receipt_date" />
		<!--制单状态 -->
		<result property="receipt_status" column="receipt_status" />
		<!--年度 -->
		<result property="year" column="year" />
		<!--会计期间 -->
		<result property="ap" column="ap" />
		<!--凭证id -->
		<result property="proof_id" column="proof_id" />
		<!--项目 -->
		<result property="project" column="project" />
		<!--供应商 -->
		<result property="supplier" column="supplier" />
		<!--客户 -->
		<result property="client" column="client" />
		<!--业务员 -->
		<result property="salesman" column="salesman" />
		<!--组织 -->
		<result property="section" column="section" />
		<!--不制单原因 -->
		<result property="not_receipt_reason" column="not_receipt_reason" />
		<!--凭证日期 -->
		<result property="certificate_date" column="certificate_date" />
		<!--制单人 -->
		<result property="documenter" column="documenter" />
		<!--排序 -->
		<result property="sorts" column="sorts" />
		<!--创建人id -->
		<result property="create_user_id" column="create_user_id" />
		<!--创建时间 -->
		<result property="create_time" column="create_time" />
		<!--修改人id -->
		<result property="modify_user_id" column="modify_user_id" />
		<!--修改时间 -->
		<result property="modify_time" column="modify_time" />
		<!--状态(Y正常N删除) -->
		<result property="sts" column="sts" />
		<!--组织机构ID -->
		<result property="org_id" column="org_id" />
	</resultMap>

	<sql id="VoucherEntity_Base_Column_List">
		id,
		receipt_type,
		receipt_id,
		receipt_title,
		receipt_date,
		receipt_status,
		year,
		ap,
		proof_id,
		project,
		supplier,
		client,
		salesman,
		section,
		not_receipt_reason,
		certificate_date,
		documenter,
		sorts,
		create_user_id,
		create_time,
		modify_user_id,
		modify_time,
		sts,
		org_id
	</sql>

	<!--通过ID获取数据 -->
	<select id="entity_get" resultMap="get-VoucherEntity-result">
		select
		<include refid="VoucherEntity_Base_Column_List" />
		from sys_voucher where id = #{ id } and sts='Y'
	</select>

	<!-- 查询 采用==查询 -->
	<select id="entity_list_base" resultMap="get-VoucherEntity-result" parameterType="com.hzya.frame.sys.voucher.entity.VoucherEntity">
		select
		<include refid="VoucherEntity_Base_Column_List" />
		from sys_voucher
		<trim prefix="where" prefixOverrides="and">
			<if test="id != null and id !='' ">id = #{id} </if>
			<if test="receipt_type != null and receipt_type !='' "> and receipt_type = #{receipt_type}</if>
			<if test="receipt_id != null and receipt_id !='' "> and receipt_id = #{receipt_id}</if>
			<if test="receipt_title != null and receipt_title !='' "> and receipt_title = #{receipt_title}</if>
			<if test="receipt_date != null "> and receipt_date = #{receipt_date}</if>
			<if test="receipt_status != null and receipt_status !='' "> and receipt_status = #{receipt_status}</if>
			<if test="year != null and year !='' "> and year = #{year}</if>
			<if test="ap != null and ap !='' "> and ap = #{ap}</if>
			<if test="proof_id != null and proof_id !='' "> and proof_id = #{proof_id}</if>
			<if test="project != null and project !='' "> and project = #{project}</if>
			<if test="supplier != null and supplier !='' "> and supplier = #{supplier}</if>
			<if test="client != null and client !='' "> and client = #{client}</if>
			<if test="salesman != null and salesman !='' "> and salesman = #{salesman}</if>
			<if test="section != null and section !='' "> and section = #{section}</if>
			<if test="not_receipt_reason != null and not_receipt_reason !='' "> and not_receipt_reason = #{not_receipt_reason}</if>
			<if test="certificate_date != null "> and certificate_date = #{certificate_date}</if>
			<if test="documenter != null and documenter !='' "> and documenter = #{documenter}</if>
			<if test="sorts != null "> and sorts = #{sorts}</if>
			<if test="create_user_id != null and create_user_id !='' "> and create_user_id = #{create_user_id}</if>
			<if test="create_time != null "> and create_time = #{create_time}</if>
			<if test="modify_user_id != null and modify_user_id !='' "> and modify_user_id = #{modify_user_id}</if>
			<if test="modify_time != null "> and modify_time = #{modify_time}</if>
			<if test="sts != null and sts !='' "> and sts = #{sts}</if>
			<if test="org_id != null and org_id !='' "> and org_id = #{org_id}</if>

			<if test="ids != null and ids.size>0">
				AND id in
				<foreach collection="ids" item="item" index="index" open="(" close=")" separator=",">
					#{item}
				</foreach>
			</if>
			and sts='Y'
		</trim>
		<if test=" sort == null or sort == ''.toString() "> order by sorts asc</if>
		<if test=" sort !='' and sort!=null and order !='' and order!=null ">order by ${sort} ${order}</if>
	</select>

	<!-- 查询符合条件的数量 -->
	<select id="entity_count" resultType="Integer" parameterType="com.hzya.frame.sys.voucher.entity.VoucherEntity">
		select count(1) from sys_voucher
		<trim prefix="where" prefixOverrides="and">
			<if test="id != null and id !='' ">id = #{id} </if>
			<if test="receipt_type != null and receipt_type !='' "> and receipt_type = #{receipt_type} </if>
			<if test="receipt_id != null and receipt_id !='' "> and receipt_id = #{receipt_id} </if>
			<if test="receipt_title != null and receipt_title !='' "> and receipt_title = #{receipt_title} </if>
			<if test="receipt_date != null "> and receipt_date = #{receipt_date}  </if>
			<if test="receipt_status != null and receipt_status !='' "> and receipt_status = #{receipt_status} </if>
			<if test="year != null and year !='' "> and year = #{year} </if>
			<if test="ap != null and ap !='' "> and ap = #{ap} </if>
			<if test="proof_id != null and proof_id !='' "> and proof_id = #{proof_id} </if>
			<if test="project != null and project !='' "> and project = #{project} </if>
			<if test="supplier != null and supplier !='' "> and supplier = #{supplier} </if>
			<if test="client != null and client !='' "> and client = #{client} </if>
			<if test="salesman != null and salesman !='' "> and salesman = #{salesman} </if>
			<if test="section != null and section !='' "> and section = #{section} </if>
			<if test="not_receipt_reason != null and not_receipt_reason !='' "> and not_receipt_reason = #{not_receipt_reason} </if>
			<if test="certificate_date != null "> and certificate_date = #{certificate_date}  </if>
			<if test="documenter != null and documenter !='' "> and documenter = #{documenter} </if>
			<if test="sorts != null "> and sorts = #{sorts}  </if>
			<if test="create_user_id != null and create_user_id !='' "> and create_user_id = #{create_user_id} </if>
			<if test="create_time != null "> and create_time = #{create_time}  </if>
			<if test="modify_user_id != null and modify_user_id !='' "> and modify_user_id = #{modify_user_id} </if>
			<if test="modify_time != null "> and modify_time = #{modify_time}  </if>
			<if test="sts != null and sts !='' "> and sts = #{sts} </if>
			<if test="org_id != null and org_id !='' "> and org_id = #{org_id} </if>
			and sts='Y'
		</trim>
		<if test=" sort ==''.toString() "> order by sorts asc</if>
		<if test=" sort !='' and sort!=null and order !='' and order!=null "> order by ${sort} ${order}</if>
	</select>

	<!-- 分页查询列表 采用like格式 -->
	<select id="entity_list_like" resultMap="get-VoucherEntity-result" parameterType="com.hzya.frame.sys.voucher.entity.VoucherEntity">
		select
		<include refid="VoucherEntity_Base_Column_List" />
		from sys_voucher
		<trim prefix="where" prefixOverrides="and">
			<if test="id != null and id !='' "> id like concat('%',#{id},'%') </if>
			<if test="receipt_type != null and receipt_type !='' "> and receipt_type like concat('%',#{receipt_type},'%') </if>
			<if test="receipt_id != null and receipt_id !='' "> and receipt_id like concat('%',#{receipt_id},'%') </if>
			<if test="receipt_title != null and receipt_title !='' "> and receipt_title like concat('%',#{receipt_title},'%') </if>
			<if test="receipt_date != null and receipt_date !='' "> and receipt_date like concat('%',#{receipt_date},'%') </if>
			<if test="receipt_status != null and receipt_status !='' "> and receipt_status like concat('%',#{receipt_status},'%') </if>
			<if test="year != null and year !='' "> and year like concat('%',#{year},'%') </if>
			<if test="ap != null and ap !='' "> and ap like concat('%',#{ap},'%') </if>
			<if test="proof_id != null and proof_id !='' "> and proof_id like concat('%',#{proof_id},'%') </if>
			<if test="project != null and project !='' "> and project like concat('%',#{project},'%') </if>
			<if test="supplier != null and supplier !='' "> and supplier like concat('%',#{supplier},'%') </if>
			<if test="client != null and client !='' "> and client like concat('%',#{client},'%') </if>
			<if test="salesman != null and salesman !='' "> and salesman like concat('%',#{salesman},'%') </if>
			<if test="section != null and section !='' "> and section like concat('%',#{section},'%') </if>
			<if test="not_receipt_reason != null and not_receipt_reason !='' "> and not_receipt_reason like concat('%',#{not_receipt_reason},'%') </if>
			<if test="certificate_date != null and certificate_date !='' "> and certificate_date like concat('%',#{certificate_date},'%') </if>
			<if test="documenter != null and documenter !='' "> and documenter like concat('%',#{documenter},'%') </if>
			<if test="sorts != null "> and sorts = #{sorts}</if>
			<if test="create_user_id != null and create_user_id !='' "> and create_user_id like concat('%',#{create_user_id},'%') </if>
			<if test="create_time != null and create_time !='' "> and create_time like concat('%',#{create_time},'%') </if>
			<if test="modify_user_id != null and modify_user_id !='' "> and modify_user_id like concat('%',#{modify_user_id},'%') </if>
			<if test="modify_time != null and modify_time !='' "> and modify_time like concat('%',#{modify_time},'%') </if>
			<if test="sts != null and sts !='' "> and sts like concat('%',#{sts},'%') </if>
			<if test="org_id != null and org_id !='' "> and org_id like concat('%',#{org_id},'%') </if>
			and sts='Y'
		</trim>
		<if test=" sort ==''.toString() "> order by sorts asc</if>
		<if test=" sort !='' and sort!=null and order !='' and order!=null ">order by  ${sort} ${order}</if>
	</select>

	<!-- 查询列表 字段采用or格式 -->
	<select id="entity_list_or" resultMap="get-VoucherEntity-result" parameterType="com.hzya.frame.sys.voucher.entity.VoucherEntity">
		select
		<include refid="VoucherEntity_Base_Column_List" />
		from sys_voucher
		<trim prefix="where" prefixOverrides="or">
			<if test="id != null and id !='' ">id = #{id} </if>
			<if test="receipt_type != null and receipt_type !='' "> or receipt_type = #{receipt_type} </if>
			<if test="receipt_id != null and receipt_id !='' "> or receipt_id = #{receipt_id} </if>
			<if test="receipt_title != null and receipt_title !='' "> or receipt_title = #{receipt_title} </if>
			<if test="receipt_date != null and receipt_date !='' "> or receipt_date = #{receipt_date} </if>
			<if test="receipt_status != null and receipt_status !='' "> or receipt_status = #{receipt_status} </if>
			<if test="year != null and year !='' "> or year = #{year} </if>
			<if test="ap != null and ap !='' "> or ap = #{ap} </if>
			<if test="proof_id != null and proof_id !='' "> or proof_id = #{proof_id} </if>
			<if test="project != null and project !='' "> or project = #{project} </if>
			<if test="supplier != null and supplier !='' "> or supplier = #{supplier} </if>
			<if test="client != null and client !='' "> or client = #{client} </if>
			<if test="salesman != null and salesman !='' "> or salesman = #{salesman} </if>
			<if test="section != null and section !='' "> or section = #{section} </if>
			<if test="not_receipt_reason != null and not_receipt_reason !='' "> or not_receipt_reason = #{not_receipt_reason} </if>
			<if test="certificate_date != null and certificate_date !='' "> or certificate_date = #{certificate_date} </if>
			<if test="documenter != null and documenter !='' "> or documenter = #{documenter} </if>
			<if test="sorts != null "> or sorts = #{sorts}</if>
			<if test="create_user_id != null and create_user_id !='' "> or create_user_id = #{create_user_id} </if>
			<if test="create_time != null and create_time !='' "> or create_time = #{create_time} </if>
			<if test="modify_user_id != null and modify_user_id !='' "> or modify_user_id = #{modify_user_id} </if>
			<if test="modify_time != null and modify_time !='' "> or modify_time = #{modify_time} </if>
			<if test="sts != null and sts !='' "> or sts = #{sts} </if>
			<if test="org_id != null and org_id !='' "> or org_id = #{org_id} </if>
			and sts='Y'
		</trim>
		<if test=" sort ==''.toString() "> order by sorts asc</if>
		<if test=" sort !='' and sort!=null and order !='' and order!=null ">order by  ${sort} ${order}</if>
	</select>
	<!-- 新增 -->
	<insert id="entity_insert" parameterType="com.hzya.frame.sys.voucher.entity.VoucherEntity">
		insert into sys_voucher(
		<trim suffix="" suffixOverrides=",">
			<if test="id != null and id !='' "> id, </if>
			<if test="receipt_type != null and receipt_type !='' "> receipt_type, </if>
			<if test="receipt_id != null and receipt_id !='' "> receipt_id, </if>
			<if test="receipt_title != null and receipt_title !='' "> receipt_title, </if>
			<if test="receipt_date != null ">receipt_date,</if>
			<if test="receipt_status != null and receipt_status !='' "> receipt_status, </if>
			<if test="year != null and year !='' "> year, </if>
			<if test="ap != null and ap !='' "> ap, </if>
			<if test="proof_id != null and proof_id !='' "> proof_id, </if>
			<if test="project != null and project !='' "> project, </if>
			<if test="supplier != null and supplier !='' "> supplier, </if>
			<if test="client != null and client !='' "> client, </if>
			<if test="salesman != null and salesman !='' "> salesman, </if>
			<if test="section != null and section !='' "> section, </if>
			<if test="not_receipt_reason != null and not_receipt_reason !='' "> not_receipt_reason, </if>
			<if test="certificate_date != null ">certificate_date,</if>
			<if test="documenter != null and documenter !='' "> documenter, </if>
			<if test="sorts != null ">sorts,</if>
			<if test="create_user_id != null and create_user_id !='' "> create_user_id, </if>
			<if test="modify_user_id != null and modify_user_id !='' "> modify_user_id, </if>
			<if test="org_id != null and org_id !='' "> org_id, </if>
			<if test="sorts == null ">sorts,</if>
			create_time,
			modify_time,
			sts
		</trim>
		)values
		(
		<trim suffix="" suffixOverrides=",">
			<if test="id != null and id !='' "> #{id}, </if>
			<if test="receipt_type != null and receipt_type !='' "> #{receipt_type}, </if>
			<if test="receipt_id != null and receipt_id !='' "> #{receipt_id}, </if>
			<if test="receipt_title != null and receipt_title !='' "> #{receipt_title}, </if>
			<if test="receipt_date != null ">#{receipt_date},</if>
			<if test="receipt_status != null and receipt_status !='' "> #{receipt_status}, </if>
			<if test="year != null and year !='' "> #{year}, </if>
			<if test="ap != null and ap !='' "> #{ap}, </if>
			<if test="proof_id != null and proof_id !='' "> #{proof_id}, </if>
			<if test="project != null and project !='' "> #{project}, </if>
			<if test="supplier != null and supplier !='' "> #{supplier}, </if>
			<if test="client != null and client !='' "> #{client}, </if>
			<if test="salesman != null and salesman !='' "> #{salesman}, </if>
			<if test="section != null and section !='' "> #{section}, </if>
			<if test="not_receipt_reason != null and not_receipt_reason !='' "> #{not_receipt_reason}, </if>
			<if test="certificate_date != null ">#{certificate_date},</if>
			<if test="documenter != null and documenter !='' "> #{documenter}, </if>
			<if test="sorts != null ">#{sorts},</if>
			<if test="create_user_id != null and create_user_id !='' "> #{create_user_id}, </if>
			<if test="modify_user_id != null and modify_user_id !='' "> #{modify_user_id}, </if>
			<if test="org_id != null and org_id !='' "> #{org_id}, </if>
			<if test="sorts == null ">(select (max(IFNULL( a.sorts, 0 )) + 1) as sort from sys_voucher a WHERE a.sts = 'Y' ),</if>
			<if test="create_time != null "> #{create_time} ,</if>
			<if test="modify_time != null "> #{modify_time},</if>
			'Y'
		</trim>
		)
	</insert>

	<!-- 修改 -->
	<update id="entity_update" parameterType="com.hzya.frame.sys.voucher.entity.VoucherEntity">
		update sys_voucher set
		<trim suffix="" suffixOverrides=",">
			<if test="id != null and id !='' "> id = #{id},</if>
			<if test="receipt_type != null and receipt_type !='' "> receipt_type = #{receipt_type},</if>
			<if test="receipt_id != null and receipt_id !='' "> receipt_id = #{receipt_id},</if>
			<if test="receipt_title != null and receipt_title !='' "> receipt_title = #{receipt_title},</if>
			<if test="receipt_date != null ">receipt_date = #{receipt_date},</if>
			<if test="receipt_status != null and receipt_status !='' "> receipt_status = #{receipt_status},</if>
			<if test="year != null and year !='' "> year = #{year},</if>
			<if test="ap != null and ap !='' "> ap = #{ap},</if>
			<if test="proof_id != null and proof_id !='' "> proof_id = #{proof_id},</if>
			<if test="project != null and project !='' "> project = #{project},</if>
			<if test="supplier != null and supplier !='' "> supplier = #{supplier},</if>
			<if test="client != null and client !='' "> client = #{client},</if>
			<if test="salesman != null and salesman !='' "> salesman = #{salesman},</if>
			<if test="section != null and section !='' "> section = #{section},</if>
			<if test="not_receipt_reason != null and not_receipt_reason !='' "> not_receipt_reason = #{not_receipt_reason},</if>
			<if test="certificate_date != null ">certificate_date = #{certificate_date},</if>
			<if test="documenter != null and documenter !='' "> documenter = #{documenter},</if>
			<if test="sorts != null ">sorts = #{sorts},</if>
			<if test="create_user_id != null and create_user_id !='' "> create_user_id = #{create_user_id},</if>
			<if test="modify_user_id != null and modify_user_id !='' "> modify_user_id = #{modify_user_id},</if>
			<if test="org_id != null and org_id !='' "> org_id = #{org_id},</if>
			<if test="modify_time != null "> modify_time =#{modify_time}  </if>
			<if test="modify_time  == null "> modify_time = now()</if>
		</trim>
		where id = #{id}
	</update>
	<!-- 修改 -->
	<update id="VoucherEntity_update_ids" parameterType="com.hzya.frame.sys.voucher.entity.VoucherEntity">
		update sys_voucher set
		<trim suffix="" suffixOverrides=",">
			<if test="id != null and id !='' "> id = #{id},</if>
			<if test="receipt_type != null and receipt_type !='' "> receipt_type = #{receipt_type},</if>
			<if test="receipt_id != null and receipt_id !='' "> receipt_id = #{receipt_id},</if>
			<if test="receipt_title != null and receipt_title !='' "> receipt_title = #{receipt_title},</if>
			<if test="receipt_date != null ">receipt_date = #{receipt_date},</if>
			<if test="receipt_status != null and receipt_status !='' "> receipt_status = #{receipt_status},</if>
			<if test="year != null and year !='' "> year = #{year},</if>
			<if test="ap != null and ap !='' "> ap = #{ap},</if>
			<if test="proof_id != null and proof_id !='' "> proof_id = #{proof_id},</if>
			<if test="project != null and project !='' "> project = #{project},</if>
			<if test="supplier != null and supplier !='' "> supplier = #{supplier},</if>
			<if test="client != null and client !='' "> client = #{client},</if>
			<if test="salesman != null and salesman !='' "> salesman = #{salesman},</if>
			<if test="section != null and section !='' "> section = #{section},</if>
			not_receipt_reason = #{not_receipt_reason},
			<if test="certificate_date != null ">certificate_date = #{certificate_date},</if>
			<if test="documenter != null and documenter !='' "> documenter = #{documenter},</if>
			<if test="sorts != null ">sorts = #{sorts},</if>
			<if test="create_user_id != null and create_user_id !='' "> create_user_id = #{create_user_id},</if>
			<if test="modify_user_id != null and modify_user_id !='' "> modify_user_id = #{modify_user_id},</if>
			<if test="org_id != null and org_id !='' "> org_id = #{org_id},</if>
			<if test="modify_time != null "> modify_time =#{modify_time}  </if>
			<if test="modify_time  == null "> modify_time = now()</if>
		</trim>
		WHERE id in
		<foreach collection="ids" item="item" index="index" open="(" close=")" separator=",">
			#{item}
		</foreach>
	</update>


	<!-- 修改 -->
	<update id="VoucherEntity_update_By_Proof_id" parameterType="com.hzya.frame.sys.voucher.entity.VoucherEntity">
		update sys_voucher set
		<trim suffix="" suffixOverrides=",">
			<if test="id != null and id !='' "> id = #{id},</if>
			<if test="receipt_type != null and receipt_type !='' "> receipt_type = #{receipt_type},</if>
			<if test="receipt_id != null and receipt_id !='' "> receipt_id = #{receipt_id},</if>
			<if test="receipt_title != null and receipt_title !='' "> receipt_title = #{receipt_title},</if>
			<if test="receipt_date != null ">receipt_date = #{receipt_date},</if>
			<if test="receipt_status != null and receipt_status !='' "> receipt_status = #{receipt_status},</if>
			<if test="year != null and year !='' "> year = #{year},</if>
			<if test="ap != null and ap !='' "> ap = #{ap},</if>
			<if test="project != null and project !='' "> project = #{project},</if>
			<if test="supplier != null and supplier !='' "> supplier = #{supplier},</if>
			<if test="client != null and client !='' "> client = #{client},</if>
			<if test="salesman != null and salesman !='' "> salesman = #{salesman},</if>
			<if test="section != null and section !='' "> section = #{section},</if>
			<if test="not_receipt_reason != null and not_receipt_reason !='' "> not_receipt_reason = #{not_receipt_reason},</if>
			<if test="certificate_date != null ">certificate_date = #{certificate_date},</if>
			<if test="documenter != null and documenter !='' "> documenter = #{documenter},</if>
			<if test="sorts != null ">sorts = #{sorts},</if>
			<if test="create_user_id != null and create_user_id !='' "> create_user_id = #{create_user_id},</if>
			<if test="modify_user_id != null and modify_user_id !='' "> modify_user_id = #{modify_user_id},</if>
			<if test="org_id != null and org_id !='' "> org_id = #{org_id},</if>
			<if test="modify_time != null "> modify_time =#{modify_time}  </if>
			<if test="modify_time  == null "> modify_time = now()</if>
		</trim>
		WHERE proof_id = #{proof_id}
	</update>
	<!-- 逻辑删除 -->
	<update id="entity_logicDelete" parameterType="com.hzya.frame.sys.voucher.entity.VoucherEntity">
		update sys_voucher set
		sts='N',modify_time = now(),modify_user_id = #{modify_user_id} where
		id = #{id}
	</update>

	<!-- 逻辑删除多条件 -->
	<update id="entity_logicDelete_Multi_Condition" parameterType="com.hzya.frame.sys.voucher.entity.VoucherEntity">
		update sys_voucher set
		sts='N',modify_time = now(),modify_user_id = #{modify_user_id} 
		<trim prefix="where" prefixOverrides="and">
			<if test="id != null and id !='' ">id = #{id} </if>
			<if test="receipt_type != null and receipt_type !='' "> and receipt_type = #{receipt_type}</if>
			<if test="receipt_id != null and receipt_id !='' "> and receipt_id = #{receipt_id}</if>
			<if test="receipt_title != null and receipt_title !='' "> and receipt_title = #{receipt_title}</if>
			<if test="receipt_date != null and receipt_date !='' "> and receipt_date = #{receipt_date}</if>
			<if test="receipt_status != null and receipt_status !='' "> and receipt_status = #{receipt_status}</if>
			<if test="year != null and year !='' "> and year = #{year}</if>
			<if test="ap != null and ap !='' "> and ap = #{ap}</if>
			<if test="proof_id != null and proof_id !='' "> and proof_id = #{proof_id}</if>
			<if test="project != null and project !='' "> and project = #{project}</if>
			<if test="supplier != null and supplier !='' "> and supplier = #{supplier}</if>
			<if test="client != null and client !='' "> and client = #{client}</if>
			<if test="salesman != null and salesman !='' "> and salesman = #{salesman}</if>
			<if test="section != null and section !='' "> and section = #{section}</if>
			<if test="not_receipt_reason != null and not_receipt_reason !='' "> and not_receipt_reason = #{not_receipt_reason}</if>
			<if test="certificate_date != null and certificate_date !='' "> and certificate_date = #{certificate_date}</if>
			<if test="documenter != null and documenter !='' "> and documenter = #{documenter}</if>
			<if test="sorts != null "> and sorts = #{sorts}</if>
			<if test="create_user_id != null and create_user_id !='' "> and create_user_id = #{create_user_id}</if>
			<if test="create_time != null and create_time !='' "> and create_time = #{create_time}</if>
			<if test="modify_user_id != null and modify_user_id !='' "> and modify_user_id = #{modify_user_id}</if>
			<if test="modify_time != null and modify_time !='' "> and modify_time = #{modify_time}</if>
			<if test="sts != null and sts !='' "> and sts = #{sts}</if>
			<if test="org_id != null and org_id !='' "> and org_id = #{org_id}</if>
		</trim>
	</update>

	<!-- 物理删除 -->
	<delete id="entity_delete" parameterType="com.hzya.frame.sys.voucher.entity.VoucherEntity">
		delete from sys_voucher where id =#{id}
	</delete>
</mapper>
