|  |  | @ -19,8 +19,43 @@ | 
			
		
	
		
			
				
					|  |  |  |         <result property="updatedBy" column="UPDATED_BY"/> | 
			
		
	
		
			
				
					|  |  |  |         <result property="updatedTime" column="UPDATED_TIME"/> | 
			
		
	
		
			
				
					|  |  |  |     </resultMap> | 
			
		
	
		
			
				
					|  |  |  |     <select id="selectDemandOptions" resultType="com.epmet.commons.tools.dto.result.OptionResultDTO"> </select> | 
			
		
	
		
			
				
					|  |  |  |     <select id="selectChildDemands" resultType="com.epmet.commons.tools.dto.result.OptionResultDTO"> </select> | 
			
		
	
		
			
				
					|  |  |  |     <resultMap id="DemandResult" type="com.epmet.commons.tools.dto.result.OptionResultDTO"> | 
			
		
	
		
			
				
					|  |  |  |         <result column="customerId"/> | 
			
		
	
		
			
				
					|  |  |  |         <result column="value"  property="value"/> | 
			
		
	
		
			
				
					|  |  |  |         <result column="label" property="label"/> | 
			
		
	
		
			
				
					|  |  |  |         <collection property="children" ofType="com.epmet.commons.tools.dto.result.OptionResultDTO" | 
			
		
	
		
			
				
					|  |  |  |                     select="selectChildDemands" column="customerId=customerId,parentCode=value"> | 
			
		
	
		
			
				
					|  |  |  |         </collection> | 
			
		
	
		
			
				
					|  |  |  |     </resultMap> | 
			
		
	
		
			
				
					|  |  |  |     <select id="selectDemandOptions" resultMap="DemandResult"> | 
			
		
	
		
			
				
					|  |  |  |         SELECT | 
			
		
	
		
			
				
					|  |  |  |             CUSTOMER_ID AS customerId, | 
			
		
	
		
			
				
					|  |  |  |             CATEGORY_CODE AS "value", | 
			
		
	
		
			
				
					|  |  |  |             CATEGORY_NAME AS "label" | 
			
		
	
		
			
				
					|  |  |  |         FROM | 
			
		
	
		
			
				
					|  |  |  |             ic_resi_demand_dict | 
			
		
	
		
			
				
					|  |  |  |         WHERE | 
			
		
	
		
			
				
					|  |  |  |             DEL_FLAG = 0 | 
			
		
	
		
			
				
					|  |  |  |             AND LEVEL = 1 | 
			
		
	
		
			
				
					|  |  |  |             AND CUSTOMER_ID = #{customerId} | 
			
		
	
		
			
				
					|  |  |  |         ORDER BY | 
			
		
	
		
			
				
					|  |  |  |             SORT ASC | 
			
		
	
		
			
				
					|  |  |  |     </select> | 
			
		
	
		
			
				
					|  |  |  |     <select id="selectChildDemands" resultMap="DemandResult"> | 
			
		
	
		
			
				
					|  |  |  |         SELECT | 
			
		
	
		
			
				
					|  |  |  |             CUSTOMER_ID AS customerId, | 
			
		
	
		
			
				
					|  |  |  |             CATEGORY_CODE AS "value", | 
			
		
	
		
			
				
					|  |  |  |             CATEGORY_NAME AS "label" | 
			
		
	
		
			
				
					|  |  |  |         FROM | 
			
		
	
		
			
				
					|  |  |  |             ic_resi_demand_dict | 
			
		
	
		
			
				
					|  |  |  |         WHERE | 
			
		
	
		
			
				
					|  |  |  |             DEL_FLAG = 0 | 
			
		
	
		
			
				
					|  |  |  |             AND LEVEL = 2 | 
			
		
	
		
			
				
					|  |  |  |             AND CUSTOMER_ID = #{customerId} | 
			
		
	
		
			
				
					|  |  |  |             AND PARENT_CODE = #{parentCode} | 
			
		
	
		
			
				
					|  |  |  |         ORDER BY | 
			
		
	
		
			
				
					|  |  |  |             SORT ASC | 
			
		
	
		
			
				
					|  |  |  |     </select> | 
			
		
	
		
			
				
					|  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  | </mapper> |