<?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.WxMsgValidationcodeMapper">
	<resultMap id="BaseResultMap" type="com.iformall.domain.po.WxMsgValidationcode">
		<id column="id" jdbcType="INTEGER" property="id" />
		<result column="phone" jdbcType="VARCHAR" property="phone" />
		<result column="expiretime" jdbcType="TIMESTAMP" property="expiretime" />
		<result column="createtime" jdbcType="TIMESTAMP" property="createtime" />
		<result column="type" jdbcType="INTEGER" property="type" />
		<result column="tenant_id" jdbcType="VARCHAR" property="tenantId" />
		<result column="msg" jdbcType="VARCHAR" property="msg" />
		<result column="signature" jdbcType="VARCHAR" property="signature" />
		<result column="code" jdbcType="VARCHAR" property="code" />
		<result column="appid" jdbcType="VARCHAR" property="appid" />

	</resultMap>
	
	<sql id="allColumns">
	    `id`,`phone`,`expiretime`,`createtime`,`type`,`tenant_id`,`msg`,`signature`,`code`,`appid`
	</sql>

	<sql id="dynamicWhereConditions">
	        where 1 = 1
		<if test=" null != id "> and `id` = #{id} </if>    
		<if test=" null != phone "> and `phone` = #{phone} </if>
		<if test=" null != expiretime ">and `expiretime` = #{expiretime}</if>
		<if test=" null != createtime ">and `createtime` = #{createtime}</if>
		<if test=" null != type "> and `type` = #{type} </if>    
		<if test=" null != tenantId "> and `tenant_id` = #{tenantId} </if>    
		<if test=" null != msg "> and `msg` = #{msg} </if>
		<if test=" null != signature ">and `signature` = #{signature}</if>
		<if test=" null != code ">and `code` = #{code}</if>
		<if test=" null != createtimeStr ">and date_format(`createtime`,'%Y-%m-%d') = #{createtimeStr}</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.WxMsgValidationcode" resultMap="BaseResultMap">
		select <include refid="allColumns" /> from wx_msg_validationcode
		<include refid="dynamicWhereConditions" />
	</select>
	
	
	
	
	
	
</mapper>
