<?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.ruoyi.web.work.mapper.UserMapper">
    
    <select id="selectList" resultType="com.ruoyi.web.work.domain.User">
        select * from tb_user
        <where>  
            <if test="openId != null  and openId != ''"> and open_id = #{openId}</if>
            <if test="name != null  and name != ''"> and name like concat('%', #{name}, '%')</if>
            <if test="avatar != null  and avatar != ''"> and avatar = #{avatar}</if>
            <if test="state != null "> and state = #{state}</if>
        </where>
    </select>

    <select id="selectByOpenId" resultType="com.ruoyi.web.work.domain.User">
        SELECT * FROM tb_user WHERE open_id=#{openId}
    </select>

</mapper>