<?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.WxProfitSharingReceiverMapper">
	<resultMap id="BaseResultMap" type="com.iformall.domain.po.WxProfitSharingReceiver">
		<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="receiver_type" jdbcType="INTEGER" property="receiverType" />
		<result column="receiver_account" jdbcType="VARCHAR" property="receiverAccount" />
		<result column="receiver_comments" jdbcType="VARCHAR" property="receiverComments" />
		<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
		<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
		<result column="sharing_type" jdbcType="INTEGER" property="sharingType" />
		<result column="bank_no" jdbcType="VARCHAR" property="bankNo" />
		<result column="true_name" jdbcType="VARCHAR" property="trueName" />
		<result column="bank_code" jdbcType="VARCHAR" property="bankCode" />
		<result column="status" jdbcType="INTEGER" property="status" />
		<result column="parameter" jdbcType="VARCHAR" property="parameter" />
	</resultMap>
	
	<sql id="allColumns">
	    `id`,`tenant_id`,`merchant_id`,`receiver_type`,`receiver_account`,`receiver_comments`,`create_time`,`update_time`,`sharing_type`,`bank_no`,`true_name`,`bank_code`,`status`,`parameter`
	</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 != receiverType "> 
		and `receiver_type` = #{receiverType} 
       	
		</if>    
	    
		<if test=" null != receiverAccount "> 
		and `receiver_account`  like concat('%', #{receiverAccount},'%')
       	
		</if>    
	    
		<if test=" null != receiverComments "> 
		and `receiver_comments`  like concat('%', #{receiverComments},'%')
       	
		</if>    
	    
		<if test=" null != createTime "> 
		and `create_time` = #{createTime} 
       	
		</if>    
	    
		<if test=" null != updateTime "> 
		and `update_time` = #{updateTime} 
       	
		</if>    
	    
		<if test=" null != sharingType "> 
		and `sharing_type` = #{sharingType} 
       	
		</if>    
	    
		<if test=" null != bankNo "> 
		and `bank_no`  like concat('%', #{bankNo},'%')
       	
		</if>    
	    
		<if test=" null != trueName "> 
		and `true_name`  like concat('%', #{trueName},'%')
       	
		</if>    
	    
		<if test=" null != bankCode "> 
		and `bank_code`  like concat('%', #{bankCode},'%')
       	
		</if>

		<if test=" null != status ">
		and `status` = #{status}

		</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.WxProfitSharingReceiver" resultMap="BaseResultMap">
		select <include refid="allColumns" /> from wx_profit_sharing_receiver
		<include refid="dynamicWhereConditions" />
	</select>
	
	
	
	
	
	
</mapper>
