ソースを参照

修改类型111

liujiankang 7 年 前
コミット
deb575c104

+ 23 - 5
iamberry-common-core/src/main/java/com/iamberry/wechat/core/entity/product/ProductFittings.java

@@ -11,7 +11,9 @@ public class ProductFittings implements java.io.Serializable {
     private static final long serialVersionUID = -5278198298126095215L;
 
     private Integer fittingsId;         //id
-    private Integer productId;          //产品id
+    private Integer productColorId;          //产品颜色id
+    private Integer productChildType;          //产品子类型
+    private String fittingsColor;          //配件颜色
     private String fittingsName;        //配件名称
     private Integer fittingsPrice;      //配件市场价
     private Integer fittingsDiscount;   //配件折扣价
@@ -29,12 +31,28 @@ public class ProductFittings implements java.io.Serializable {
         this.fittingsId = fittingsId;
     }
 
-    public Integer getProductId() {
-        return productId;
+    public Integer getProductColorId() {
+        return productColorId;
     }
 
-    public void setProductId(Integer productId) {
-        this.productId = productId;
+    public void setProductColorId(Integer productColorId) {
+        this.productColorId = productColorId;
+    }
+
+    public Integer getProductChildType() {
+        return productChildType;
+    }
+
+    public void setProductChildType(Integer productChildType) {
+        this.productChildType = productChildType;
+    }
+
+    public String getFittingsColor() {
+        return fittingsColor;
+    }
+
+    public void setFittingsColor(String fittingsColor) {
+        this.fittingsColor = fittingsColor;
     }
 
     public String getFittingsName() {

+ 32 - 23
iamberry-wechat-service/src/main/java/com/iamberry/wechat/service/mapper/productMapper.xml

@@ -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>

+ 6 - 6
iamberry-wechat-service/src/main/java/com/iamberry/wechat/service/mapper/rewardsMapper.xml

@@ -77,10 +77,10 @@ PUBLIC
 	<select id="selectRewardsList" resultType="RewardsRank">
 		SELECT 
 			<include refid="allRewardsField"></include>,
-			TYPE_ID "productType.typeId",
-			TYPE_NAME "productType.typeName"	
+			child_type_id "productType.typeId",
+			child_type_name "productType.typeName"
 		FROM TB_IAMBERRY_MEMBER_RANK
-		JOIN TB_IAMBERRY_PRODUCT_TYPE ON RANK_PRODUCT_TYPE = TYPE_ID
+		JOIN tb_iamberry_product_child_type ON RANK_PRODUCT_TYPE = child_type_id
 	</select>
 	<!-- 【添加一个分销奖励规则】 -->
 	<insert id="insertRewardsRank" parameterType="RewardsRank"
@@ -94,10 +94,10 @@ PUBLIC
 	<select id="selectRewardsRankById" parameterType="Integer" resultType="RewardsRank">
 		SELECT 
 			<include refid="allRewardsField"></include>,
-			TYPE_ID "productType.typeId",
-			TYPE_NAME "productType.typeName"	
+			child_type_id "productType.typeId",
+			child_type_name "productType.typeName"
 		FROM TB_IAMBERRY_MEMBER_RANK
-		JOIN TB_IAMBERRY_PRODUCT_TYPE ON RANK_PRODUCT_TYPE = TYPE_ID
+		JOIN tb_iamberry_product_child_type ON RANK_PRODUCT_TYPE = child_type_id
 		WHERE RANK_ID = #{rankId}
 	</select>
 	

+ 3 - 3
iamberry-wechat-service/src/main/java/com/iamberry/wechat/service/mapper/taskMapper.xml

@@ -5,13 +5,13 @@
 	<!-- 获取某一页的数据 -->
 	<select id="getAll" parameterType="PaperBean" resultType="WechatTask">
 		SELECT
-			t.*, type.TYPE_NAME "productType.typeName"
+			t.*, type.child_type_name "productType.typeName"
 		FROM
 			TB_IAMBERRY_MEMBER_TASK t
 		LEFT JOIN
-			TB_IAMBERRY_PRODUCT_TYPE type
+			tb_iamberry_product_child_type type
 		ON
-			type.TYPE_ID = t.TASK_PRODUCT_TYPE
+			type.child_type_id = t.TASK_PRODUCT_TYPE
 		LIMIT
 			#{minNum}, #{maxNum}
 	</select>