<?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="cn.reghao.tnb.sb.multi.mybatis.mapper.three.UserAccountMapper">
    <update id="updateScreenName">
        update user_account
        set screen_name=#{screenName}
        where user_id=#{userId}
    </update>

    <select id="findAll" resultType="cn.reghao.tnb.sb.multi.mybatis.model.three.UserAccount">
        select user_id,count(user_id) as total
        from user_account
        where user_id &lt; 20001
    </select>
    <select id="findUserAccount" resultType="cn.reghao.tnb.sb.multi.mybatis.model.three.UserAccount">
        select *
        from user_account
        where user_id=#{id}
    </select>
    <select id="findExist" resultType="cn.reghao.tnb.sb.multi.mybatis.model.three.UserAccount">
        select user_id,screen_name
        from user_account
        where user_id > 11020 and user_id &lt;= 11100 and screen_name not like 'tnb\_%'
    </select>
    <select id="findNonExist" resultType="cn.reghao.tnb.sb.multi.mybatis.model.three.UserAccount">
        select *
        from user_account
        where user_id > 11100 and user_id &lt;= 20000 and screen_name like 'tnb\_%'
        limit #{pageSize}
    </select>
</mapper>