Browse Source

发布二手商品sql

chao 4 years ago
parent
commit
ca0b84205d

+ 1 - 1
src/main/java/com/caimei365/commodity/service/impl/SecondHandServiceImpl.java

@@ -306,7 +306,7 @@ public class SecondHandServiceImpl implements SecondHandService {
         product.setOnlineTime(date);
         product.setOfflineTime(date);
         /* 保存商品表 */
-        secondHandMapper.insertProduct22222222222(product);
+        secondHandMapper.insertProduct(product);
         /* 保存商品图片信息*/
         for (int i = 0; i < images.length; i++) {
             ProductImagePo imagePo = new ProductImagePo();

+ 23 - 65
src/main/resources/mapper/SecondHandMapper.xml

@@ -2,70 +2,17 @@
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="com.caimei365.commodity.mapper.SecondHandMapper">
     <insert id="saveSencondHandProduct" parameterType="com.caimei365.commodity.model.po.ProductSecondPo" keyProperty="id" useGeneratedKeys="true">
-        INSERT INTO cm_second_hand_detail(
-			productID,
-			sold,
-			secondHandType,
-			instrumentType,
-			fixedYears,
-			maturityYears,
-			companyName,
-			detailTalkFlag,
-			originalPrice,
-			contactName,
-			contactMobile,
-			dockingPeopleName,
-			dockingPeopleMobile,
-			secondProductType,
-			townId,
-			brandName,
-			provinceCityDistrict,
-			address,
-			productQuality,
-			productDetails,
-			viewingNum,
-			payStatus,
-			payAmount,
-			payFormData,
-			payType,
-			payDate,
-			submitDate,
-			reviewedDate,
-			onLineDate,
-			source,
-			publisher
-		) VALUES (
-			#{productID},
-			#{sold},
-			#{secondHandType},
-			#{instrumentType},
-			#{fixedYears},
-			#{maturityYears},
-			#{companyName},
-			#{detailTalkFlag},
-			#{originalPrice},
-			#{contactName},
-			#{contactMobile},
-			#{dockingPeopleName},
-			#{dockingPeopleMobile},
-			#{secondProductType},
-			#{townId},
-			#{brandName},
-			#{provinceCityDistrict},
-			#{address},
-			#{productQuality},
-			#{productDetails},
-			#{viewingNum},
-			#{payStatus},
-			#{payAmount},
-			#{payFormData},
-			#{payType},
-			#{payDate},
-			#{submitDate},
-			#{reviewedDate},
-			#{onLineDate},
-			#{source},
-			#{publisher}
+        insert into cm_second_hand_detail(
+			productID, sold, secondHandType, instrumentType, fixedYears, maturityYears, companyName, detailTalkFlag,
+			originalPrice, contactName, contactMobile, dockingPeopleName, dockingPeopleMobile, secondProductType,
+			townId, brandName, provinceCityDistrict, address, productQuality, productDetails, viewingNum, payStatus,
+			payAmount, payFormData, payType, payDate, submitDate, reviewedDate, onLineDate, source, publisher
+		) values (
+			#{productID}, #{sold}, #{secondHandType}, #{instrumentType}, #{fixedYears}, #{maturityYears}, #{companyName},
+			#{detailTalkFlag}, #{originalPrice}, #{contactName}, #{contactMobile}, #{dockingPeopleName}, #{dockingPeopleMobile},
+			#{secondProductType}, #{townId}, #{brandName}, #{provinceCityDistrict}, #{address}, #{productQuality}, #{productDetails},
+			#{viewingNum}, #{payStatus}, #{payAmount}, #{payFormData}, #{payType}, #{payDate}, #{submitDate}, #{reviewedDate},
+			#{onLineDate}, #{source}, #{publisher}
 		)
     </insert>
     <insert id="insertProductImage" parameterType="com.caimei365.commodity.model.po.ProductImagePo">
@@ -73,7 +20,18 @@
         values (#{productId}, #{shopId}, #{addTime}, #{image}, #{mainFlag}, #{sortIndex})
     </insert>
     <insert id="insertProduct" keyColumn="productID" keyProperty="productId" parameterType="com.caimei365.commodity.model.po.ProductPo" useGeneratedKeys="true">
-
+        insert into product (
+            brandId, name, price, stock, aliasName, normalPrice, mainImage, productCategory, preferredFlag, shopId,
+            sellNumber, costPrice, costCheckFlag, hasSkuFlag, validFlag, ladderPriceFlag, sortIndex, featuredFlag, byFlag,
+            step, actFlag, actStatus, freePostFlag, productType, machineType, includedTax, recommendType, invoiceType,
+            visibility, addTime, updateTime, onlineTime, downlineTime
+        ) values (
+            #{brandId}, #{name}, #{price}, #{stock}, #{aliasName}, #{normalPrice}, #{mainImage}, #{productCategory},
+            #{preferredFlag}, #{shopId}, #{sellNumber}, #{costPrice}, #{costCheckFlag}, #{hasSkuFlag}, #{validFlag},
+            #{ladderPriceFlag}, #{sortIndex}, #{featuredFlag}, #{byFlag}, #{step}, #{actFlag}, #{actStatus},
+            #{freePostFlag}, #{productType}, #{machineType}, #{includedTax}, #{recommendType}, #{invoiceType},
+            #{visibility}, #{addTime}, #{updateTime}, #{onlineTime}, #{offlineTime}
+        )
     </insert>
     <select id="getSeconHandList" resultType="com.caimei365.commodity.model.vo.SecondListVo">
         select