<?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.WxTagsGroupMapper">
    <resultMap id="BaseResultMap" type="com.iformall.domain.po.WxTagsGroup">
        <id column="id" jdbcType="BIGINT" property="id"/>
        <result column="name" jdbcType="VARCHAR" property="name"/>
    </resultMap>

    <sql id="allColumns">
	    `id`,`name`
	</sql>

    <sql id="dynamicWhereConditions">
        where 1 = 1

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

        <if test=" null != name ">
            and `name` = #{name}
        </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.WxTagsGroup" resultMap="BaseResultMap">
        select
        <include refid="allColumns"/>
        from wx_tags_group
        <include refid="dynamicWhereConditions"/>
    </select>


</mapper>
