<?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.WxMsgConfigMapper">
	<resultMap id="BaseResultMap" type="com.iformall.domain.po.WxMsgConfig">
		<id column="id" jdbcType="BIGINT" property="id" />
		<result column="tenant_id" jdbcType="VARCHAR" property="tenantId" />
		<result column="secret" jdbcType="VARCHAR" property="secret" />
		<result column="publickey" jdbcType="VARCHAR" property="publickey" />
		<result column="bid" jdbcType="VARCHAR" property="bid" />
		<result column="recharge" jdbcType="BIGINT" property="recharge" />
		<result column="remains" jdbcType="BIGINT" property="remains" />
		<result column="total" jdbcType="BIGINT" property="total" />
		<result column="account" jdbcType="VARCHAR" property="account" />
		<result column="reminderstatus" jdbcType="INTEGER" property="reminderstatus" />
		<result column="reminder" jdbcType="BIGINT" property="reminder" />
		<result column="phone" jdbcType="VARCHAR" property="phone" />
		<result column="notifyurl" jdbcType="VARCHAR" property="notifyurl" />
		<result column="modelnotifyurl" jdbcType="VARCHAR" property="modelnotifyurl" />
		<result column="verifynotifyurl" jdbcType="VARCHAR" property="verifynotifyurl" />
		<result column="appid" jdbcType="VARCHAR" property="appid" />


	</resultMap>
	
	<sql id="allColumns">
	    `id`,`tenant_id`,`secret`,`publickey`,`bid`,`recharge`,`remains`,`total`,`account`,`reminderstatus`,`reminder`,`phone`,`notifyurl`,`modelnotifyurl`,`verifynotifyurl`,`appid`
	</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 != secret "> 
		and `secret`  like concat('%', #{secret},'%')
       	
		</if>    
	    
		<if test=" null != publickey "> 
		and `publickey`  like concat('%', #{publickey},'%')
       	
		</if>    
	    
		<if test=" null != bid "> 
		and `bid` = #{bid}
       	
		</if>    
	    
		<if test=" null != recharge "> 
		and `recharge` = #{recharge} 
       	
		</if>    
	    
		<if test=" null != remains "> 
		and `remains` = #{remains} 
       	
		</if>    
	    
		<if test=" null != total "> 
		and `total` = #{total} 
       	
		</if>    
	    
		<if test=" null != account "> 
		and `account`  like concat('%', #{account},'%')
       	
		</if>    
	    
		<if test=" null != reminderstatus "> 
		and `reminderstatus` = #{reminderstatus} 
       	
		</if>    
	    
		<if test=" null != reminder "> 
		and `reminder` = #{reminder} 
       	
		</if>    
	    
		<if test=" null != phone "> 
		and `phone`  like concat('%', #{phone},'%')
       	
		</if>    
	    
		<if test=" null != notifyurl "> 
		and `notifyurl`  like concat('%', #{notifyurl},'%')
       	
		</if>

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

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