<?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="cn.com.countrygarden.bi.main.dao.wcx.WcxRegionProjectRelMapper">
	
    <update id="updateProjectNameByPropertyProjectName" parameterType="cn.com.countrygarden.bi.main.model.wcx.WcxRegionProjectRel">
    	UPDATE wcx_region_project_rel
    	SET project_name=#{projectName}
    	WHERE property_project_name=#{propertyProjectName}
    </update>
    <select id="selectByPropertyProjectName" resultType="cn.com.countrygarden.bi.main.model.wcx.WcxRegionProjectRel">
    	SELECT region_name regionName,project_name projectName,property_project_name propertyProjectName
    	FROM wcx_region_project_rel
    	WHERE property_project_name = #{propertyProjectName}
    </select>
	<select id="selectByPropertyCommsName" resultType="java.lang.String">
    	SELECT property_project_name propertyProjectName
    	FROM wcx_region_project_rel
    	WHERE project_name IN
		<foreach collection="commsName" index="index" item="item" open="(" separator="," close=")">
			#{item}
		</foreach>
    </select>
	<update id="updatePropertyProjectNameForNull">
    	UPDATE wcx_region_project_rel
    	SET project_name=''
    	WHERE project_name=#{projectName}
    </update>

	<select id="selectCommByErpComm" resultType="cn.com.countrygarden.bi.main.dto.ManagerMapOrganTreeDTO">
		SELECT property_project_name name
		FROM wcx_region_project_rel
		WHERE project_name IN
		<foreach collection="commsName" index="index" item="item" open="(" separator="," close=")">
			#{item}
		</foreach>
	</select>
</mapper>
