<?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.plugin.cinvoice.lexmis.dao.impl.LexmisPublicinfoDaoImpl">
	<resultMap id="get-LexmisPublicinfoEntity-result" type="com.hzya.frame.plugin.cinvoice.lexmis.entity.LexmisPublicinfoEntity">
		<!--无备注 -->
		<result property="PI_ID" column="PI_ID" />
		<!--无备注 -->
		<result property="PI_KEY" column="PI_KEY" />
		<!--无备注 -->
		<result property="PI_KEY_NEW" column="PI_KEY_NEW" />
		<result property="PI_DATAKEY" column="PI_DATAKEY" />
		<result property="PI_MAINCONFIGID" column="PI_MAINCONFIGID" />
		<result property="PI_TAXNO" column="PI_TAXNO" />
		<result property="PI_TABLENAME" column="PI_TABLENAME" />
		<result property="PI_BILLKIND" column="PI_BILLKIND" />
		<result property="PI_AMOUNT" column="PI_AMOUNT" />
		<result property="PI_USESTATE" column="PI_USESTATE" />
		<result property="PI_SUMMARYID" column="PI_SUMMARYID" />
		<result property="PI_SUBJECT" column="PI_SUBJECT" />
		<result property="PI_FORMID" column="PI_FORMID" />
		<result property="PI_FORMDATAID" column="PI_FORMDATAID" />

	</resultMap>

	<sql id="LexmisPublicinfoEntity_Base_Column_List">
	PI_ID,
	PI_KEY,
	PI_KEY_NEW,
	PI_DATAKEY,
	PI_MAINCONFIGID,
	PI_TAXNO,
	PI_TABLENAME,
	PI_BILLKIND,
	PI_AMOUNT,
	PI_USESTATE,
	PI_SUMMARYID,
	PI_SUBJECT,
	PI_FORMID,
	PI_FORMDATAID
	</sql>

	<!--通过ID获取数据 -->
	<select id="entity_get" resultMap="get-LexmisPublicinfoEntity-result">
		select
		<include refid="LexmisPublicinfoEntity_Base_Column_List" />
		from LEXMISCIV_PUBLICINFO where id = #{ id }
	</select>

	<!-- 查询 采用==查询 -->
	<select id="entity_list_base" resultMap="get-LexmisPublicinfoEntity-result" parameterType="com.hzya.frame.plugin.cinvoice.lexmis.entity.LexmisPublicinfoEntity">
		select
		<include refid="LexmisPublicinfoEntity_Base_Column_List" />
		from LEXMISCIV_PUBLICINFO
		<trim prefix="where" prefixOverrides="and">
			<if test="PI_ID != null ">PI_ID=#{PI_ID}</if>
			<if test="PI_KEY != null and PI_KEY !='' "> and PI_KEY = #{PI_KEY}</if>
			<if test="PI_KEY_NEW != null and PI_KEY_NEW !='' "> and PI_KEY_NEW = #{PI_KEY_NEW}</if>
			<if test="PI_DATAKEY != null "> and PI_DATAKEY = #{PI_DATAKEY}</if>
			<if test="PI_MAINCONFIGID != null "> and PI_MAINCONFIGID = #{PI_MAINCONFIGID}</if>
			<if test="PI_TAXNO != null and PI_TAXNO !='' "> and PI_TAXNO = #{PI_TAXNO}</if>
			<if test="PI_TABLENAME != null and PI_TABLENAME !='' "> and PI_TABLENAME = #{PI_TABLENAME}</if>
			<if test="PI_BILLKIND != null "> and PI_BILLKIND = #{PI_BILLKIND}</if>
			<if test="PI_BILLNAME != null and PI_BILLNAME !='' "> and PI_BILLNAME = #{PI_BILLNAME}</if>
			<if test="PI_AMOUNT != null "> and PI_AMOUNT = #{PI_AMOUNT}</if>
			<if test="PI_USESTATE != null "> and PI_USESTATE = #{PI_USESTATE}</if>
			<if test="PI_SUMMARYID != null "> and PI_SUMMARYID = #{PI_SUMMARYID}</if>
			<if test="PI_SUBJECT != null "> and PI_SUBJECT = #{PI_SUBJECT}</if>
			<if test="PI_FORMID != null "> and PI_FORMID = #{PI_FORMID}</if>
			<if test="PI_FORMDATAID != null "> and PI_FORMDATAID = #{PI_FORMDATAID}</if>
			and pi_billkind in ('0','2','3')
		</trim>

	</select>

	<!-- 查询符合条件的数量 -->
	<select id="LexmisPublicinfoEntity_count" resultType="Integer" parameterType="com.hzya.frame.plugin.cinvoice.lexmis.entity.LexmisPublicinfoEntity">
		select count(1) from LEXMISCIV_PUBLICINFO
		<trim prefix="where" prefixOverrides="and">
			<if test="PI_ID != null ">PI_ID = #{PI_ID}</if>
			<if test="PI_KEY != null and PI_KEY !='' "> and PI_KEY = #{PI_KEY} </if>
			<if test="PI_KEY_NEW != null and PI_KEY_NEW !='' "> and PI_KEY_NEW = #{PI_KEY_NEW} </if>
			<if test="PI_DATAKEY != null "> and PI_DATAKEY = #{PI_DATAKEY}  </if>
			<if test="PI_MAINCONFIGID != null "> and PI_MAINCONFIGID = #{PI_MAINCONFIGID}  </if>
			<if test="PI_TAXNO != null and PI_TAXNO !='' "> and PI_TAXNO = #{PI_TAXNO} </if>
			<if test="PI_TABLENAME != null and PI_TABLENAME !='' "> and PI_TABLENAME = #{PI_TABLENAME} </if>
			<if test="PI_BILLKIND != null "> and PI_BILLKIND = #{PI_BILLKIND}  </if>
			<if test="PI_BILLNAME != null and PI_BILLNAME !='' "> and PI_BILLNAME = #{PI_BILLNAME} </if>
			<if test="PI_AMOUNT != null "> and PI_AMOUNT = #{PI_AMOUNT}  </if>
			<if test="PI_STATE != null "> and PI_STATE = #{PI_STATE}  </if>
			<if test="PI_FILEID != null "> and PI_FILEID = #{PI_FILEID}  </if>
			<if test="PI_FILEDATE != null "> and PI_FILEDATE = #{PI_FILEDATE}  </if>
			<if test="PI_IMAGEPATH != null and PI_IMAGEPATH !='' "> and PI_IMAGEPATH = #{PI_IMAGEPATH} </if>
			<if test="PI_UPDATEDATA != null "> and PI_UPDATEDATA = #{PI_UPDATEDATA}  </if>
			<if test="PI_TYPE != null and PI_TYPE !='' "> and PI_TYPE = #{PI_TYPE} </if>
			<if test="PI_MEMBERID != null "> and PI_MEMBERID = #{PI_MEMBERID}  </if>
			<if test="PI_MEMBERNM != null and PI_MEMBERNM !='' "> and PI_MEMBERNM = #{PI_MEMBERNM} </if>
			<if test="PI_MAKEDATE != null "> and PI_MAKEDATE = #{PI_MAKEDATE}  </if>
			<if test="PI_BELONGID != null "> and PI_BELONGID = #{PI_BELONGID}  </if>
			<if test="PI_BELONGNM != null and PI_BELONGNM !='' "> and PI_BELONGNM = #{PI_BELONGNM} </if>
			<if test="PI_USEACCOUNTID != null "> and PI_USEACCOUNTID = #{PI_USEACCOUNTID}  </if>
			<if test="PI_USEACCOUNTNM != null and PI_USEACCOUNTNM !='' "> and PI_USEACCOUNTNM = #{PI_USEACCOUNTNM} </if>
			<if test="PI_USEDEPARTMENTID != null "> and PI_USEDEPARTMENTID = #{PI_USEDEPARTMENTID}  </if>
			<if test="PI_USEDEPARTMENTNM != null and PI_USEDEPARTMENTNM !='' "> and PI_USEDEPARTMENTNM = #{PI_USEDEPARTMENTNM} </if>
			<if test="PI_USEID != null "> and PI_USEID = #{PI_USEID}  </if>
			<if test="PI_USENM != null and PI_USENM !='' "> and PI_USENM = #{PI_USENM} </if>
			<if test="PI_USESTATE != null "> and PI_USESTATE = #{PI_USESTATE}  </if>
			<if test="PI_SUMMARYID != null "> and PI_SUMMARYID = #{PI_SUMMARYID}  </if>
			<if test="PI_SUBJECT != null and PI_SUBJECT !='' "> and PI_SUBJECT = #{PI_SUBJECT} </if>
			<if test="PI_FORMID != null "> and PI_FORMID = #{PI_FORMID}  </if>
			<if test="PI_FORMDATAID != null "> and PI_FORMDATAID = #{PI_FORMDATAID}  </if>
			<if test="PI_TEMPLATEID != null "> and PI_TEMPLATEID = #{PI_TEMPLATEID}  </if>
			<if test="PI_STARTACCOUNTID != null "> and PI_STARTACCOUNTID = #{PI_STARTACCOUNTID}  </if>
			<if test="PI_STARTDEPARTMENTID != null "> and PI_STARTDEPARTMENTID = #{PI_STARTDEPARTMENTID}  </if>
			<if test="PI_STARTMEMBERID != null "> and PI_STARTMEMBERID = #{PI_STARTMEMBERID}  </if>
			<if test="PI_STARTMEMBERNM != null and PI_STARTMEMBERNM !='' "> and PI_STARTMEMBERNM = #{PI_STARTMEMBERNM} </if>
			<if test="PI_STARTDATE != null "> and PI_STARTDATE = #{PI_STARTDATE}  </if>
			<if test="PI_DEALACCOUNTID != null "> and PI_DEALACCOUNTID = #{PI_DEALACCOUNTID}  </if>
			<if test="PI_DEALDEPARTMENTID != null "> and PI_DEALDEPARTMENTID = #{PI_DEALDEPARTMENTID}  </if>
			<if test="PI_DEALMEMBERID != null "> and PI_DEALMEMBERID = #{PI_DEALMEMBERID}  </if>
			<if test="PI_DEALMEMBERNM != null and PI_DEALMEMBERNM !='' "> and PI_DEALMEMBERNM = #{PI_DEALMEMBERNM} </if>
			<if test="PI_DEALDATE != null "> and PI_DEALDATE = #{PI_DEALDATE}  </if>
			<if test="PI_DEALSTATE != null "> and PI_DEALSTATE = #{PI_DEALSTATE}  </if>
			<if test="PI_DEALPOLICY != null and PI_DEALPOLICY !='' "> and PI_DEALPOLICY = #{PI_DEALPOLICY} </if>
			<if test="PI_DEALINFO != null and PI_DEALINFO !='' "> and PI_DEALINFO = #{PI_DEALINFO} </if>
			<if test="PI_SHAREID != null "> and PI_SHAREID = #{PI_SHAREID}  </if>
			<if test="PI_SHARENM != null and PI_SHARENM !='' "> and PI_SHARENM = #{PI_SHARENM} </if>
			<if test="PI_APITYPE != null "> and PI_APITYPE = #{PI_APITYPE}  </if>
			<if test="PI_ISVALID != null "> and PI_ISVALID = #{PI_ISVALID}  </if>
			<if test="PI_VALIDRESULT != null "> and PI_VALIDRESULT = #{PI_VALIDRESULT}  </if>
			<if test="PI_RESULTNM != null and PI_RESULTNM !='' "> and PI_RESULTNM = #{PI_RESULTNM} </if>
			<if test="PI_VALIDSTATE != null "> and PI_VALIDSTATE = #{PI_VALIDSTATE}  </if>
			<if test="PI_CLASSTYPE != null "> and PI_CLASSTYPE = #{PI_CLASSTYPE}  </if>
			<if test="PI_CLASSNAME != null and PI_CLASSNAME !='' "> and PI_CLASSNAME = #{PI_CLASSNAME} </if>
			<if test="PI_RECOVERSTATE != null "> and PI_RECOVERSTATE = #{PI_RECOVERSTATE}  </if>
			<if test="PI_RECOVERMEMBERID != null "> and PI_RECOVERMEMBERID = #{PI_RECOVERMEMBERID}  </if>
			<if test="PI_RECOVERMEMBERNM != null and PI_RECOVERMEMBERNM !='' "> and PI_RECOVERMEMBERNM = #{PI_RECOVERMEMBERNM} </if>
			<if test="PI_RECOVERDATE != null "> and PI_RECOVERDATE = #{PI_RECOVERDATE}  </if>
			<if test="PI_ORGID != null "> and PI_ORGID = #{PI_ORGID}  </if>
			<if test="PI_ORGNM != null and PI_ORGNM !='' "> and PI_ORGNM = #{PI_ORGNM} </if>
			<if test="PI_YEAR != null "> and PI_YEAR = #{PI_YEAR}  </if>
			<if test="PI_MONTH != null "> and PI_MONTH = #{PI_MONTH}  </if>
			<if test="PI_QUARTER != null "> and PI_QUARTER = #{PI_QUARTER}  </if>
			<if test="PI_HALFYEAR != null "> and PI_HALFYEAR = #{PI_HALFYEAR}  </if>
			<if test="PI_XMMC != null and PI_XMMC !='' "> and PI_XMMC = #{PI_XMMC} </if>
			<if test="PI_FPDM != null and PI_FPDM !='' "> and PI_FPDM = #{PI_FPDM} </if>
			<if test="PI_FPHM != null and PI_FPHM !='' "> and PI_FPHM = #{PI_FPHM} </if>
			<if test="PI_SALERTAXNO != null and PI_SALERTAXNO !='' "> and PI_SALERTAXNO = #{PI_SALERTAXNO} </if>
			<if test="PI_SALERNAME != null and PI_SALERNAME !='' "> and PI_SALERNAME = #{PI_SALERNAME} </if>
			<if test="PI_BUYERTAXNO != null and PI_BUYERTAXNO !='' "> and PI_BUYERTAXNO = #{PI_BUYERTAXNO} </if>
			<if test="PI_BUYERNAME != null and PI_BUYERNAME !='' "> and PI_BUYERNAME = #{PI_BUYERNAME} </if>
			<if test="PI_INVOICETYPE != null and PI_INVOICETYPE !='' "> and PI_INVOICETYPE = #{PI_INVOICETYPE} </if>
			<if test="PI_INVOICENAME != null and PI_INVOICENAME !='' "> and PI_INVOICENAME = #{PI_INVOICENAME} </if>
			<if test="PI_INVOICEDATE != null "> and PI_INVOICEDATE = #{PI_INVOICEDATE}  </if>
			<if test="PI_FSTATION != null and PI_FSTATION !='' "> and PI_FSTATION = #{PI_FSTATION} </if>
			<if test="PI_TSTATION != null and PI_TSTATION !='' "> and PI_TSTATION = #{PI_TSTATION} </if>
			<if test="PI_USERNAME != null and PI_USERNAME !='' "> and PI_USERNAME = #{PI_USERNAME} </if>
			<if test="PI_TRAINNO != null and PI_TRAINNO !='' "> and PI_TRAINNO = #{PI_TRAINNO} </if>
			<if test="PI_TRAINCODE != null and PI_TRAINCODE !='' "> and PI_TRAINCODE = #{PI_TRAINCODE} </if>
			<if test="PI_STARTDATETIME != null "> and PI_STARTDATETIME = #{PI_STARTDATETIME}  </if>
			<if test="PI_ENDDATETIME != null "> and PI_ENDDATETIME = #{PI_ENDDATETIME}  </if>
			<if test="PI_STARTTIME != null and PI_STARTTIME !='' "> and PI_STARTTIME = #{PI_STARTTIME} </if>
			<if test="PI_ENDTIME != null and PI_ENDTIME !='' "> and PI_ENDTIME = #{PI_ENDTIME} </if>
			<if test="PI_TAXRATE != null and PI_TAXRATE !='' "> and PI_TAXRATE = #{PI_TAXRATE} </if>
			<if test="PI_TAXAMOUNT != null "> and PI_TAXAMOUNT = #{PI_TAXAMOUNT}  </if>
			<if test="PI_NOTAXAMOUNT != null "> and PI_NOTAXAMOUNT = #{PI_NOTAXAMOUNT}  </if>
			<if test="PI_DEDUCTIONAMOUNT != null "> and PI_DEDUCTIONAMOUNT = #{PI_DEDUCTIONAMOUNT}  </if>
			<if test="PI_FILEURL != null and PI_FILEURL !='' "> and PI_FILEURL = #{PI_FILEURL} </if>
			<if test="PI_MATTERID != null "> and PI_MATTERID = #{PI_MATTERID}  </if>
			<if test="PI_VOUCHER != null and PI_VOUCHER !='' "> and PI_VOUCHER = #{PI_VOUCHER} </if>
			<if test="PI_VOUCHERINFO != null and PI_VOUCHERINFO !='' "> and PI_VOUCHERINFO = #{PI_VOUCHERINFO} </if>
			<if test="PI_FIELD0001 != null "> and PI_FIELD0001 = #{PI_FIELD0001}  </if>
			<if test="PI_FIELD0002 != null "> and PI_FIELD0002 = #{PI_FIELD0002}  </if>
			<if test="PI_FIELD0003 != null "> and PI_FIELD0003 = #{PI_FIELD0003}  </if>
			<if test="PI_FIELD0004 != null and PI_FIELD0004 !='' "> and PI_FIELD0004 = #{PI_FIELD0004} </if>
			<if test="PI_FIELD0005 != null and PI_FIELD0005 !='' "> and PI_FIELD0005 = #{PI_FIELD0005} </if>
			<if test="PI_INVOICEVALIDSTATE != null "> and PI_INVOICEVALIDSTATE = #{PI_INVOICEVALIDSTATE}  </if>
			<if test="PI_MODIFYSTATE != null "> and PI_MODIFYSTATE = #{PI_MODIFYSTATE}  </if>
			<if test="PI_USAGEAMOUNT != null "> and PI_USAGEAMOUNT = #{PI_USAGEAMOUNT}  </if>
			<if test="PI_VERIFYAMOUNT != null "> and PI_VERIFYAMOUNT = #{PI_VERIFYAMOUNT}  </if>
			<if test="PI_UNUSEDAMOUNT != null "> and PI_UNUSEDAMOUNT = #{PI_UNUSEDAMOUNT}  </if>
			<if test="PI_USECOUNT != null "> and PI_USECOUNT = #{PI_USECOUNT}  </if>
			<if test="PI_FILENAME != null and PI_FILENAME !='' "> and PI_FILENAME = #{PI_FILENAME} </if>
			<if test="PI_UPDATEDATE != null "> and PI_UPDATEDATE = #{PI_UPDATEDATE}  </if>
			<if test="PI_VOUCHERDATE != null "> and PI_VOUCHERDATE = #{PI_VOUCHERDATE}  </if>
			<if test="PI_CPAY_STATE != null "> and PI_CPAY_STATE = #{PI_CPAY_STATE}  </if>
			<if test="PI_CPAY_DATE != null "> and PI_CPAY_DATE = #{PI_CPAY_DATE}  </if>

		</trim>
		<if test=" sort =='' "> order by id desc</if>
		<if test=" sort !='' and sort!=null and order !='' and order!=null "> order by ${sort} ${order}</if>
	</select>

	<!-- 分页查询列表 采用like格式 -->
	<select id="LexmisPublicinfoEntity_list_like" resultMap="get-LexmisPublicinfoEntity-result" parameterType="com.hzya.frame.plugin.cinvoice.lexmis.entity.LexmisPublicinfoEntity">
		select
		<include refid="LexmisPublicinfoEntity_Base_Column_List" />
		from LEXMISCIV_PUBLICINFO
		<trim prefix="where" prefixOverrides="and">
			<if test="PI_ID != null ">PI_ID = #{PI_ID}</if>
			<if test="PI_KEY != null and PI_KEY !='' "> and PI_KEY like concat('%',#{PI_KEY},'%') </if>
			<if test="PI_KEY_NEW != null and PI_KEY_NEW !='' "> and PI_KEY_NEW like concat('%',#{PI_KEY_NEW},'%') </if>
			<if test="PI_DATAKEY != null "> and PI_DATAKEY = #{PI_DATAKEY}</if>
			<if test="PI_MAINCONFIGID != null "> and PI_MAINCONFIGID = #{PI_MAINCONFIGID}</if>
			<if test="PI_TAXNO != null and PI_TAXNO !='' "> and PI_TAXNO like concat('%',#{PI_TAXNO},'%') </if>
			<if test="PI_TABLENAME != null and PI_TABLENAME !='' "> and PI_TABLENAME like concat('%',#{PI_TABLENAME},'%') </if>
			<if test="PI_BILLKIND != null "> and PI_BILLKIND = #{PI_BILLKIND}</if>
			<if test="PI_BILLNAME != null and PI_BILLNAME !='' "> and PI_BILLNAME like concat('%',#{PI_BILLNAME},'%') </if>
			<if test="PI_AMOUNT != null "> and PI_AMOUNT = #{PI_AMOUNT}</if>
			<if test="PI_STATE != null "> and PI_STATE = #{PI_STATE}</if>
			<if test="PI_FILEID != null "> and PI_FILEID = #{PI_FILEID}</if>
			<if test="PI_FILEDATE != null and PI_FILEDATE !='' "> and PI_FILEDATE like concat('%',#{PI_FILEDATE},'%') </if>
			<if test="PI_IMAGEPATH != null and PI_IMAGEPATH !='' "> and PI_IMAGEPATH like concat('%',#{PI_IMAGEPATH},'%') </if>
			<if test="PI_UPDATEDATA != null "> and PI_UPDATEDATA = #{PI_UPDATEDATA}</if>
			<if test="PI_TYPE != null and PI_TYPE !='' "> and PI_TYPE like concat('%',#{PI_TYPE},'%') </if>
			<if test="PI_MEMBERID != null "> and PI_MEMBERID = #{PI_MEMBERID}</if>
			<if test="PI_MEMBERNM != null and PI_MEMBERNM !='' "> and PI_MEMBERNM like concat('%',#{PI_MEMBERNM},'%') </if>
			<if test="PI_MAKEDATE != null and PI_MAKEDATE !='' "> and PI_MAKEDATE like concat('%',#{PI_MAKEDATE},'%') </if>
			<if test="PI_BELONGID != null "> and PI_BELONGID = #{PI_BELONGID}</if>
			<if test="PI_BELONGNM != null and PI_BELONGNM !='' "> and PI_BELONGNM like concat('%',#{PI_BELONGNM},'%') </if>
			<if test="PI_USEACCOUNTID != null "> and PI_USEACCOUNTID = #{PI_USEACCOUNTID}</if>
			<if test="PI_USEACCOUNTNM != null and PI_USEACCOUNTNM !='' "> and PI_USEACCOUNTNM like concat('%',#{PI_USEACCOUNTNM},'%') </if>
			<if test="PI_USEDEPARTMENTID != null "> and PI_USEDEPARTMENTID = #{PI_USEDEPARTMENTID}</if>
			<if test="PI_USEDEPARTMENTNM != null and PI_USEDEPARTMENTNM !='' "> and PI_USEDEPARTMENTNM like concat('%',#{PI_USEDEPARTMENTNM},'%') </if>
			<if test="PI_USEID != null "> and PI_USEID = #{PI_USEID}</if>
			<if test="PI_USENM != null and PI_USENM !='' "> and PI_USENM like concat('%',#{PI_USENM},'%') </if>
			<if test="PI_USESTATE != null "> and PI_USESTATE = #{PI_USESTATE}</if>
			<if test="PI_SUMMARYID != null "> and PI_SUMMARYID = #{PI_SUMMARYID}</if>
			<if test="PI_SUBJECT != null and PI_SUBJECT !='' "> and PI_SUBJECT like concat('%',#{PI_SUBJECT},'%') </if>
			<if test="PI_FORMID != null "> and PI_FORMID = #{PI_FORMID}</if>
			<if test="PI_FORMDATAID != null "> and PI_FORMDATAID = #{PI_FORMDATAID}</if>
			<if test="PI_TEMPLATEID != null "> and PI_TEMPLATEID = #{PI_TEMPLATEID}</if>
			<if test="PI_STARTACCOUNTID != null "> and PI_STARTACCOUNTID = #{PI_STARTACCOUNTID}</if>
			<if test="PI_STARTDEPARTMENTID != null "> and PI_STARTDEPARTMENTID = #{PI_STARTDEPARTMENTID}</if>
			<if test="PI_STARTMEMBERID != null "> and PI_STARTMEMBERID = #{PI_STARTMEMBERID}</if>
			<if test="PI_STARTMEMBERNM != null and PI_STARTMEMBERNM !='' "> and PI_STARTMEMBERNM like concat('%',#{PI_STARTMEMBERNM},'%') </if>
			<if test="PI_STARTDATE != null and PI_STARTDATE !='' "> and PI_STARTDATE like concat('%',#{PI_STARTDATE},'%') </if>
			<if test="PI_DEALACCOUNTID != null "> and PI_DEALACCOUNTID = #{PI_DEALACCOUNTID}</if>
			<if test="PI_DEALDEPARTMENTID != null "> and PI_DEALDEPARTMENTID = #{PI_DEALDEPARTMENTID}</if>
			<if test="PI_DEALMEMBERID != null "> and PI_DEALMEMBERID = #{PI_DEALMEMBERID}</if>
			<if test="PI_DEALMEMBERNM != null and PI_DEALMEMBERNM !='' "> and PI_DEALMEMBERNM like concat('%',#{PI_DEALMEMBERNM},'%') </if>
			<if test="PI_DEALDATE != null and PI_DEALDATE !='' "> and PI_DEALDATE like concat('%',#{PI_DEALDATE},'%') </if>
			<if test="PI_DEALSTATE != null "> and PI_DEALSTATE = #{PI_DEALSTATE}</if>
			<if test="PI_DEALPOLICY != null and PI_DEALPOLICY !='' "> and PI_DEALPOLICY like concat('%',#{PI_DEALPOLICY},'%') </if>
			<if test="PI_DEALINFO != null and PI_DEALINFO !='' "> and PI_DEALINFO like concat('%',#{PI_DEALINFO},'%') </if>
			<if test="PI_SHAREID != null "> and PI_SHAREID = #{PI_SHAREID}</if>
			<if test="PI_SHARENM != null and PI_SHARENM !='' "> and PI_SHARENM like concat('%',#{PI_SHARENM},'%') </if>
			<if test="PI_APITYPE != null "> and PI_APITYPE = #{PI_APITYPE}</if>
			<if test="PI_ISVALID != null "> and PI_ISVALID = #{PI_ISVALID}</if>
			<if test="PI_VALIDRESULT != null "> and PI_VALIDRESULT = #{PI_VALIDRESULT}</if>
			<if test="PI_RESULTNM != null and PI_RESULTNM !='' "> and PI_RESULTNM like concat('%',#{PI_RESULTNM},'%') </if>
			<if test="PI_VALIDSTATE != null "> and PI_VALIDSTATE = #{PI_VALIDSTATE}</if>
			<if test="PI_CLASSTYPE != null "> and PI_CLASSTYPE = #{PI_CLASSTYPE}</if>
			<if test="PI_CLASSNAME != null and PI_CLASSNAME !='' "> and PI_CLASSNAME like concat('%',#{PI_CLASSNAME},'%') </if>
			<if test="PI_RECOVERSTATE != null "> and PI_RECOVERSTATE = #{PI_RECOVERSTATE}</if>
			<if test="PI_RECOVERMEMBERID != null "> and PI_RECOVERMEMBERID = #{PI_RECOVERMEMBERID}</if>
			<if test="PI_RECOVERMEMBERNM != null and PI_RECOVERMEMBERNM !='' "> and PI_RECOVERMEMBERNM like concat('%',#{PI_RECOVERMEMBERNM},'%') </if>
			<if test="PI_RECOVERDATE != null and PI_RECOVERDATE !='' "> and PI_RECOVERDATE like concat('%',#{PI_RECOVERDATE},'%') </if>
			<if test="PI_ORGID != null "> and PI_ORGID = #{PI_ORGID}</if>
			<if test="PI_ORGNM != null and PI_ORGNM !='' "> and PI_ORGNM like concat('%',#{PI_ORGNM},'%') </if>
			<if test="PI_YEAR != null "> and PI_YEAR = #{PI_YEAR}</if>
			<if test="PI_MONTH != null "> and PI_MONTH = #{PI_MONTH}</if>
			<if test="PI_QUARTER != null "> and PI_QUARTER = #{PI_QUARTER}</if>
			<if test="PI_HALFYEAR != null "> and PI_HALFYEAR = #{PI_HALFYEAR}</if>
			<if test="PI_XMMC != null and PI_XMMC !='' "> and PI_XMMC like concat('%',#{PI_XMMC},'%') </if>
			<if test="PI_FPDM != null and PI_FPDM !='' "> and PI_FPDM like concat('%',#{PI_FPDM},'%') </if>
			<if test="PI_FPHM != null and PI_FPHM !='' "> and PI_FPHM like concat('%',#{PI_FPHM},'%') </if>
			<if test="PI_SALERTAXNO != null and PI_SALERTAXNO !='' "> and PI_SALERTAXNO like concat('%',#{PI_SALERTAXNO},'%') </if>
			<if test="PI_SALERNAME != null and PI_SALERNAME !='' "> and PI_SALERNAME like concat('%',#{PI_SALERNAME},'%') </if>
			<if test="PI_BUYERTAXNO != null and PI_BUYERTAXNO !='' "> and PI_BUYERTAXNO like concat('%',#{PI_BUYERTAXNO},'%') </if>
			<if test="PI_BUYERNAME != null and PI_BUYERNAME !='' "> and PI_BUYERNAME like concat('%',#{PI_BUYERNAME},'%') </if>
			<if test="PI_INVOICETYPE != null and PI_INVOICETYPE !='' "> and PI_INVOICETYPE like concat('%',#{PI_INVOICETYPE},'%') </if>
			<if test="PI_INVOICENAME != null and PI_INVOICENAME !='' "> and PI_INVOICENAME like concat('%',#{PI_INVOICENAME},'%') </if>
			<if test="PI_INVOICEDATE != null and PI_INVOICEDATE !='' "> and PI_INVOICEDATE like concat('%',#{PI_INVOICEDATE},'%') </if>
			<if test="PI_FSTATION != null and PI_FSTATION !='' "> and PI_FSTATION like concat('%',#{PI_FSTATION},'%') </if>
			<if test="PI_TSTATION != null and PI_TSTATION !='' "> and PI_TSTATION like concat('%',#{PI_TSTATION},'%') </if>
			<if test="PI_USERNAME != null and PI_USERNAME !='' "> and PI_USERNAME like concat('%',#{PI_USERNAME},'%') </if>
			<if test="PI_TRAINNO != null and PI_TRAINNO !='' "> and PI_TRAINNO like concat('%',#{PI_TRAINNO},'%') </if>
			<if test="PI_TRAINCODE != null and PI_TRAINCODE !='' "> and PI_TRAINCODE like concat('%',#{PI_TRAINCODE},'%') </if>
			<if test="PI_STARTDATETIME != null and PI_STARTDATETIME !='' "> and PI_STARTDATETIME like concat('%',#{PI_STARTDATETIME},'%') </if>
			<if test="PI_ENDDATETIME != null and PI_ENDDATETIME !='' "> and PI_ENDDATETIME like concat('%',#{PI_ENDDATETIME},'%') </if>
			<if test="PI_STARTTIME != null and PI_STARTTIME !='' "> and PI_STARTTIME like concat('%',#{PI_STARTTIME},'%') </if>
			<if test="PI_ENDTIME != null and PI_ENDTIME !='' "> and PI_ENDTIME like concat('%',#{PI_ENDTIME},'%') </if>
			<if test="PI_TAXRATE != null and PI_TAXRATE !='' "> and PI_TAXRATE like concat('%',#{PI_TAXRATE},'%') </if>
			<if test="PI_TAXAMOUNT != null "> and PI_TAXAMOUNT = #{PI_TAXAMOUNT}</if>
			<if test="PI_NOTAXAMOUNT != null "> and PI_NOTAXAMOUNT = #{PI_NOTAXAMOUNT}</if>
			<if test="PI_DEDUCTIONAMOUNT != null "> and PI_DEDUCTIONAMOUNT = #{PI_DEDUCTIONAMOUNT}</if>
			<if test="PI_FILEURL != null and PI_FILEURL !='' "> and PI_FILEURL like concat('%',#{PI_FILEURL},'%') </if>
			<if test="PI_MATTERID != null "> and PI_MATTERID = #{PI_MATTERID}</if>
			<if test="PI_VOUCHER != null and PI_VOUCHER !='' "> and PI_VOUCHER like concat('%',#{PI_VOUCHER},'%') </if>
			<if test="PI_VOUCHERINFO != null and PI_VOUCHERINFO !='' "> and PI_VOUCHERINFO like concat('%',#{PI_VOUCHERINFO},'%') </if>
			<if test="PI_FIELD0001 != null "> and PI_FIELD0001 = #{PI_FIELD0001}</if>
			<if test="PI_FIELD0002 != null "> and PI_FIELD0002 = #{PI_FIELD0002}</if>
			<if test="PI_FIELD0003 != null "> and PI_FIELD0003 = #{PI_FIELD0003}</if>
			<if test="PI_FIELD0004 != null and PI_FIELD0004 !='' "> and PI_FIELD0004 like concat('%',#{PI_FIELD0004},'%') </if>
			<if test="PI_FIELD0005 != null and PI_FIELD0005 !='' "> and PI_FIELD0005 like concat('%',#{PI_FIELD0005},'%') </if>
			<if test="PI_INVOICEVALIDSTATE != null "> and PI_INVOICEVALIDSTATE = #{PI_INVOICEVALIDSTATE}</if>
			<if test="PI_MODIFYSTATE != null "> and PI_MODIFYSTATE = #{PI_MODIFYSTATE}</if>
			<if test="PI_USAGEAMOUNT != null "> and PI_USAGEAMOUNT = #{PI_USAGEAMOUNT}</if>
			<if test="PI_VERIFYAMOUNT != null "> and PI_VERIFYAMOUNT = #{PI_VERIFYAMOUNT}</if>
			<if test="PI_UNUSEDAMOUNT != null "> and PI_UNUSEDAMOUNT = #{PI_UNUSEDAMOUNT}</if>
			<if test="PI_USECOUNT != null "> and PI_USECOUNT = #{PI_USECOUNT}</if>
			<if test="PI_FILENAME != null and PI_FILENAME !='' "> and PI_FILENAME like concat('%',#{PI_FILENAME},'%') </if>
			<if test="PI_UPDATEDATE != null and PI_UPDATEDATE !='' "> and PI_UPDATEDATE like concat('%',#{PI_UPDATEDATE},'%') </if>
			<if test="PI_VOUCHERDATE != null and PI_VOUCHERDATE !='' "> and PI_VOUCHERDATE like concat('%',#{PI_VOUCHERDATE},'%') </if>
			<if test="PI_CPAY_STATE != null "> and PI_CPAY_STATE = #{PI_CPAY_STATE}</if>
			<if test="PI_CPAY_DATE != null and PI_CPAY_DATE !='' "> and PI_CPAY_DATE like concat('%',#{PI_CPAY_DATE},'%') </if>

		</trim>
		<if test=" sort =='' "> order by id desc</if>
		<if test=" sort !='' and sort!=null and order !='' and order!=null ">order by  ${sort} ${order}</if>
	</select>

	<!-- 查询列表 字段采用or格式 -->
	<select id="LexmisPublicinfoEntity_list_or" resultMap="get-LexmisPublicinfoEntity-result" parameterType="com.hzya.frame.plugin.cinvoice.lexmis.entity.LexmisPublicinfoEntity">
		select
		<include refid="LexmisPublicinfoEntity_Base_Column_List" />
		from LEXMISCIV_PUBLICINFO
		<trim prefix="where" prefixOverrides="or">
			<if test="PI_ID != null ">PI_ID = #{PI_ID}</if>
			<if test="PI_KEY != null and PI_KEY !='' "> or PI_KEY = #{PI_KEY} </if>
			<if test="PI_KEY_NEW != null and PI_KEY_NEW !='' "> or PI_KEY_NEW = #{PI_KEY_NEW} </if>
			<if test="PI_DATAKEY != null "> or PI_DATAKEY = #{PI_DATAKEY}</if>
			<if test="PI_MAINCONFIGID != null "> or PI_MAINCONFIGID = #{PI_MAINCONFIGID}</if>
			<if test="PI_TAXNO != null and PI_TAXNO !='' "> or PI_TAXNO = #{PI_TAXNO} </if>
			<if test="PI_TABLENAME != null and PI_TABLENAME !='' "> or PI_TABLENAME = #{PI_TABLENAME} </if>
			<if test="PI_BILLKIND != null "> or PI_BILLKIND = #{PI_BILLKIND}</if>
			<if test="PI_BILLNAME != null and PI_BILLNAME !='' "> or PI_BILLNAME = #{PI_BILLNAME} </if>
			<if test="PI_AMOUNT != null "> or PI_AMOUNT = #{PI_AMOUNT}</if>
			<if test="PI_STATE != null "> or PI_STATE = #{PI_STATE}</if>
			<if test="PI_FILEID != null "> or PI_FILEID = #{PI_FILEID}</if>
			<if test="PI_FILEDATE != null and PI_FILEDATE !='' "> or PI_FILEDATE = #{PI_FILEDATE} </if>
			<if test="PI_IMAGEPATH != null and PI_IMAGEPATH !='' "> or PI_IMAGEPATH = #{PI_IMAGEPATH} </if>
			<if test="PI_UPDATEDATA != null "> or PI_UPDATEDATA = #{PI_UPDATEDATA}</if>
			<if test="PI_TYPE != null and PI_TYPE !='' "> or PI_TYPE = #{PI_TYPE} </if>
			<if test="PI_MEMBERID != null "> or PI_MEMBERID = #{PI_MEMBERID}</if>
			<if test="PI_MEMBERNM != null and PI_MEMBERNM !='' "> or PI_MEMBERNM = #{PI_MEMBERNM} </if>
			<if test="PI_MAKEDATE != null and PI_MAKEDATE !='' "> or PI_MAKEDATE = #{PI_MAKEDATE} </if>
			<if test="PI_BELONGID != null "> or PI_BELONGID = #{PI_BELONGID}</if>
			<if test="PI_BELONGNM != null and PI_BELONGNM !='' "> or PI_BELONGNM = #{PI_BELONGNM} </if>
			<if test="PI_USEACCOUNTID != null "> or PI_USEACCOUNTID = #{PI_USEACCOUNTID}</if>
			<if test="PI_USEACCOUNTNM != null and PI_USEACCOUNTNM !='' "> or PI_USEACCOUNTNM = #{PI_USEACCOUNTNM} </if>
			<if test="PI_USEDEPARTMENTID != null "> or PI_USEDEPARTMENTID = #{PI_USEDEPARTMENTID}</if>
			<if test="PI_USEDEPARTMENTNM != null and PI_USEDEPARTMENTNM !='' "> or PI_USEDEPARTMENTNM = #{PI_USEDEPARTMENTNM} </if>
			<if test="PI_USEID != null "> or PI_USEID = #{PI_USEID}</if>
			<if test="PI_USENM != null and PI_USENM !='' "> or PI_USENM = #{PI_USENM} </if>
			<if test="PI_USESTATE != null "> or PI_USESTATE = #{PI_USESTATE}</if>
			<if test="PI_SUMMARYID != null "> or PI_SUMMARYID = #{PI_SUMMARYID}</if>
			<if test="PI_SUBJECT != null and PI_SUBJECT !='' "> or PI_SUBJECT = #{PI_SUBJECT} </if>
			<if test="PI_FORMID != null "> or PI_FORMID = #{PI_FORMID}</if>
			<if test="PI_FORMDATAID != null "> or PI_FORMDATAID = #{PI_FORMDATAID}</if>
			<if test="PI_TEMPLATEID != null "> or PI_TEMPLATEID = #{PI_TEMPLATEID}</if>
			<if test="PI_STARTACCOUNTID != null "> or PI_STARTACCOUNTID = #{PI_STARTACCOUNTID}</if>
			<if test="PI_STARTDEPARTMENTID != null "> or PI_STARTDEPARTMENTID = #{PI_STARTDEPARTMENTID}</if>
			<if test="PI_STARTMEMBERID != null "> or PI_STARTMEMBERID = #{PI_STARTMEMBERID}</if>
			<if test="PI_STARTMEMBERNM != null and PI_STARTMEMBERNM !='' "> or PI_STARTMEMBERNM = #{PI_STARTMEMBERNM} </if>
			<if test="PI_STARTDATE != null and PI_STARTDATE !='' "> or PI_STARTDATE = #{PI_STARTDATE} </if>
			<if test="PI_DEALACCOUNTID != null "> or PI_DEALACCOUNTID = #{PI_DEALACCOUNTID}</if>
			<if test="PI_DEALDEPARTMENTID != null "> or PI_DEALDEPARTMENTID = #{PI_DEALDEPARTMENTID}</if>
			<if test="PI_DEALMEMBERID != null "> or PI_DEALMEMBERID = #{PI_DEALMEMBERID}</if>
			<if test="PI_DEALMEMBERNM != null and PI_DEALMEMBERNM !='' "> or PI_DEALMEMBERNM = #{PI_DEALMEMBERNM} </if>
			<if test="PI_DEALDATE != null and PI_DEALDATE !='' "> or PI_DEALDATE = #{PI_DEALDATE} </if>
			<if test="PI_DEALSTATE != null "> or PI_DEALSTATE = #{PI_DEALSTATE}</if>
			<if test="PI_DEALPOLICY != null and PI_DEALPOLICY !='' "> or PI_DEALPOLICY = #{PI_DEALPOLICY} </if>
			<if test="PI_DEALINFO != null and PI_DEALINFO !='' "> or PI_DEALINFO = #{PI_DEALINFO} </if>
			<if test="PI_SHAREID != null "> or PI_SHAREID = #{PI_SHAREID}</if>
			<if test="PI_SHARENM != null and PI_SHARENM !='' "> or PI_SHARENM = #{PI_SHARENM} </if>
			<if test="PI_APITYPE != null "> or PI_APITYPE = #{PI_APITYPE}</if>
			<if test="PI_ISVALID != null "> or PI_ISVALID = #{PI_ISVALID}</if>
			<if test="PI_VALIDRESULT != null "> or PI_VALIDRESULT = #{PI_VALIDRESULT}</if>
			<if test="PI_RESULTNM != null and PI_RESULTNM !='' "> or PI_RESULTNM = #{PI_RESULTNM} </if>
			<if test="PI_VALIDSTATE != null "> or PI_VALIDSTATE = #{PI_VALIDSTATE}</if>
			<if test="PI_CLASSTYPE != null "> or PI_CLASSTYPE = #{PI_CLASSTYPE}</if>
			<if test="PI_CLASSNAME != null and PI_CLASSNAME !='' "> or PI_CLASSNAME = #{PI_CLASSNAME} </if>
			<if test="PI_RECOVERSTATE != null "> or PI_RECOVERSTATE = #{PI_RECOVERSTATE}</if>
			<if test="PI_RECOVERMEMBERID != null "> or PI_RECOVERMEMBERID = #{PI_RECOVERMEMBERID}</if>
			<if test="PI_RECOVERMEMBERNM != null and PI_RECOVERMEMBERNM !='' "> or PI_RECOVERMEMBERNM = #{PI_RECOVERMEMBERNM} </if>
			<if test="PI_RECOVERDATE != null and PI_RECOVERDATE !='' "> or PI_RECOVERDATE = #{PI_RECOVERDATE} </if>
			<if test="PI_ORGID != null "> or PI_ORGID = #{PI_ORGID}</if>
			<if test="PI_ORGNM != null and PI_ORGNM !='' "> or PI_ORGNM = #{PI_ORGNM} </if>
			<if test="PI_YEAR != null "> or PI_YEAR = #{PI_YEAR}</if>
			<if test="PI_MONTH != null "> or PI_MONTH = #{PI_MONTH}</if>
			<if test="PI_QUARTER != null "> or PI_QUARTER = #{PI_QUARTER}</if>
			<if test="PI_HALFYEAR != null "> or PI_HALFYEAR = #{PI_HALFYEAR}</if>
			<if test="PI_XMMC != null and PI_XMMC !='' "> or PI_XMMC = #{PI_XMMC} </if>
			<if test="PI_FPDM != null and PI_FPDM !='' "> or PI_FPDM = #{PI_FPDM} </if>
			<if test="PI_FPHM != null and PI_FPHM !='' "> or PI_FPHM = #{PI_FPHM} </if>
			<if test="PI_SALERTAXNO != null and PI_SALERTAXNO !='' "> or PI_SALERTAXNO = #{PI_SALERTAXNO} </if>
			<if test="PI_SALERNAME != null and PI_SALERNAME !='' "> or PI_SALERNAME = #{PI_SALERNAME} </if>
			<if test="PI_BUYERTAXNO != null and PI_BUYERTAXNO !='' "> or PI_BUYERTAXNO = #{PI_BUYERTAXNO} </if>
			<if test="PI_BUYERNAME != null and PI_BUYERNAME !='' "> or PI_BUYERNAME = #{PI_BUYERNAME} </if>
			<if test="PI_INVOICETYPE != null and PI_INVOICETYPE !='' "> or PI_INVOICETYPE = #{PI_INVOICETYPE} </if>
			<if test="PI_INVOICENAME != null and PI_INVOICENAME !='' "> or PI_INVOICENAME = #{PI_INVOICENAME} </if>
			<if test="PI_INVOICEDATE != null and PI_INVOICEDATE !='' "> or PI_INVOICEDATE = #{PI_INVOICEDATE} </if>
			<if test="PI_FSTATION != null and PI_FSTATION !='' "> or PI_FSTATION = #{PI_FSTATION} </if>
			<if test="PI_TSTATION != null and PI_TSTATION !='' "> or PI_TSTATION = #{PI_TSTATION} </if>
			<if test="PI_USERNAME != null and PI_USERNAME !='' "> or PI_USERNAME = #{PI_USERNAME} </if>
			<if test="PI_TRAINNO != null and PI_TRAINNO !='' "> or PI_TRAINNO = #{PI_TRAINNO} </if>
			<if test="PI_TRAINCODE != null and PI_TRAINCODE !='' "> or PI_TRAINCODE = #{PI_TRAINCODE} </if>
			<if test="PI_STARTDATETIME != null and PI_STARTDATETIME !='' "> or PI_STARTDATETIME = #{PI_STARTDATETIME} </if>
			<if test="PI_ENDDATETIME != null and PI_ENDDATETIME !='' "> or PI_ENDDATETIME = #{PI_ENDDATETIME} </if>
			<if test="PI_STARTTIME != null and PI_STARTTIME !='' "> or PI_STARTTIME = #{PI_STARTTIME} </if>
			<if test="PI_ENDTIME != null and PI_ENDTIME !='' "> or PI_ENDTIME = #{PI_ENDTIME} </if>
			<if test="PI_TAXRATE != null and PI_TAXRATE !='' "> or PI_TAXRATE = #{PI_TAXRATE} </if>
			<if test="PI_TAXAMOUNT != null "> or PI_TAXAMOUNT = #{PI_TAXAMOUNT}</if>
			<if test="PI_NOTAXAMOUNT != null "> or PI_NOTAXAMOUNT = #{PI_NOTAXAMOUNT}</if>
			<if test="PI_DEDUCTIONAMOUNT != null "> or PI_DEDUCTIONAMOUNT = #{PI_DEDUCTIONAMOUNT}</if>
			<if test="PI_FILEURL != null and PI_FILEURL !='' "> or PI_FILEURL = #{PI_FILEURL} </if>
			<if test="PI_MATTERID != null "> or PI_MATTERID = #{PI_MATTERID}</if>
			<if test="PI_VOUCHER != null and PI_VOUCHER !='' "> or PI_VOUCHER = #{PI_VOUCHER} </if>
			<if test="PI_VOUCHERINFO != null and PI_VOUCHERINFO !='' "> or PI_VOUCHERINFO = #{PI_VOUCHERINFO} </if>
			<if test="PI_FIELD0001 != null "> or PI_FIELD0001 = #{PI_FIELD0001}</if>
			<if test="PI_FIELD0002 != null "> or PI_FIELD0002 = #{PI_FIELD0002}</if>
			<if test="PI_FIELD0003 != null "> or PI_FIELD0003 = #{PI_FIELD0003}</if>
			<if test="PI_FIELD0004 != null and PI_FIELD0004 !='' "> or PI_FIELD0004 = #{PI_FIELD0004} </if>
			<if test="PI_FIELD0005 != null and PI_FIELD0005 !='' "> or PI_FIELD0005 = #{PI_FIELD0005} </if>
			<if test="PI_INVOICEVALIDSTATE != null "> or PI_INVOICEVALIDSTATE = #{PI_INVOICEVALIDSTATE}</if>
			<if test="PI_MODIFYSTATE != null "> or PI_MODIFYSTATE = #{PI_MODIFYSTATE}</if>
			<if test="PI_USAGEAMOUNT != null "> or PI_USAGEAMOUNT = #{PI_USAGEAMOUNT}</if>
			<if test="PI_VERIFYAMOUNT != null "> or PI_VERIFYAMOUNT = #{PI_VERIFYAMOUNT}</if>
			<if test="PI_UNUSEDAMOUNT != null "> or PI_UNUSEDAMOUNT = #{PI_UNUSEDAMOUNT}</if>
			<if test="PI_USECOUNT != null "> or PI_USECOUNT = #{PI_USECOUNT}</if>
			<if test="PI_FILENAME != null and PI_FILENAME !='' "> or PI_FILENAME = #{PI_FILENAME} </if>
			<if test="PI_UPDATEDATE != null and PI_UPDATEDATE !='' "> or PI_UPDATEDATE = #{PI_UPDATEDATE} </if>
			<if test="PI_VOUCHERDATE != null and PI_VOUCHERDATE !='' "> or PI_VOUCHERDATE = #{PI_VOUCHERDATE} </if>
			<if test="PI_CPAY_STATE != null "> or PI_CPAY_STATE = #{PI_CPAY_STATE}</if>
			<if test="PI_CPAY_DATE != null and PI_CPAY_DATE !='' "> or PI_CPAY_DATE = #{PI_CPAY_DATE} </if>

		</trim>
		<if test=" sort =='' "> order by id desc</if>
		<if test=" sort !='' and sort!=null and order !='' and order!=null ">order by  ${sort} ${order}</if>
	</select>
</mapper>
