<?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.iformall.mapper.WxMerchantTaxMapper">
	<resultMap id="BaseResultMap" type="com.iformall.domain.po.WxMerchantTax">
		<id column="id" jdbcType="BIGINT" property="id" />
		<result column="tenant_id" jdbcType="VARCHAR" property="tenantId" />
		<result column="merchant_id" jdbcType="BIGINT" property="merchantId" />
		<result column="taxpayer_type" jdbcType="INTEGER" property="taxpayerType" />
		<result column="tax_papers_type" jdbcType="INTEGER" property="taxPapersType" />
		<result column="tax_papers_number" jdbcType="VARCHAR" property="taxPapersNumber" />
		<result column="invoice_type" jdbcType="INTEGER" property="invoiceType" />
		<result column="invoice_buyer" jdbcType="VARCHAR" property="invoiceBuyer" />
		<result column="taxpayer_identify_number" jdbcType="VARCHAR" property="taxpayerIdentifyNumber" />
		<result column="invoice_address_phone" jdbcType="VARCHAR" property="invoiceAddressPhone" />
		<result column="bank_account_number" jdbcType="VARCHAR" property="bankAccountNumber" />
		<result column="bank_account_person" jdbcType="VARCHAR" property="bankAccountPerson" />
		<result column="bank_name" jdbcType="VARCHAR" property="bankName" />
		<result column="bank_account" jdbcType="VARCHAR" property="bankAccount" />
		<result column="create_date" jdbcType="TIMESTAMP" property="createDate" />
		<result column="update_date" jdbcType="TIMESTAMP" property="updateDate" />
	</resultMap>
	
	<sql id="allColumns">
	    `id`,`tenant_id`,`merchant_id`,`taxpayer_type`,`tax_papers_type`,`tax_papers_number`,`invoice_type`,`invoice_buyer`,`taxpayer_identify_number`,`invoice_address_phone`,`bank_account_number`,`bank_account_person`,`bank_name`,`bank_account`,`create_date`,`update_date` 
	</sql>

	<sql id="dynamicWhereConditions">
	        where 1 = 1
		<if test=" null != id "> and `id` = #{id} </if>    
		<if test=" null != tenantId "> and `tenant_id` = #{tenantId} </if>    
		<if test=" null != merchantId "> and `merchant_id` = #{merchantId} </if>    
		<if test=" null != taxpayerType "> and `taxpayer_type` = #{taxpayerType} </if>    
		<if test=" null != taxPapersType "> and `tax_papers_type` = #{taxPapersType} </if>    
		<if test=" null != taxPapersNumber "> and `tax_papers_number` = #{taxPapersNumber} </if>    
		<if test=" null != invoiceType "> and `invoice_type` = #{invoiceType} </if>    
		<if test=" null != invoiceBuyer "> and `invoice_buyer` = #{invoiceBuyer} </if>    
		<if test=" null != taxpayerIdentifyNumber "> and `taxpayer_identify_number` = #{taxpayerIdentifyNumber} </if>    
		<if test=" null != invoiceAddressPhone "> and `invoice_address_phone` = #{invoiceAddressPhone} </if>    
		<if test=" null != bankAccountNumber "> and `bank_account_number` = #{bankAccountNumber} </if>    
		<if test=" null != bankAccountPerson "> and `bank_account_person` = #{bankAccountPerson} </if>    
		<if test=" null != bankName "> and `bank_name` = #{bankName} </if>    
		<if test=" null != bankAccount "> and `bank_account` = #{bankAccount} </if>    
		<if test=" null != createDate "> and `create_date` = #{createDate} </if>    
		<if test=" null != updateDate "> and `update_date` = #{updateDate} </if>    
		<if test=" null != ids ">
		 	and id in  
			<foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")">
			#{idItem}
			</foreach>
		</if>		
		<if test=" null != sortColumns"> order by ${sortColumns} </if>
	</sql>
	
	<select id="findList" parameterType="com.iformall.domain.po.WxMerchantTax" resultMap="BaseResultMap">
		select <include refid="allColumns" /> from wx_merchant_tax
		<include refid="dynamicWhereConditions" />
	</select>
	
	
	
	
	
	
</mapper>
