<?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.jeeplus.modules.ruralprojectrecords.dao.RuralProjectClientLinkmanDao">

	<insert id="batchInsert" parameterType="java.util.Map">
		INSERT INTO project_client_linkman
		(project_id ,linkman_id, client_id, is_entrust)
		VALUES
		<foreach collection="linkmanList" item="linkman" separator=",">
			( #{projectId}, #{linkman.id}, #{linkman.clientId.id}, #{isEntrust})
		</foreach>
	</insert>

	<delete id="deleteProjectLinkmans">
		DELETE FROM project_client_linkman
		WHERE project_id = #{projectId}
		AND is_entrust = #{isEntrust}
	</delete>

	<select id="getLinkManByNameAndOffice" parameterType="WorkClientLinkman" resultType="WorkClientLinkman">
		select *
		from project_client_linkman
		where name = #{name} and office = #{office}
	</select>
</mapper>