<?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.neusoft.smart.pos.org.persistent.mapper.ManageableGroupMapper">
    <resultMap id="BaseResultMap" type="com.neusoft.smart.pos.org.dto.User">
        <id column="id" jdbcType="INTEGER" property="id"/>
        <result column="username" jdbcType="VARCHAR" property="username"/>
        <result column="password" jdbcType="VARCHAR" property="password"/>
        <result column="role" jdbcType="VARCHAR" property="role"/>
        <result column="org" jdbcType="INTEGER" property="org"/>

    </resultMap>
    <select id="selectByUserExample" parameterType="com.neusoft.smart.pos.org.persistent.domain.UserExample"  resultMap="BaseResultMap">
        select id,username,password,role,org FROM user_info where org in (SELECT entity_table_id  from organization_group WHERE id ='11')

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


</mapper>