<?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.SupplierMapper">
	<!--查询供应商列表  带条件账号查询  -->
	<select id="querySupplier"  resultType="com.fuzamei.entity.User">
	   select user_id,username,person_name,create_time,update_time from users  where role_id = 2
	<if test="username!=null and username!='' ">
	   and username=#{username}
	</if>

	</select>
	<!--点击查看  根据供应商id（用户id）  查询所有得所属计划员  -->
	<select id="queryPlannerBySupplierId"  parameterType="int"  resultType="com.fuzamei.entity.User">
		select person_name from users  where user_id in(select planner_id from planner_supplier where supplier_id=#{supplierId})
	</select>
	
	
</mapper>