<?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="io.renren.modules.sys.dao.SysUserPlantDao">

    <delete id="deleteBatch">
        delete from sys_user_plant where plant_id in
        <foreach item="roleId" collection="array" open="(" separator="," close=")">
            #{plantId}
        </foreach>
    </delete>

    <select id="queryPlantNameList" resultType="String">
        select p.name from SYS_PLANT p
         LEFT JOIN sys_user_plant u on p.plant_id = u.plant_id
          where u.user_id = #{value}
    </select>

    <select id="queryPlantIdList" resultType="long">
        select plant_id from sys_user_plant where user_id = #{value}
    </select>

</mapper>
