<?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.advise.AfAdviseResponsiblerMapper">
	<!-- 通用查询映射结果 -->
	<resultMap id="BaseResultMap"
		type="cn.com.countrygarden.bi.main.model.advise.AfAdviseResponsibler">
		<id column="id" property="id" />
		<result column="type" property="type" />
		<result column="advise_type_id" property="adviseTypeId" />
		<result column="user_code" property="userCode" />
		<result column="user_name" property="userName" />
		<result column="enable" property="enable" />
		<result column="create_time" property="createTime" />
		<result column="create_by" property="createBy" />
		<result column="update_time" property="updateTime" />
		<result column="update_by" property="updateBy" />
		<result column="branch_type_code" property="branchTypeCode" />
	</resultMap>
   <select id="selectAdviseResponsiblerDTOAll"  parameterType="String" resultType="cn.com.countrygarden.bi.main.dto.advise.AdviseResponsiblerDTO">

	   select DISTINCT id id,type type,advise_type_id adviseTypeId from af_advise_responsibler
       where enable=1

         <if test="null!=userCode and userCode!=''">
			and user_code=#{userCode}
		 </if>
	   <if test="null!=branchTypeCode and branchTypeCode!=''">
		   and branch_type_code=#{branchTypeCode}
	   </if>
   </select>

</mapper>