| 
					
				 | 
			
			
				@@ -29,6 +29,15 @@ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 		TYPE_UPDATE_DATE typeUpdateDate, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 		TYPE_STATE typeState 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 	</sql> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+	<sql id="allChildTypeField"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+		child_type_id typeId, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+		child_type_name typeName, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+		child_type_detilas typeDetilas, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+		child_type_create_date typeCreateDate, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+		child_type_update_date typeUpdateDate, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+		child_type_state typeState 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+	</sql> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 	<!-- 商品模糊查询 --> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 	<select id="getProductByFuzzy" parameterType="String" resultType="product"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 		select 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -46,10 +55,10 @@ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 	<select id="selectAllProductInfo" resultType="product" parameterType="product"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 		SELECT 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 			<include refid="allField"></include>, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-			TYPE_ID "productType.typeId", 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-			TYPE_NAME "productType.typeName" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+			child_type_id "productType.typeId", 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+			child_type_name "productType.typeName" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 		FROM TB_IAMBERRY_PRODUCT_INFO  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-		JOIN TB_IAMBERRY_PRODUCT_TYPE ON PRODUCT_TYPE = TYPE_ID 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+		JOIN tb_iamberry_product_child_type ON tb_iamberry_product_child_type.child_type_id = TB_IAMBERRY_PRODUCT_INFO.product_child_type 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 		<where> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 			<if test="productName != null and productName != ''"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 				PRODUCT_NAME LIKE CONCAT('%',#{productName},'%') 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -80,10 +89,10 @@ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 	<select id="selectProductByProductId" resultType="product" parameterType="int"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 		SELECT  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 			<include refid="allField"></include>, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-			TYPE_ID "productType.typeId", 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-			TYPE_NAME "productType.typeName"	 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+			child_type_id "productType.typeId", 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+			child_type_name "productType.typeName" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 		FROM TB_IAMBERRY_PRODUCT_INFO 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-		JOIN TB_IAMBERRY_PRODUCT_TYPE ON PRODUCT_TYPE = TYPE_ID 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+		JOIN tb_iamberry_product_child_type ON tb_iamberry_product_child_type.child_type_id = TB_IAMBERRY_PRODUCT_INFO.product_child_type 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 		WHERE PRODUCT_ID=#{productId} 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 	</select> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 	 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -204,46 +213,46 @@ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 	<!-- 						【产品返利类型】							 --> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 	<select id="getAll" resultType="ProductType"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 		SELECT 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-			<include refid="allTypeField"></include> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+			<include refid="allChildTypeField"></include> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 		FROM 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-			TB_IAMBERRY_PRODUCT_TYPE 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+		tb_iamberry_product_child_type 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 	</select> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 	<!-- 						【根据id查询一个产品返利类型】							 --> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 	<select id="selectOneById" parameterType="Integer" resultType="ProductType"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 		SELECT 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-			<include refid="allTypeField"></include> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+			<include refid="allChildTypeField"></include> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 		FROM 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-			TB_IAMBERRY_PRODUCT_TYPE 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-		WHERE TYPE_ID = #{typeId} 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+		tb_iamberry_product_child_type 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+		WHERE child_type_id = #{typeId} 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 	</select> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 	 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 	<!-- 						【添加产品返利类型】							 --> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 	<insert id="insertProductType" parameterType="ProductType"  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 		useGeneratedKeys="true" keyProperty="typeId"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-		INSERT INTO TB_IAMBERRY_PRODUCT_TYPE  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-			(TYPE_NAME ,TYPE_DETILAS ,TYPE_CREATE_DATE ,TYPE_UPDATE_DATE ,TYPE_STATE)  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+		INSERT INTO tb_iamberry_product_child_type 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+			(child_type_name ,child_type_detilas ,child_type_create_date ,child_type_update_date ,child_type_state) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 		values 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 			(#{typeName},#{typeDetilas},#{typeCreateDate},#{typeUpdateDate},#{typeState}) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 	</insert> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 	 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 	<!-- 						【根据类型id修改一个产品返利类型】							 --> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 	<update id="updateProductTypeById" parameterType="ProductType"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-		UPDATE TB_IAMBERRY_PRODUCT_TYPE 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-		SET  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-			TYPE_UPDATE_DATE = NOW(), 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+		UPDATE tb_iamberry_product_child_type 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+		SET 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+		child_type_update_date = NOW(), 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 		<if test="typeName != null and typeName != ''"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-			TYPE_NAME = #{typeName}, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+			child_type_name = #{typeName}, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 		</if> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 		<if test="typeDetilas != null and typeDetilas != ''"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-			TYPE_DETILAS = #{typeDetilas} 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+			child_type_detilas = #{typeDetilas} 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 		</if> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-		WHERE TYPE_ID = #{typeId} 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+		WHERE child_type_id = #{typeId} 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 	</update> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 	 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 	<update id="updateProductTypeStatusById" parameterType="ProductType"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-		UPDATE TB_IAMBERRY_PRODUCT_TYPE 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-		SET TYPE_STATE = #{typeState},  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-			TYPE_UPDATE_DATE = NOW() 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-		WHERE TYPE_ID = #{typeId} 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+		UPDATE tb_iamberry_product_child_type 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+		SET child_type_state = #{typeState}, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+			child_type_update_date = NOW() 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+		WHERE child_type_id = #{typeId} 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 	</update> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 </mapper> 
			 |