a.id AS "id",
a.productID AS "productID",
a.sold AS "sold",
a.secondHandType AS "secondHandType",
a.instrumentType AS "instrumentType",
a.fixedYears AS "fixedYears",
a.maturityYears AS "maturityYears",
a.companyName AS "companyName",
a.detailTalkFlag AS "detailTalkFlag",
a.originalPrice AS "originalPrice",
a.contactName AS "contactName",
a.contactMobile AS "contactMobile",
a.dockingPeopleName AS "dockingPeopleName",
a.dockingPeopleMobile AS "dockingPeopleMobile",
a.secondProductType AS "secondProductType",
a.provinceCityDistrict AS "provinceCityDistrict",
a.townId as "townId",
a.address AS "address",
a.productQuality AS "productQuality",
a.productDetails AS "productDetails",
a.viewingNum AS "viewingNum",
a.brandName AS "brandName",
a.payStatus AS "payStatus",
a.payAmount AS "payAmount",
a.payFormData AS "payFormData",
a.payType AS "payType",
a.payDate AS "payDate",
a.submitDate AS "submitDate",
a.reviewedDate AS "reviewedDate",
a.onLineDate AS "onLineDate",
a.source AS "source",
a.showContactFlag AS "showContactFlag",
a.publisher AS "publisher",
a.authenticationImage AS "authenticationImage",
a.fileName AS "fileName",
a.ossName AS "ossName",
a.commitmentImage AS "commitmentImage",
p.validFlag AS "validFlag",
p.productCategory AS "productCategory",
p.name AS "name",
p.normalPrice AS "normalPrice",
p.price1 AS "price1",
p.stock AS "stock",
p.brandID AS "brandID",
p.costPrice as "costPrice",
p.costCheckFlag AS "costCheckFlag",
p.costProportional AS "costProportional",
p.visibility AS "visibility"
left join product p on p.productID = a.productID
INSERT INTO cm_second_hand_detail(
productID,
sold,
secondHandType,
instrumentType,
fixedYears,
maturityYears,
companyName,
detailTalkFlag,
originalPrice,
contactName,
contactMobile,
dockingPeopleName,
dockingPeopleMobile,
secondProductType,
provinceCityDistrict,
townId,
address,
productQuality,
productDetails,
viewingNum,
brandName,
payStatus,
payAmount,
payFormData,
payType,
payDate,
submitDate,
reviewedDate,
onLineDate,
source,
showContactFlag,
publisher,
authenticationImage,
fileName,
ossName,
commitmentImage
) VALUES (
#{productID},
#{sold},
#{secondHandType},
#{instrumentType},
#{fixedYears},
#{maturityYears},
#{companyName},
#{detailTalkFlag},
#{originalPrice},
#{contactName},
#{contactMobile},
#{dockingPeopleName},
#{dockingPeopleMobile},
#{secondProductType},
#{provinceCityDistrict},
#{townId},
#{address},
#{productQuality},
#{productDetails},
#{viewingNum},
#{brandName},
#{payStatus},
#{payAmount},
#{payFormData},
#{payType},
#{payDate},
#{submitDate},
#{reviewedDate},
#{onLineDate},
#{source},
#{showContactFlag},
#{publisher},
#{authenticationImage},
#{fileName},
#{ossName},
#{commitmentImage}
)
UPDATE cm_second_hand_detail SET
productID = #{productID},
sold = #{sold},
secondHandType = #{secondHandType},
instrumentType = #{instrumentType},
fixedYears = #{fixedYears},
maturityYears = #{maturityYears},
companyName = #{companyName},
detailTalkFlag = #{detailTalkFlag},
originalPrice = #{originalPrice},
contactName = #{contactName},
contactMobile = #{contactMobile},
dockingPeopleName = #{dockingPeopleName},
dockingPeopleMobile = #{dockingPeopleMobile},
secondProductType = #{secondProductType},
provinceCityDistrict = #{provinceCityDistrict},
townId = #{townId},
address = #{address},
productQuality = #{productQuality},
productDetails = #{productDetails},
viewingNum = #{viewingNum},
brandName = #{brandName},
payStatus = #{payStatus},
payAmount = #{payAmount},
payFormData = #{payFormData},
payType = #{payType},
payDate = #{payDate},
submitDate = #{submitDate},
reviewedDate = #{reviewedDate},
onLineDate = #{onLineDate},
source = #{source},
showContactFlag = #{showContactFlag},
publisher = #{publisher},
authenticationImage = #{authenticationImage},
fileName = #{fileName},
ossName = #{ossName},
commitmentImage = #{commitmentImage}
WHERE productID = #{productID}
UPDATE cm_second_hand_detail SET
reviewedDate = #{reviewedDate},
onLineDate = #{onLineDate}
WHERE productID = #{productID}
UPDATE cm_second_hand_detail SET
onLineDate = #{date}
WHERE productID = #{productID}
UPDATE cm_second_hand_detail SET sold = 1 where productID = #{productID}
DELETE FROM cm_second_hand_detail
WHERE productID = #{productID}
UPDATE cm_second_hand_detail SET sold = 0 WHERE productID = #{productID}