<?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.fuzamei.mapperInterface.ReceivingClerkMapper">
	<!--仓库收货员列表，带（账号）条件查询  -->
	<select id="queryReceivingClerk"  resultType="com.fuzamei.entity.User">
	  select user_id,username,person_name,create_time,update_time from users  where role_id = 4
	  <if test="username!=null and username!='' ">
	    and username=#{username}
	  </if>
	</select>
	
	<!-- 根据用户id的  查询角色  test-->
	<select id="selectRoleByUserId"  resultType="String">
	  select role_name from role where role_id  in (select role_id from users where user_id=#{user_id})
	 <!--  select r.role_name from   users y left  join  role r on r.role_id=y.role_id  where user_id=1003 -->
	</select>
</mapper>