<?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="io.renren.modules.app.dao.WxxmxxDao">

    <!-- 可根据自己的需求，是否要使用 -->
    <resultMap type="io.renren.modules.app.entity.WxxmxxEntity" id="wxxmxxMap">
                    <result property="id" column="id"/>
                    <result property="wxxmbm" column="wxxmbm"/>
                    <result property="wxxmmc" column="wxxmmc"/>
                    <result property="bz" column="bz"/>
                    <result property="gzdbm" column="gzdbm"/>
            </resultMap>

    <select id="queryByPage" parameterType="io.renren.modules.app.entity.WxxmxxEntity"
            resultType="io.renren.modules.app.entity.WxxmxxEntity">

        select * from wxxmxx where 1=1

                    <if test=" id!=null and id!='' ">
                and id like CONCAT(#{id},"%")
            </if>
                    <if test=" wxxmbm!=null and wxxmbm!='' ">
                and wxxmbm like CONCAT(#{wxxmbm},"%")
            </if>
                    <if test=" wxxmmc!=null and wxxmmc!='' ">
                and wxxmmc like CONCAT(#{wxxmmc},"%")
            </if>
                    <if test=" bz!=null and bz!='' ">
                and bz like CONCAT(#{bz},"%")
            </if>
                    <if test=" gzdbm!=null and gzdbm!='' ">
                and gzdbm like CONCAT(#{gzdbm},"%")
            </if>
        order by wxxmbm desc
    </select>

     <select id="querywxxmbm"  resultType="string">
    SELECT wxxmbm FROM wxxmxx WHERE LENGTH(wxxmbm)>=8 ORDER BY wxxmbm  DESC LIMIT 1
    </select>

</mapper>