<?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.LexmiscivInvoicemainDaoImpl">
	<resultMap id="get-LexmiscivInvoicemainEntity-result" type="com.hzya.frame.plugin.cinvoice.lexmis.entity.LexmiscivInvoicemainEntity">
		<!--无备注 -->
		<result property="IM_ID" column="IM_ID" />
		<!--无备注 -->
		<result property="IM_FPDM" column="IM_FPDM" />
		<!--无备注 -->
		<result property="IM_FPHM" column="IM_FPHM" />
		<!--无备注 -->
		<result property="IM_DATE" column="IM_DATE" />
		<!--无备注 -->
		<result property="IM_CHECKCODE" column="IM_CHECKCODE" />
		<!--无备注 -->
		<result property="IM_SALERTAXNO" column="IM_SALERTAXNO" />
		<!--无备注 -->
		<result property="IM_SALERNAME" column="IM_SALERNAME" />
		<!--无备注 -->
		<result property="IM_SALERADDRESS" column="IM_SALERADDRESS" />
		<!--无备注 -->
		<result property="IM_SALERBANKNO" column="IM_SALERBANKNO" />
		<!--无备注 -->
		<result property="IM_SALERBANKNM" column="IM_SALERBANKNM" />
		<!--无备注 -->
		<result property="IM_BUYERTAXNO" column="IM_BUYERTAXNO" />
		<!--无备注 -->
		<result property="IM_BUYERNAME" column="IM_BUYERNAME" />
		<!--无备注 -->
		<result property="IM_BUYERADDRESS" column="IM_BUYERADDRESS" />
		<!--无备注 -->
		<result property="IM_BUYERBANKNO" column="IM_BUYERBANKNO" />
		<!--无备注 -->
		<result property="IM_BUYERBANKNM" column="IM_BUYERBANKNM" />
		<!--无备注 -->
		<result property="IM_MAKERNM" column="IM_MAKERNM" />
		<!--无备注 -->
		<result property="IM_PAYEE" column="IM_PAYEE" />
		<!--无备注 -->
		<result property="IM_AUDITOR" column="IM_AUDITOR" />
		<!--无备注 -->
		<result property="IM_NOTAXAMOUNT" column="IM_NOTAXAMOUNT" />
		<!--无备注 -->
		<result property="IM_TAXAMOUNT" column="IM_TAXAMOUNT" />
		<!--无备注 -->
		<result property="IM_TOTALAMOUNT" column="IM_TOTALAMOUNT" />
		<!--无备注 -->
		<result property="IM_TAX" column="IM_TAX" />
		<!--无备注 -->
		<result property="IM_MACHINENO" column="IM_MACHINENO" />
		<!--无备注 -->
		<result property="IM_MEMO" column="IM_MEMO" />
		<!--无备注 -->
		<result property="IM_ENCRYPTIONCODE" column="IM_ENCRYPTIONCODE" />
		<!--无备注 -->
		<result property="IM_TYPE" column="IM_TYPE" />
		<!--无备注 -->
		<result property="IM_TYPENAME" column="IM_TYPENAME" />
		<!--无备注 -->
		<result property="IM_XMMC" column="IM_XMMC" />
		<!--无备注 -->
		<result property="IM_KEY" column="IM_KEY" />
		<!--无备注 -->
		<result property="IM_AREACODE" column="IM_AREACODE" />
		<!--无备注 -->
		<result property="IM_AREANAME" column="IM_AREANAME" />
		<!--无备注 -->
		<result property="IM_PRINTEDFPDM" column="IM_PRINTEDFPDM" />
		<!--无备注 -->
		<result property="IM_PRINTEDFPHM" column="IM_PRINTEDFPHM" />
		<!--无备注 -->
		<result property="IM_COUNT" column="IM_COUNT" />
		<!--无备注 -->
		<result property="IM_AGENCY" column="IM_AGENCY" />
		<!--无备注 -->
		<result property="IM_BLOCKCHAIN" column="IM_BLOCKCHAIN" />
		<!--无备注 -->
		<result property="IM_COMPANYSEAL" column="IM_COMPANYSEAL" />
		<!--无备注 -->
		<result property="IM_COMPANYSEALDEPT" column="IM_COMPANYSEALDEPT" />
		<!--无备注 -->
		<result property="IM_COMPANYSEALNUM" column="IM_COMPANYSEALNUM" />
		<!--无备注 -->
		<result property="IM_SADDRESS" column="IM_SADDRESS" />
		<!--无备注 -->
		<result property="IM_STEL" column="IM_STEL" />
		<!--无备注 -->
		<result property="IM_SBANKNM" column="IM_SBANKNM" />
		<!--无备注 -->
		<result property="IM_SBANKNO" column="IM_SBANKNO" />
		<!--无备注 -->
		<result property="IM_BADDRESS" column="IM_BADDRESS" />
		<!--无备注 -->
		<result property="IM_BTEL" column="IM_BTEL" />
		<!--无备注 -->
		<result property="IM_BBANKNM" column="IM_BBANKNM" />
		<!--无备注 -->
		<result property="IM_BBANKNO" column="IM_BBANKNO" />
		<!--无备注 -->
		<result property="IM_DATETIME" column="IM_DATETIME" />
		<!--无备注 -->
		<result property="IM_EDATETIME" column="IM_EDATETIME" />
		<!--无备注 -->
		<result property="IM_TOTALAMOUNTOCR" column="IM_TOTALAMOUNTOCR" />
		<!--无备注 -->
		<result property="IM_PAGER_ELECTRONIC" column="IM_PAGER_ELECTRONIC" />
		<!--无备注 -->
		<result property="IM_ELECTRONIC_NUMBER" column="IM_ELECTRONIC_NUMBER" />
	</resultMap>

	<sql id="LexmiscivInvoicemainEntity_Base_Column_List">
		IM_ID,
		IM_FPDM,
		IM_FPHM,
		IM_DATE,
		IM_CHECKCODE,
		IM_SALERTAXNO,
		IM_SALERNAME,
		IM_SALERADDRESS,
		IM_SALERBANKNO,
		IM_SALERBANKNM,
		IM_BUYERTAXNO,
		IM_BUYERNAME,
		IM_BUYERADDRESS,
		IM_BUYERBANKNO,
		IM_BUYERBANKNM,
		IM_MAKERNM,
		IM_PAYEE,
		IM_AUDITOR,
		IM_NOTAXAMOUNT,
		IM_TAXAMOUNT,
		IM_TOTALAMOUNT,
		IM_TAX,
		IM_MACHINENO,
		IM_MEMO,
		IM_ENCRYPTIONCODE,
		IM_TYPE,
		IM_TYPENAME,
		IM_XMMC,
		IM_KEY,
		IM_AREACODE,
		IM_AREANAME,
		IM_PRINTEDFPDM,
		IM_PRINTEDFPHM,
		IM_COUNT,
		IM_AGENCY,
		IM_BLOCKCHAIN,
		IM_COMPANYSEAL,
		IM_COMPANYSEALDEPT,
		IM_COMPANYSEALNUM,
		IM_SADDRESS,
		IM_STEL,
		IM_SBANKNM,
		IM_SBANKNO,
		IM_BADDRESS,
		IM_BTEL,
		IM_BBANKNM,
		IM_BBANKNO,
		IM_DATETIME,
		IM_EDATETIME,
		IM_TOTALAMOUNTOCR,
		IM_PAGER_ELECTRONIC,
		IM_ELECTRONIC_NUMBER
	</sql>

	<!--通过ID获取数据 -->
	<select id="entity_get" resultMap="get-LexmiscivInvoicemainEntity-result">
		select
		<include refid="LexmiscivInvoicemainEntity_Base_Column_List" />
		from LEXMISCIV_INVOICEMAIN where IM_ID = #{IM_ID}
	</select>

	<!-- 查询 采用==查询 -->
	<select id="entity_list_base" resultMap="get-LexmiscivInvoicemainEntity-result" parameterType="com.hzya.frame.plugin.cinvoice.lexmis.entity.LexmiscivInvoicemainEntity">
		select
		<include refid="LexmiscivInvoicemainEntity_Base_Column_List" />
		from LEXMISCIV_INVOICEMAIN
		<trim prefix="where" prefixOverrides="and">
			<if test="IM_ID != null ">IM_ID=#{IM_ID}</if>
			<if test="IM_FPDM != null and IM_FPDM !='' "> and IM_FPDM = #{IM_FPDM}</if>
			<if test="IM_FPHM != null and IM_FPHM !='' "> and IM_FPHM = #{IM_FPHM}</if>
			<if test="IM_DATE != null "> and IM_DATE = #{IM_DATE}</if>
			<if test="IM_CHECKCODE != null and IM_CHECKCODE !='' "> and IM_CHECKCODE = #{IM_CHECKCODE}</if>
			<if test="IM_SALERTAXNO != null and IM_SALERTAXNO !='' "> and IM_SALERTAXNO = #{IM_SALERTAXNO}</if>
			<if test="IM_SALERNAME != null and IM_SALERNAME !='' "> and IM_SALERNAME = #{IM_SALERNAME}</if>
			<if test="IM_SALERADDRESS != null and IM_SALERADDRESS !='' "> and IM_SALERADDRESS = #{IM_SALERADDRESS}</if>
			<if test="IM_SALERBANKNO != null and IM_SALERBANKNO !='' "> and IM_SALERBANKNO = #{IM_SALERBANKNO}</if>
			<if test="IM_SALERBANKNM != null and IM_SALERBANKNM !='' "> and IM_SALERBANKNM = #{IM_SALERBANKNM}</if>
			<if test="IM_BUYERTAXNO != null and IM_BUYERTAXNO !='' "> and IM_BUYERTAXNO = #{IM_BUYERTAXNO}</if>
			<if test="IM_BUYERNAME != null and IM_BUYERNAME !='' "> and IM_BUYERNAME = #{IM_BUYERNAME}</if>
			<if test="IM_BUYERADDRESS != null and IM_BUYERADDRESS !='' "> and IM_BUYERADDRESS = #{IM_BUYERADDRESS}</if>
			<if test="IM_BUYERBANKNO != null and IM_BUYERBANKNO !='' "> and IM_BUYERBANKNO = #{IM_BUYERBANKNO}</if>
			<if test="IM_BUYERBANKNM != null and IM_BUYERBANKNM !='' "> and IM_BUYERBANKNM = #{IM_BUYERBANKNM}</if>
			<if test="IM_MAKERNM != null and IM_MAKERNM !='' "> and IM_MAKERNM = #{IM_MAKERNM}</if>
			<if test="IM_PAYEE != null and IM_PAYEE !='' "> and IM_PAYEE = #{IM_PAYEE}</if>
			<if test="IM_AUDITOR != null and IM_AUDITOR !='' "> and IM_AUDITOR = #{IM_AUDITOR}</if>
			<if test="IM_NOTAXAMOUNT != null "> and IM_NOTAXAMOUNT = #{IM_NOTAXAMOUNT}</if>
			<if test="IM_TAXAMOUNT != null "> and IM_TAXAMOUNT = #{IM_TAXAMOUNT}</if>
			<if test="IM_TOTALAMOUNT != null "> and IM_TOTALAMOUNT = #{IM_TOTALAMOUNT}</if>
			<if test="IM_TAX != null and IM_TAX !='' "> and IM_TAX = #{IM_TAX}</if>
			<if test="IM_MACHINENO != null and IM_MACHINENO !='' "> and IM_MACHINENO = #{IM_MACHINENO}</if>
			<if test="IM_MEMO != null and IM_MEMO !='' "> and IM_MEMO = #{IM_MEMO}</if>
			<if test="IM_ENCRYPTIONCODE != null and IM_ENCRYPTIONCODE !='' "> and IM_ENCRYPTIONCODE = #{IM_ENCRYPTIONCODE}</if>
			<if test="IM_TYPE != null and IM_TYPE !='' "> and IM_TYPE = #{IM_TYPE}</if>
			<if test="IM_TYPENAME != null and IM_TYPENAME !='' "> and IM_TYPENAME = #{IM_TYPENAME}</if>
			<if test="IM_XMMC != null and IM_XMMC !='' "> and IM_XMMC = #{IM_XMMC}</if>
			<if test="IM_KEY != null and IM_KEY !='' "> and IM_KEY = #{IM_KEY}</if>
			<if test="IM_AREACODE != null and IM_AREACODE !='' "> and IM_AREACODE = #{IM_AREACODE}</if>
			<if test="IM_AREANAME != null and IM_AREANAME !='' "> and IM_AREANAME = #{IM_AREANAME}</if>
			<if test="IM_PRINTEDFPDM != null and IM_PRINTEDFPDM !='' "> and IM_PRINTEDFPDM = #{IM_PRINTEDFPDM}</if>
			<if test="IM_PRINTEDFPHM != null and IM_PRINTEDFPHM !='' "> and IM_PRINTEDFPHM = #{IM_PRINTEDFPHM}</if>
			<if test="IM_COUNT != null "> and IM_COUNT = #{IM_COUNT}</if>
			<if test="IM_AGENCY != null "> and IM_AGENCY = #{IM_AGENCY}</if>
			<if test="IM_BLOCKCHAIN != null "> and IM_BLOCKCHAIN = #{IM_BLOCKCHAIN}</if>
			<if test="IM_COMPANYSEAL != null "> and IM_COMPANYSEAL = #{IM_COMPANYSEAL}</if>
			<if test="IM_COMPANYSEALDEPT != null and IM_COMPANYSEALDEPT !='' "> and IM_COMPANYSEALDEPT = #{IM_COMPANYSEALDEPT}</if>
			<if test="IM_COMPANYSEALNUM != null and IM_COMPANYSEALNUM !='' "> and IM_COMPANYSEALNUM = #{IM_COMPANYSEALNUM}</if>
			<if test="IM_SADDRESS != null and IM_SADDRESS !='' "> and IM_SADDRESS = #{IM_SADDRESS}</if>
			<if test="IM_STEL != null and IM_STEL !='' "> and IM_STEL = #{IM_STEL}</if>
			<if test="IM_SBANKNM != null and IM_SBANKNM !='' "> and IM_SBANKNM = #{IM_SBANKNM}</if>
			<if test="IM_SBANKNO != null and IM_SBANKNO !='' "> and IM_SBANKNO = #{IM_SBANKNO}</if>
			<if test="IM_BADDRESS != null and IM_BADDRESS !='' "> and IM_BADDRESS = #{IM_BADDRESS}</if>
			<if test="IM_BTEL != null and IM_BTEL !='' "> and IM_BTEL = #{IM_BTEL}</if>
			<if test="IM_BBANKNM != null and IM_BBANKNM !='' "> and IM_BBANKNM = #{IM_BBANKNM}</if>
			<if test="IM_BBANKNO != null and IM_BBANKNO !='' "> and IM_BBANKNO = #{IM_BBANKNO}</if>
			<if test="IM_DATETIME != null and IM_DATETIME !='' "> and IM_DATETIME = #{IM_DATETIME}</if>
			<if test="IM_EDATETIME != null and IM_EDATETIME !='' "> and IM_EDATETIME = #{IM_EDATETIME}</if>
			<if test="IM_TOTALAMOUNTOCR != null "> and IM_TOTALAMOUNTOCR = #{IM_TOTALAMOUNTOCR}</if>
			<if test="IM_PAGER_ELECTRONIC != null "> and IM_PAGER_ELECTRONIC = #{IM_PAGER_ELECTRONIC}</if>
			<if test="IM_ELECTRONIC_NUMBER != null and IM_ELECTRONIC_NUMBER !='' "> and IM_ELECTRONIC_NUMBER = #{IM_ELECTRONIC_NUMBER}</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>

	<!-- 查询符合条件的数量 -->
	<select id="LexmiscivInvoicemainEntity_count" resultType="Integer" parameterType="com.hzya.frame.plugin.cinvoice.lexmis.entity.LexmiscivInvoicemainEntity">
		select count(1) from LEXMISCIV_INVOICEMAIN
		<trim prefix="where" prefixOverrides="and">
			<if test="IM_ID != null ">IM_ID = #{IM_ID}</if>
			<if test="IM_FPDM != null and IM_FPDM !='' "> and IM_FPDM = #{IM_FPDM} </if>
			<if test="IM_FPHM != null and IM_FPHM !='' "> and IM_FPHM = #{IM_FPHM} </if>
			<if test="IM_DATE != null "> and IM_DATE = #{IM_DATE}  </if>
			<if test="IM_CHECKCODE != null and IM_CHECKCODE !='' "> and IM_CHECKCODE = #{IM_CHECKCODE} </if>
			<if test="IM_SALERTAXNO != null and IM_SALERTAXNO !='' "> and IM_SALERTAXNO = #{IM_SALERTAXNO} </if>
			<if test="IM_SALERNAME != null and IM_SALERNAME !='' "> and IM_SALERNAME = #{IM_SALERNAME} </if>
			<if test="IM_SALERADDRESS != null and IM_SALERADDRESS !='' "> and IM_SALERADDRESS = #{IM_SALERADDRESS} </if>
			<if test="IM_SALERBANKNO != null and IM_SALERBANKNO !='' "> and IM_SALERBANKNO = #{IM_SALERBANKNO} </if>
			<if test="IM_SALERBANKNM != null and IM_SALERBANKNM !='' "> and IM_SALERBANKNM = #{IM_SALERBANKNM} </if>
			<if test="IM_BUYERTAXNO != null and IM_BUYERTAXNO !='' "> and IM_BUYERTAXNO = #{IM_BUYERTAXNO} </if>
			<if test="IM_BUYERNAME != null and IM_BUYERNAME !='' "> and IM_BUYERNAME = #{IM_BUYERNAME} </if>
			<if test="IM_BUYERADDRESS != null and IM_BUYERADDRESS !='' "> and IM_BUYERADDRESS = #{IM_BUYERADDRESS} </if>
			<if test="IM_BUYERBANKNO != null and IM_BUYERBANKNO !='' "> and IM_BUYERBANKNO = #{IM_BUYERBANKNO} </if>
			<if test="IM_BUYERBANKNM != null and IM_BUYERBANKNM !='' "> and IM_BUYERBANKNM = #{IM_BUYERBANKNM} </if>
			<if test="IM_MAKERNM != null and IM_MAKERNM !='' "> and IM_MAKERNM = #{IM_MAKERNM} </if>
			<if test="IM_PAYEE != null and IM_PAYEE !='' "> and IM_PAYEE = #{IM_PAYEE} </if>
			<if test="IM_AUDITOR != null and IM_AUDITOR !='' "> and IM_AUDITOR = #{IM_AUDITOR} </if>
			<if test="IM_NOTAXAMOUNT != null "> and IM_NOTAXAMOUNT = #{IM_NOTAXAMOUNT}  </if>
			<if test="IM_TAXAMOUNT != null "> and IM_TAXAMOUNT = #{IM_TAXAMOUNT}  </if>
			<if test="IM_TOTALAMOUNT != null "> and IM_TOTALAMOUNT = #{IM_TOTALAMOUNT}  </if>
			<if test="IM_TAX != null and IM_TAX !='' "> and IM_TAX = #{IM_TAX} </if>
			<if test="IM_MACHINENO != null and IM_MACHINENO !='' "> and IM_MACHINENO = #{IM_MACHINENO} </if>
			<if test="IM_MEMO != null and IM_MEMO !='' "> and IM_MEMO = #{IM_MEMO} </if>
			<if test="IM_ENCRYPTIONCODE != null and IM_ENCRYPTIONCODE !='' "> and IM_ENCRYPTIONCODE = #{IM_ENCRYPTIONCODE} </if>
			<if test="IM_TYPE != null and IM_TYPE !='' "> and IM_TYPE = #{IM_TYPE} </if>
			<if test="IM_TYPENAME != null and IM_TYPENAME !='' "> and IM_TYPENAME = #{IM_TYPENAME} </if>
			<if test="IM_XMMC != null and IM_XMMC !='' "> and IM_XMMC = #{IM_XMMC} </if>
			<if test="IM_KEY != null and IM_KEY !='' "> and IM_KEY = #{IM_KEY} </if>
			<if test="IM_AREACODE != null and IM_AREACODE !='' "> and IM_AREACODE = #{IM_AREACODE} </if>
			<if test="IM_AREANAME != null and IM_AREANAME !='' "> and IM_AREANAME = #{IM_AREANAME} </if>
			<if test="IM_PRINTEDFPDM != null and IM_PRINTEDFPDM !='' "> and IM_PRINTEDFPDM = #{IM_PRINTEDFPDM} </if>
			<if test="IM_PRINTEDFPHM != null and IM_PRINTEDFPHM !='' "> and IM_PRINTEDFPHM = #{IM_PRINTEDFPHM} </if>
			<if test="IM_COUNT != null "> and IM_COUNT = #{IM_COUNT}  </if>
			<if test="IM_AGENCY != null "> and IM_AGENCY = #{IM_AGENCY}  </if>
			<if test="IM_BLOCKCHAIN != null "> and IM_BLOCKCHAIN = #{IM_BLOCKCHAIN}  </if>
			<if test="IM_COMPANYSEAL != null "> and IM_COMPANYSEAL = #{IM_COMPANYSEAL}  </if>
			<if test="IM_COMPANYSEALDEPT != null and IM_COMPANYSEALDEPT !='' "> and IM_COMPANYSEALDEPT = #{IM_COMPANYSEALDEPT} </if>
			<if test="IM_COMPANYSEALNUM != null and IM_COMPANYSEALNUM !='' "> and IM_COMPANYSEALNUM = #{IM_COMPANYSEALNUM} </if>
			<if test="IM_SADDRESS != null and IM_SADDRESS !='' "> and IM_SADDRESS = #{IM_SADDRESS} </if>
			<if test="IM_STEL != null and IM_STEL !='' "> and IM_STEL = #{IM_STEL} </if>
			<if test="IM_SBANKNM != null and IM_SBANKNM !='' "> and IM_SBANKNM = #{IM_SBANKNM} </if>
			<if test="IM_SBANKNO != null and IM_SBANKNO !='' "> and IM_SBANKNO = #{IM_SBANKNO} </if>
			<if test="IM_BADDRESS != null and IM_BADDRESS !='' "> and IM_BADDRESS = #{IM_BADDRESS} </if>
			<if test="IM_BTEL != null and IM_BTEL !='' "> and IM_BTEL = #{IM_BTEL} </if>
			<if test="IM_BBANKNM != null and IM_BBANKNM !='' "> and IM_BBANKNM = #{IM_BBANKNM} </if>
			<if test="IM_BBANKNO != null and IM_BBANKNO !='' "> and IM_BBANKNO = #{IM_BBANKNO} </if>
			<if test="IM_DATETIME != null and IM_DATETIME !='' "> and IM_DATETIME = #{IM_DATETIME} </if>
			<if test="IM_EDATETIME != null and IM_EDATETIME !='' "> and IM_EDATETIME = #{IM_EDATETIME} </if>
			<if test="IM_TOTALAMOUNTOCR != null "> and IM_TOTALAMOUNTOCR = #{IM_TOTALAMOUNTOCR}  </if>
			<if test="IM_PAGER_ELECTRONIC != null "> and IM_PAGER_ELECTRONIC = #{IM_PAGER_ELECTRONIC}  </if>
			<if test="IM_ELECTRONIC_NUMBER != null and IM_ELECTRONIC_NUMBER !='' "> and IM_ELECTRONIC_NUMBER = #{IM_ELECTRONIC_NUMBER} </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="LexmiscivInvoicemainEntity_list_like" resultMap="get-LexmiscivInvoicemainEntity-result" parameterType="com.hzya.frame.plugin.cinvoice.lexmis.entity.LexmiscivInvoicemainEntity">
		select
		<include refid="LexmiscivInvoicemainEntity_Base_Column_List" />
		from LEXMISCIV_INVOICEMAIN
		<trim prefix="where" prefixOverrides="and">
			<if test="IM_ID != null ">IM_ID = #{IM_ID}</if>
			<if test="IM_FPDM != null and IM_FPDM !='' "> and IM_FPDM like concat('%',#{IM_FPDM},'%') </if>
			<if test="IM_FPHM != null and IM_FPHM !='' "> and IM_FPHM like concat('%',#{IM_FPHM},'%') </if>
			<if test="IM_DATE != null and IM_DATE !='' "> and IM_DATE like concat('%',#{IM_DATE},'%') </if>
			<if test="IM_CHECKCODE != null and IM_CHECKCODE !='' "> and IM_CHECKCODE like concat('%',#{IM_CHECKCODE},'%') </if>
			<if test="IM_SALERTAXNO != null and IM_SALERTAXNO !='' "> and IM_SALERTAXNO like concat('%',#{IM_SALERTAXNO},'%') </if>
			<if test="IM_SALERNAME != null and IM_SALERNAME !='' "> and IM_SALERNAME like concat('%',#{IM_SALERNAME},'%') </if>
			<if test="IM_SALERADDRESS != null and IM_SALERADDRESS !='' "> and IM_SALERADDRESS like concat('%',#{IM_SALERADDRESS},'%') </if>
			<if test="IM_SALERBANKNO != null and IM_SALERBANKNO !='' "> and IM_SALERBANKNO like concat('%',#{IM_SALERBANKNO},'%') </if>
			<if test="IM_SALERBANKNM != null and IM_SALERBANKNM !='' "> and IM_SALERBANKNM like concat('%',#{IM_SALERBANKNM},'%') </if>
			<if test="IM_BUYERTAXNO != null and IM_BUYERTAXNO !='' "> and IM_BUYERTAXNO like concat('%',#{IM_BUYERTAXNO},'%') </if>
			<if test="IM_BUYERNAME != null and IM_BUYERNAME !='' "> and IM_BUYERNAME like concat('%',#{IM_BUYERNAME},'%') </if>
			<if test="IM_BUYERADDRESS != null and IM_BUYERADDRESS !='' "> and IM_BUYERADDRESS like concat('%',#{IM_BUYERADDRESS},'%') </if>
			<if test="IM_BUYERBANKNO != null and IM_BUYERBANKNO !='' "> and IM_BUYERBANKNO like concat('%',#{IM_BUYERBANKNO},'%') </if>
			<if test="IM_BUYERBANKNM != null and IM_BUYERBANKNM !='' "> and IM_BUYERBANKNM like concat('%',#{IM_BUYERBANKNM},'%') </if>
			<if test="IM_MAKERNM != null and IM_MAKERNM !='' "> and IM_MAKERNM like concat('%',#{IM_MAKERNM},'%') </if>
			<if test="IM_PAYEE != null and IM_PAYEE !='' "> and IM_PAYEE like concat('%',#{IM_PAYEE},'%') </if>
			<if test="IM_AUDITOR != null and IM_AUDITOR !='' "> and IM_AUDITOR like concat('%',#{IM_AUDITOR},'%') </if>
			<if test="IM_NOTAXAMOUNT != null "> and IM_NOTAXAMOUNT = #{IM_NOTAXAMOUNT}</if>
			<if test="IM_TAXAMOUNT != null "> and IM_TAXAMOUNT = #{IM_TAXAMOUNT}</if>
			<if test="IM_TOTALAMOUNT != null "> and IM_TOTALAMOUNT = #{IM_TOTALAMOUNT}</if>
			<if test="IM_TAX != null and IM_TAX !='' "> and IM_TAX like concat('%',#{IM_TAX},'%') </if>
			<if test="IM_MACHINENO != null and IM_MACHINENO !='' "> and IM_MACHINENO like concat('%',#{IM_MACHINENO},'%') </if>
			<if test="IM_MEMO != null and IM_MEMO !='' "> and IM_MEMO like concat('%',#{IM_MEMO},'%') </if>
			<if test="IM_ENCRYPTIONCODE != null and IM_ENCRYPTIONCODE !='' "> and IM_ENCRYPTIONCODE like concat('%',#{IM_ENCRYPTIONCODE},'%') </if>
			<if test="IM_TYPE != null and IM_TYPE !='' "> and IM_TYPE like concat('%',#{IM_TYPE},'%') </if>
			<if test="IM_TYPENAME != null and IM_TYPENAME !='' "> and IM_TYPENAME like concat('%',#{IM_TYPENAME},'%') </if>
			<if test="IM_XMMC != null and IM_XMMC !='' "> and IM_XMMC like concat('%',#{IM_XMMC},'%') </if>
			<if test="IM_KEY != null and IM_KEY !='' "> and IM_KEY like concat('%',#{IM_KEY},'%') </if>
			<if test="IM_AREACODE != null and IM_AREACODE !='' "> and IM_AREACODE like concat('%',#{IM_AREACODE},'%') </if>
			<if test="IM_AREANAME != null and IM_AREANAME !='' "> and IM_AREANAME like concat('%',#{IM_AREANAME},'%') </if>
			<if test="IM_PRINTEDFPDM != null and IM_PRINTEDFPDM !='' "> and IM_PRINTEDFPDM like concat('%',#{IM_PRINTEDFPDM},'%') </if>
			<if test="IM_PRINTEDFPHM != null and IM_PRINTEDFPHM !='' "> and IM_PRINTEDFPHM like concat('%',#{IM_PRINTEDFPHM},'%') </if>
			<if test="IM_COUNT != null "> and IM_COUNT = #{IM_COUNT}</if>
			<if test="IM_AGENCY != null "> and IM_AGENCY = #{IM_AGENCY}</if>
			<if test="IM_BLOCKCHAIN != null "> and IM_BLOCKCHAIN = #{IM_BLOCKCHAIN}</if>
			<if test="IM_COMPANYSEAL != null "> and IM_COMPANYSEAL = #{IM_COMPANYSEAL}</if>
			<if test="IM_COMPANYSEALDEPT != null and IM_COMPANYSEALDEPT !='' "> and IM_COMPANYSEALDEPT like concat('%',#{IM_COMPANYSEALDEPT},'%') </if>
			<if test="IM_COMPANYSEALNUM != null and IM_COMPANYSEALNUM !='' "> and IM_COMPANYSEALNUM like concat('%',#{IM_COMPANYSEALNUM},'%') </if>
			<if test="IM_SADDRESS != null and IM_SADDRESS !='' "> and IM_SADDRESS like concat('%',#{IM_SADDRESS},'%') </if>
			<if test="IM_STEL != null and IM_STEL !='' "> and IM_STEL like concat('%',#{IM_STEL},'%') </if>
			<if test="IM_SBANKNM != null and IM_SBANKNM !='' "> and IM_SBANKNM like concat('%',#{IM_SBANKNM},'%') </if>
			<if test="IM_SBANKNO != null and IM_SBANKNO !='' "> and IM_SBANKNO like concat('%',#{IM_SBANKNO},'%') </if>
			<if test="IM_BADDRESS != null and IM_BADDRESS !='' "> and IM_BADDRESS like concat('%',#{IM_BADDRESS},'%') </if>
			<if test="IM_BTEL != null and IM_BTEL !='' "> and IM_BTEL like concat('%',#{IM_BTEL},'%') </if>
			<if test="IM_BBANKNM != null and IM_BBANKNM !='' "> and IM_BBANKNM like concat('%',#{IM_BBANKNM},'%') </if>
			<if test="IM_BBANKNO != null and IM_BBANKNO !='' "> and IM_BBANKNO like concat('%',#{IM_BBANKNO},'%') </if>
			<if test="IM_DATETIME != null and IM_DATETIME !='' "> and IM_DATETIME like concat('%',#{IM_DATETIME},'%') </if>
			<if test="IM_EDATETIME != null and IM_EDATETIME !='' "> and IM_EDATETIME like concat('%',#{IM_EDATETIME},'%') </if>
			<if test="IM_TOTALAMOUNTOCR != null "> and IM_TOTALAMOUNTOCR = #{IM_TOTALAMOUNTOCR}</if>
			<if test="IM_PAGER_ELECTRONIC != null "> and IM_PAGER_ELECTRONIC = #{IM_PAGER_ELECTRONIC}</if>
			<if test="IM_ELECTRONIC_NUMBER != null and IM_ELECTRONIC_NUMBER !='' "> and IM_ELECTRONIC_NUMBER like concat('%',#{IM_ELECTRONIC_NUMBER},'%') </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="entity_list_or" resultMap="get-LexmiscivInvoicemainEntity-result" parameterType="com.hzya.frame.plugin.cinvoice.lexmis.entity.LexmiscivInvoicemainEntity">
		select
		<include refid="LexmiscivInvoicemainEntity_Base_Column_List" />
		from LEXMISCIV_INVOICEMAIN
		<trim prefix="where" prefixOverrides="or">
			<if test="IM_ID != null ">IM_ID = #{IM_ID}</if>
			<if test="IM_FPDM != null and IM_FPDM !='' "> or IM_FPDM = #{IM_FPDM} </if>
			<if test="IM_FPHM != null and IM_FPHM !='' "> or IM_FPHM = #{IM_FPHM} </if>
			<if test="IM_DATE != null and IM_DATE !='' "> or IM_DATE = #{IM_DATE} </if>
			<if test="IM_CHECKCODE != null and IM_CHECKCODE !='' "> or IM_CHECKCODE = #{IM_CHECKCODE} </if>
			<if test="IM_SALERTAXNO != null and IM_SALERTAXNO !='' "> or IM_SALERTAXNO = #{IM_SALERTAXNO} </if>
			<if test="IM_SALERNAME != null and IM_SALERNAME !='' "> or IM_SALERNAME = #{IM_SALERNAME} </if>
			<if test="IM_SALERADDRESS != null and IM_SALERADDRESS !='' "> or IM_SALERADDRESS = #{IM_SALERADDRESS} </if>
			<if test="IM_SALERBANKNO != null and IM_SALERBANKNO !='' "> or IM_SALERBANKNO = #{IM_SALERBANKNO} </if>
			<if test="IM_SALERBANKNM != null and IM_SALERBANKNM !='' "> or IM_SALERBANKNM = #{IM_SALERBANKNM} </if>
			<if test="IM_BUYERTAXNO != null and IM_BUYERTAXNO !='' "> or IM_BUYERTAXNO = #{IM_BUYERTAXNO} </if>
			<if test="IM_BUYERNAME != null and IM_BUYERNAME !='' "> or IM_BUYERNAME = #{IM_BUYERNAME} </if>
			<if test="IM_BUYERADDRESS != null and IM_BUYERADDRESS !='' "> or IM_BUYERADDRESS = #{IM_BUYERADDRESS} </if>
			<if test="IM_BUYERBANKNO != null and IM_BUYERBANKNO !='' "> or IM_BUYERBANKNO = #{IM_BUYERBANKNO} </if>
			<if test="IM_BUYERBANKNM != null and IM_BUYERBANKNM !='' "> or IM_BUYERBANKNM = #{IM_BUYERBANKNM} </if>
			<if test="IM_MAKERNM != null and IM_MAKERNM !='' "> or IM_MAKERNM = #{IM_MAKERNM} </if>
			<if test="IM_PAYEE != null and IM_PAYEE !='' "> or IM_PAYEE = #{IM_PAYEE} </if>
			<if test="IM_AUDITOR != null and IM_AUDITOR !='' "> or IM_AUDITOR = #{IM_AUDITOR} </if>
			<if test="IM_NOTAXAMOUNT != null "> or IM_NOTAXAMOUNT = #{IM_NOTAXAMOUNT}</if>
			<if test="IM_TAXAMOUNT != null "> or IM_TAXAMOUNT = #{IM_TAXAMOUNT}</if>
			<if test="IM_TOTALAMOUNT != null "> or IM_TOTALAMOUNT = #{IM_TOTALAMOUNT}</if>
			<if test="IM_TAX != null and IM_TAX !='' "> or IM_TAX = #{IM_TAX} </if>
			<if test="IM_MACHINENO != null and IM_MACHINENO !='' "> or IM_MACHINENO = #{IM_MACHINENO} </if>
			<if test="IM_MEMO != null and IM_MEMO !='' "> or IM_MEMO = #{IM_MEMO} </if>
			<if test="IM_ENCRYPTIONCODE != null and IM_ENCRYPTIONCODE !='' "> or IM_ENCRYPTIONCODE = #{IM_ENCRYPTIONCODE} </if>
			<if test="IM_TYPE != null and IM_TYPE !='' "> or IM_TYPE = #{IM_TYPE} </if>
			<if test="IM_TYPENAME != null and IM_TYPENAME !='' "> or IM_TYPENAME = #{IM_TYPENAME} </if>
			<if test="IM_XMMC != null and IM_XMMC !='' "> or IM_XMMC = #{IM_XMMC} </if>
			<if test="IM_KEY != null and IM_KEY !='' "> or IM_KEY = #{IM_KEY} </if>
			<if test="IM_AREACODE != null and IM_AREACODE !='' "> or IM_AREACODE = #{IM_AREACODE} </if>
			<if test="IM_AREANAME != null and IM_AREANAME !='' "> or IM_AREANAME = #{IM_AREANAME} </if>
			<if test="IM_PRINTEDFPDM != null and IM_PRINTEDFPDM !='' "> or IM_PRINTEDFPDM = #{IM_PRINTEDFPDM} </if>
			<if test="IM_PRINTEDFPHM != null and IM_PRINTEDFPHM !='' "> or IM_PRINTEDFPHM = #{IM_PRINTEDFPHM} </if>
			<if test="IM_COUNT != null "> or IM_COUNT = #{IM_COUNT}</if>
			<if test="IM_AGENCY != null "> or IM_AGENCY = #{IM_AGENCY}</if>
			<if test="IM_BLOCKCHAIN != null "> or IM_BLOCKCHAIN = #{IM_BLOCKCHAIN}</if>
			<if test="IM_COMPANYSEAL != null "> or IM_COMPANYSEAL = #{IM_COMPANYSEAL}</if>
			<if test="IM_COMPANYSEALDEPT != null and IM_COMPANYSEALDEPT !='' "> or IM_COMPANYSEALDEPT = #{IM_COMPANYSEALDEPT} </if>
			<if test="IM_COMPANYSEALNUM != null and IM_COMPANYSEALNUM !='' "> or IM_COMPANYSEALNUM = #{IM_COMPANYSEALNUM} </if>
			<if test="IM_SADDRESS != null and IM_SADDRESS !='' "> or IM_SADDRESS = #{IM_SADDRESS} </if>
			<if test="IM_STEL != null and IM_STEL !='' "> or IM_STEL = #{IM_STEL} </if>
			<if test="IM_SBANKNM != null and IM_SBANKNM !='' "> or IM_SBANKNM = #{IM_SBANKNM} </if>
			<if test="IM_SBANKNO != null and IM_SBANKNO !='' "> or IM_SBANKNO = #{IM_SBANKNO} </if>
			<if test="IM_BADDRESS != null and IM_BADDRESS !='' "> or IM_BADDRESS = #{IM_BADDRESS} </if>
			<if test="IM_BTEL != null and IM_BTEL !='' "> or IM_BTEL = #{IM_BTEL} </if>
			<if test="IM_BBANKNM != null and IM_BBANKNM !='' "> or IM_BBANKNM = #{IM_BBANKNM} </if>
			<if test="IM_BBANKNO != null and IM_BBANKNO !='' "> or IM_BBANKNO = #{IM_BBANKNO} </if>
			<if test="IM_DATETIME != null and IM_DATETIME !='' "> or IM_DATETIME = #{IM_DATETIME} </if>
			<if test="IM_EDATETIME != null and IM_EDATETIME !='' "> or IM_EDATETIME = #{IM_EDATETIME} </if>
			<if test="IM_TOTALAMOUNTOCR != null "> or IM_TOTALAMOUNTOCR = #{IM_TOTALAMOUNTOCR}</if>
			<if test="IM_PAGER_ELECTRONIC != null "> or IM_PAGER_ELECTRONIC = #{IM_PAGER_ELECTRONIC}</if>
			<if test="IM_ELECTRONIC_NUMBER != null and IM_ELECTRONIC_NUMBER !='' "> or IM_ELECTRONIC_NUMBER = #{IM_ELECTRONIC_NUMBER} </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>
