123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770 |
- <?xml version="1.0" encoding="UTF-8" ?>
- <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
- <mapper namespace="com.caimei.modules.product.dao.ProductNewDao">
- <resultMap id="productModelResultMap" type="com.caimei.modules.product.entity.Product">
- <id property="id" column="id"/>
- <result property="name" column="name"/>
- </resultMap>
- <sql id="productColumns">
- a.productID AS "id",
- a.productID AS "productID",
- a.brandID AS "brandID",
- ifnull(a.bigTypeID,0) AS "bigTypeID",
- ifnull(a.smallTypeID,0) AS "smallTypeID",
- ifnull(a.tinyTypeID,0) AS "tinyTypeID",
- a.productCategory AS "productCategory",
- a.selfTypeID AS "selfTypeID",
- a.preferredFlag AS "preferredFlag",
- a.shopID AS "shopID",
- a.name AS "name",
- a.searchKey AS "searchKey",
- a.combinationID AS "combinationID",
- a.productRemarks AS "productRemarks",
- a.normalPrice AS "normalPrice",
- a.price AS "price",
- a.priceFlag AS "priceFlag",
- a.beautyActFlag AS "beautyActFlag",
- a.ladderPriceFlag AS "ladderPriceFlag",
- a.stock AS "stock",
- a.hasSkuFlag AS "hasSkuFlag",
- a.mainImage AS "mainImage",
- a.propertiesInfo AS "propertiesInfo",
- a.addTime AS "addTime",
- a.updateTime AS "updateTime",
- a.sellNumber AS "sellNumber",
- a.weekSellNumber AS "weekSellNumber",
- a.beforeValidFlag AS "beforeValidFlag",
- a.validFlag AS "validFlag",
- a.favoriteTimes AS "favoriteTimes",
- a.commentScore AS "commentScore",
- a.commentTimes AS "commentTimes",
- a.selfRecommendFlag AS "selfRecommendFlag",
- a.sysRecommendFlag AS "sysRecommendFlag",
- a.sortIndex AS "sortIndex",
- a.featuredFlag AS "featuredFlag",
- a.featuredSortIndex AS "featuredSortIndex",
- a.productCode AS "productCode",
- a.unit AS "unit",
- a.synToERPFlag AS "synToERPFlag",
- a.allAreaFlag AS "allAreaFlag",
- a.provinceIDs AS "provinceIDs",
- a.serviceNumber AS "serviceNumber",
- a.maxBuyNumber AS "maxBuyNumber",
- a.minBuyNumber AS "minBuyNumber",
- a.packageCount AS "packageCount",
- a.byFlag AS "byFlag",
- a.normalProductFlag AS "normalProductFlag",
- a.wholeSaleProductFlag AS "wholeSaleProductFlag",
- a.promotionProductFlag AS "promotionProductFlag",
- a.groupBuyProductFlag AS "groupBuyProductFlag",
- a.step AS "step",
- a.actStatus AS "actStatus",
- a.actFlag AS "actFlag",
- a.actType AS "actType",
- a.onlineTime AS "onlineTime",
- a.downlineTime AS "downlineTime",
- a.freePostFlag AS "freePostFlag",
- a.costPrice AS "costPrice",
- a.costProportional AS "costProportional",
- a.costCheckFlag AS "costCheckFlag",
- a.precisehKey AS "precisehKey",
- s.name AS "shopName",
- a.actSort AS "actSort",
- a.recommendType AS "recommendType",
- a.aliasName as "aliasName",
- a.visibility as "visibility",
- a.productType as "productType",
- a.qualificationImg as "qualificationImg",
- a.includedTax as "includedTax",
- a.invoiceType as "invoiceType",
- a.taxPoint as "taxPoint",
- a.supplierTaxPoint as "supplierTaxPoint",
- a.tags as "tags",
- a.machineType as "machineType",
- a.commodityType as "commodityType",
- a.trainingMethod as "trainingMethod",
- a.trainingType as "trainingType",
- a.trainingFee as "trainingFee",
- a.splitCode as "splitCode",
- a.productDescribe as "productDescribe",
- cshd.secondHandType as "secondHandType",
- cshd.instrumentType as "instrumentType",
- cshd.sold as "sold",
- cshd.payStatus as "payStatus",
- cshd.contactName as "contactName",
- cshd.originalPrice as "originalPrice",
- cshd.submitDate AS "submitDate",
- cshd.reviewedDate AS "reviewedDate",
- cshd.onLineDate AS "onLineDate",
- cshd.brandName AS "otherBrandName",
- cshd.publisher AS "publisher",
- cshd.source AS "source",
- cshd.dockingPeopleName AS "dockingPeopleName",
- cb.name as "brandName",
- if(csp.id is not null,1,0) as "svipFlag",
- cshd.companyName as "companyName",
- cshd.publishIdentity as "publishIdentity"
- </sql>
- <sql id="productJoins">
- LEFT JOIN shop s ON s.shopID = a.shopID
- LEFT JOIN cm_second_hand_detail cshd ON cshd.productID = a.productID
- LEFT JOIN cm_brand cb ON a.brandID = cb.id
- LEFT JOIN cm_svip_product csp on a.productID = csp.productId
- </sql>
- <sql id="ActivityJoins">
- LEFT JOIN shop s on s.shopID = a.shopID
- INNER JOIN tinytype AS b ON a.`tinyTypeID` = b.`tinyTypeID`
- INNER JOIN smalltype AS c ON b.`smallTypeID` = c.`smallTypeID`
- INNER JOIN bigtype AS d ON c.`bigTypeID` = d.`bigTypeID`
- </sql>
- <select id="get" resultType="Product">
- SELECT
- <include refid="productColumns"/>
- FROM product a
- <include refid="productJoins"/>
- WHERE a.productID = #{id}
- </select>
- <select id="getProductParams" resultType="com.caimei.modules.product.entity.ProductParameters">
- select * from cm_product_related_parameters where productId = #{productId} and delFlag = 0 LIMIT 50
- </select>
- <select id="findList" resultType="Product">
- SELECT
- <include refid="productColumns"/>
- FROM product a
- <include refid="productJoins"/>
- LEFT JOIN cm_product_activity cp on cp.productId = a.productID
- <where>
- <if test="id !=null and id !=''">
- AND a.productID=#{id}
- </if>
- <if test="commodityType != null and commodityType != ''">
- AND a.commodityType=#{commodityType}
- </if>
- <if test="bigTypeID != null and bigTypeID != 0">
- AND a.bigTypeID = #{bigTypeID}
- </if>
- <if test="smallTypeID != null and smallTypeID != 0">
- AND a.smallTypeID = #{smallTypeID}
- </if>
- <if test="tinyTypeID != null and tinyTypeID != 0">
- AND a.tinyTypeID = #{tinyTypeID}
- </if>
- <if test="productCategory != null and productCategory != ''">
- AND a.productCategory = #{productCategory}
- <if test="productCategory == 2">
- AND a.validFlag != '0'
- </if>
- </if>
- <if test="brandID != null and brandID != ''">
- AND a.brandID = #{brandID}
- </if>
- <if test="shopID != null and shopID != ''">
- AND a.shopID = #{shopID}
- </if>
- <if test="productType != null and productType !=''">
- AND a.productType = #{productType}
- </if>
- <if test='actStatus == "1"'>
- AND cp.delFlag = '0'
- </if>
- <if test="preferredFlag != null and preferredFlag != ''and preferredFlag != 0">
- <if test="preferredFlag/100>=1">
- AND a.preferredFlag in (100,101,110,111)
- </if>
- <if test="(preferredFlag%100)/10>=1">
- AND a.preferredFlag in (10,11,110,111)
- </if>
- <if test="preferredFlag%10>=1">
- AND a.preferredFlag in (1,11,101,111)
- </if>
- </if>
- <if test="name != null and name != ''">
- AND a.name LIKE
- <if test="dbName == 'oracle'">'%'||#{name}||'%'</if>
- <if test="dbName == 'mssql'">'%'+#{name}+'%'</if>
- <if test="dbName == 'mysql'">concat('%',#{name},'%')</if>
- </if>
- <if test="shopName != null and shopName != ''">
- AND s.name LIKE
- <if test="dbName == 'oracle'">'%'||#{shopName}||'%'</if>
- <if test="dbName == 'mssql'">'%'+#{shopName}+'%'</if>
- <if test="dbName == 'mysql'">concat('%',#{shopName},'%')</if>
- </if>
- <if test="validFlag !=null and validFlag !=''">
- AND a.validFlag=#{validFlag}
- </if>
- <if test="actFlag !=null and actFlag !=''">
- AND a.actFlag=#{actFlag}
- </if>
- <if test="actType !=null and actType !=''">
- AND a.actType=#{actType}
- </if>
- <if test="secondHandType !=null and secondHandType !=''">
- AND cshd.secondHandType=#{secondHandType}
- </if>
- <if test="instrumentType !=null and instrumentType !=''">
- AND cshd.instrumentType like concat('%',#{instrumentType},'%')
- </if>
- <if test="sold != null and sold != ''">
- AND cshd.sold=#{sold}
- </if>
- <if test="source != null and source != ''">
- AND cshd.source=#{source}
- </if>
- <if test="publishIdentity != null and publishIdentity !=''">
- AND cshd.publishIdentity = #{publishIdentity}
- </if>
- <if test="contactName !=null and contactName !=''">
- AND (cshd.contactName LIKE concat('%',#{contactName},'%') or cshd.companyName LIKE concat('%',#{contactName},'%'))
- </if>
- <if test="sqlMap !=null and sqlMap !=''">
- ${sqlMap.dsf}
- </if>
- AND a.shopID not in (SELECT s.`value` FROM `sys_dict` s WHERE s.type='heheShopID')
- AND a.productID NOT IN (6060, 6061, 6062, 6063, 6064,6065, 6066, 6067, 6068, 6069)
- </where>
- <choose>
- <when test="page !=null and page.orderBy != null and page.orderBy != ''">
- ORDER BY ${page.orderBy}
- </when>
- <otherwise>
- order by a.productID desc
- </otherwise>
- </choose>
- </select>
- <select id="findAllList" resultType="Product">
- SELECT
- <include refid="productColumns"/>
- FROM product a
- <include refid="productJoins"/>
- <where>
- a.productCategory = 1
- <if test="productCategory != null and productCategory != ''">
- AND a.productCategory = #{productCategory}
- </if>
- </where>
- <choose>
- <when test="page !=null and page.orderBy != null and page.orderBy != ''">
- ORDER BY ${page.orderBy}
- </when>
- <otherwise>
- </otherwise>
- </choose>
- </select>
- <select id="getImageList" resultType="com.caimei.po.ProductImage">
- select *
- from productimage
- where productID = #{productId}
- ORDER BY mainFlag DESC ,sortIndex is null,sortIndex ASC
- </select>
- <select id="getImageById" resultType="com.caimei.po.ProductImage">
- select *
- from productimage
- where productImageID = #{productImageID}
- </select>
- <select id="getValidFlagByProductId" resultType="java.lang.String">
- select validFlag from product where productID = #{productID}
- </select>
- <select id="getBeforeValidFlagByProductId" resultType="java.lang.String">
- select beforeValidFlag from product where productID = #{productID}
- </select>
- <insert id="insert" parameterType="Product" keyProperty="id" useGeneratedKeys="true">
- INSERT INTO product(productID,
- brandID,
- tinyTypeID,
- productCategory,
- selfTypeID,
- shopID,
- name,
- searchKey,
- normalPrice,
- price,
- priceFlag,
- beautyActFlag,
- ladderPriceFlag,
- stock,
- hasSkuFlag,
- mainImage,
- propertiesInfo,
- addTime,
- updateTime,
- sellNumber,
- weekSellNumber,
- beforeValidFlag,
- validFlag,
- favoriteTimes,
- commentScore,
- commentTimes,
- selfRecommendFlag,
- sysRecommendFlag,
- sortIndex,
- featuredFlag,
- featuredSortIndex,
- productCode,
- unit,
- synToERPFlag,
- allAreaFlag,
- provinceIDs,
- serviceNumber,
- maxBuyNumber,
- minBuyNumber,
- packageCount,
- byFlag,
- normalProductFlag,
- wholeSaleProductFlag,
- promotionProductFlag,
- groupBuyProductFlag,
- step,
- actFlag,
- actType,
- onlineTime,
- downlineTime,
- freePostFlag,
- costPrice,
- costProportional,
- costCheckFlag,
- precisehKey)
- VALUES (#{id},
- #{brandID},
- #{tinyTypeID},
- #{productCategory},
- #{selfTypeID},
- #{shopID},
- #{name},
- #{searchKey},
- #{normalPrice},
- #{price},
- #{priceFlag},
- #{beautyActFlag},
- #{ladderPriceFlag},
- #{stock},
- #{hasSkuFlag},
- #{mainImage},
- #{propertiesInfo},
- #{addTime},
- #{updateTime},
- #{sellNumber},
- #{weekSellNumber},
- #{beforeValidFlag},
- #{validFlag},
- #{favoriteTimes},
- #{commentScore},
- #{commentTimes},
- #{selfRecommendFlag},
- #{sysRecommendFlag},
- #{sortIndex},
- #{featuredFlag},
- #{featuredSortIndex},
- #{productCode},
- #{unit},
- #{synToERPFlag},
- #{allAreaFlag},
- #{provinceIDs},
- #{serviceNumber},
- #{maxBuyNumber},
- #{minBuyNumber},
- #{packageCount},
- #{byFlag},
- #{normalProductFlag},
- #{wholeSaleProductFlag},
- #{promotionProductFlag},
- #{groupBuyProductFlag},
- #{step},
- #{actFlag},
- #{actType},
- #{onlineTime},
- #{downlineTime},
- #{freePostFlag},
- #{costPrice},
- #{costProportional},
- #{costCheckFlag},
- #{precisehKey})
- </insert>
- <update id="update">
- UPDATE product
- SET productID = #{id},
- brandID = #{brandID},
- tinyTypeID = #{tinyTypeID},
- productCategory = #{productCategory},
- selfTypeID = #{selfTypeID},
- shopID = #{shopID},
- name = #{name},
- searchKey = #{searchKey},
- normalPrice = #{normalPrice},
- price = #{price},
- priceFlag = #{priceFlag},
- beautyActFlag = #{beautyActFlag},
- ladderPriceFlag = #{ladderPriceFlag},
- stock = #{stock},
- hasSkuFlag = #{hasSkuFlag},
- mainImage = #{mainImage},
- propertiesInfo = #{propertiesInfo},
- addTime = #{addTime},
- updateTime = #{updateTime},
- sellNumber = #{sellNumber},
- weekSellNumber = #{weekSellNumber},
- beforeValidFlag = #{beforeValidFlag},
- validFlag = #{validFlag},
- favoriteTimes = #{favoriteTimes},
- commentScore = #{commentScore},
- commentTimes = #{commentTimes},
- selfRecommendFlag = #{selfRecommendFlag},
- sysRecommendFlag = #{sysRecommendFlag},
- sortIndex = #{sortIndex},
- featuredFlag = #{featuredFlag},
- featuredSortIndex = #{featuredSortIndex},
- productCode = #{productCode},
- unit = #{unit},
- synToERPFlag = #{synToERPFlag},
- allAreaFlag = #{allAreaFlag},
- provinceIDs = #{provinceIDs},
- serviceNumber = #{serviceNumber},
- maxBuyNumber = #{maxBuyNumber},
- minBuyNumber = #{minBuyNumber},
- packageCount = #{packageCount},
- byFlag = #{byFlag},
- normalProductFlag = #{normalProductFlag},
- wholeSaleProductFlag = #{wholeSaleProductFlag},
- promotionProductFlag = #{promotionProductFlag},
- groupBuyProductFlag = #{groupBuyProductFlag},
- step = #{step},
- actFlag = #{actFlag},
- actType = #{actType},
- onlineTime = #{onlineTime},
- downlineTime = #{downlineTime},
- freePostFlag = #{freePostFlag},
- costPrice = #{costPrice},
- costProportional = #{costProportional},
- costCheckFlag = #{costCheckFlag},
- precisehKey = #{precisehKey},
- actSort = #{actSort},
- productType = #{productType},
- qualificationImg = #{qualificationImg},
- includedTax = #{includedTax},
- invoiceType = #{invoiceType},
- taxPoint = #{taxPoint},
- supplierTaxPoint = #{supplierTaxPoint}
- WHERE productID = #{id}
- </update>
- <update id="updateIndex" parameterType="java.lang.Integer">
- update cm_syntolucenedoc set synFlag = 0,synType = 2
- <where>
- <if test="id !=null and id !=''">
- productID=#{id}
- </if>
- </where>
- </update>
- <insert id="insertProductImage" parameterType="com.caimei.po.ProductImage">
- insert into productimage (productID, shopID, addTime, image, mainFlag, sortIndex)
- values (#{productID}, #{shopID}, #{addTime}, #{image}, #{mainFlag}, #{sortIndex});
- </insert>
- <update id="updateByPrimaryKeySelective" parameterType="com.caimei.modules.product.entity.Product">
- update product
- <set>
- <if test="brandID != null and brandID != ''">
- brandID = #{brandID},
- </if>
- <if test="bigTypeID != null and bigTypeID !=''">
- bigTypeID = #{bigTypeID},
- smallTypeID = #{smallTypeID},
- tinyTypeID = #{tinyTypeID},
- </if>
- <if test="preferredFlag != null and preferredFlag !=''">
- preferredFlag = #{preferredFlag},
- </if>
- <if test="selfTypeID != null and selfTypeID !=''">
- selfTypeID = #{selfTypeID},
- </if>
- <if test="shopID != null and shopID !=''">
- shopID = #{shopID},
- </if>
- <if test="name != null and name !=''">
- `name` = #{name},
- </if>
- <if test="aliasName != null and aliasName !=''">
- aliasName = #{aliasName},
- </if>
- <if test="searchKey != null and searchKey !=''">
- searchKey = #{searchKey},
- </if>
- <if test="productRemarks != null and productRemarks !=''">
- productRemarks = #{productRemarks},
- </if>
- <if test="combinationID != null and combinationID !=''">
- combinationID = #{combinationID},
- </if>
- <if test="normalPrice != null and normalPrice !=''">
- normalPrice = #{normalPrice},
- </if>
- <if test="price != null and price !=''">
- price = #{price},
- </if>
- <if test="priceFlag != null and priceFlag !=''">
- priceFlag = #{priceFlag},
- </if>
- <if test="beautyActFlag != null and beautyActFlag !=''">
- beautyActFlag = #{beautyActFlag},
- </if>
- <if test="ladderPriceFlag != null and ladderPriceFlag !=''">
- ladderPriceFlag = #{ladderPriceFlag},
- </if>
- <if test="stock != null and stock !=''">
- stock = #{stock},
- </if>
- <if test="hasSkuFlag != null and hasSkuFlag !=''">
- hasSkuFlag = #{hasSkuFlag},
- </if>
- <if test="mainImage != null and mainImage !=''">
- mainImage = #{mainImage},
- </if>
- <if test="propertiesInfo != null and propertiesInfo !=''">
- propertiesInfo = #{propertiesInfo},
- </if>
- <if test="addTime != null and addTime !=''">
- addTime = #{addTime},
- </if>
- <if test="updateTime != null and updateTime !=''">
- updateTime = #{updateTime},
- </if>
- <if test="sellNumber != null and sellNumber !=''">
- sellNumber = #{sellNumber},
- </if>
- <if test="weekSellNumber != null and weekSellNumber !=''">
- weekSellNumber = #{weekSellNumber},
- </if>
- <if test="beforeValidFlag != null and beforeValidFlag !=''">
- beforeValidFlag = #{beforeValidFlag},
- </if>
- <if test="validFlag != null and validFlag !=''">
- validFlag = #{validFlag},
- </if>
- <if test="favoriteTimes != null and favoriteTimes !=''">
- favoriteTimes = #{favoriteTimes},
- </if>
- <if test="commentScore != null and commentScore !=''">
- commentScore = #{commentScore},
- </if>
- <if test="commentTimes != null and commentTimes !=''">
- commentTimes = #{commentTimes},
- </if>
- <if test="selfRecommendFlag != null and selfRecommendFlag !=''">
- selfRecommendFlag = #{selfRecommendFlag},
- </if>
- <if test="sysRecommendFlag != null and sysRecommendFlag !=''">
- sysRecommendFlag = #{sysRecommendFlag},
- </if>
- <if test="sortIndex != null and sortIndex != ''">
- sortIndex = #{sortIndex},
- </if>
- <if test="featuredFlag != null and featuredFlag !=''">
- featuredFlag = #{featuredFlag},
- </if>
- <if test="featuredSortIndex != null and featuredSortIndex !=''">
- featuredSortIndex = #{featuredSortIndex},
- </if>
- <if test="productCode != null and productCode !=''">
- productCode = #{productCode},
- </if>
- <if test="unit != null and unit !=''">
- unit = #{unit},
- </if>
- <if test="synToERPFlag != null and synToERPFlag !=''">
- synToERPFlag = #{synToERPFlag},
- </if>
- <if test="allAreaFlag != null and allAreaFlag !=''">
- allAreaFlag = #{allAreaFlag},
- </if>
- <if test="provinceIDs != null and provinceIDs !=''">
- provinceIDs = #{provinceIDs},
- </if>
- <if test="serviceNumber != null and serviceNumber !=''">
- serviceNumber = #{serviceNumber},
- </if>
- <if test="maxBuyNumber != null and maxBuyNumber !=''">
- maxBuyNumber = #{maxBuyNumber},
- </if>
- <if test="minBuyNumber != null and minBuyNumber !=''">
- minBuyNumber = #{minBuyNumber},
- </if>
- <if test="packageCount != null and packageCount !=''">
- packageCount = #{packageCount},
- </if>
- <if test="byFlag != null and byFlag !=''">
- byFlag = #{byFlag},
- </if>
- <if test="normalProductFlag != null and normalProductFlag !=''">
- normalProductFlag = #{normalProductFlag},
- </if>
- <if test="wholeSaleProductFlag != null and wholeSaleProductFlag !=''">
- wholeSaleProductFlag = #{wholeSaleProductFlag},
- </if>
- <if test="promotionProductFlag != null and promotionProductFlag !=''">
- promotionProductFlag = #{promotionProductFlag},
- </if>
- <if test="groupBuyProductFlag != null and groupBuyProductFlag !=''">
- groupBuyProductFlag = #{groupBuyProductFlag},
- </if>
- <if test="step != null and step !=''">
- step = #{step},
- </if>
- <if test="actFlag != null and actFlag !=''">
- actFlag = #{actFlag},
- </if>
- <if test="actSort != null and actSort !=''">
- actSort = #{actSort},
- </if>
- <if test="actType != null and actType !=''">
- actType = #{actType},
- </if>
- <if test="onlineTime != null and onlineTime !=''">
- onlineTime = #{onlineTime},
- </if>
- <if test="downlineTime != null and downlineTime !=''">
- downlineTime = #{downlineTime},
- </if>
- <if test="freePostFlag != null and freePostFlag !=''">
- freePostFlag = #{freePostFlag},
- </if>
- <if test="costPrice != null and costPrice != ''">
- costPrice = #{costPrice},
- </if>
- <if test="costProportional != null and costProportional !=''">
- costProportional = #{costProportional},
- </if>
- <if test="costCheckFlag != null and costCheckFlag !=''">
- costCheckFlag = #{costCheckFlag},
- </if>
- <if test="precisehKey != null and precisehKey !=''">
- precisehKey = #{precisehKey},
- </if>
- <if test="visibility != null and visibility !=''">
- visibility = #{visibility},
- </if>
- <if test="endTimeStr != null and endTimeStr !=''">
- endTimeStr = #{endTimeStr},
- </if>
- <if test="tags != null and tags !=''">
- tags = #{tags},
- </if>
- <if test="recommendType != null and recommendType !=''">
- recommendType = #{recommendType},
- </if>
- <if test="machineType != null and machineType !=''">
- machineType = #{machineType},
- </if>
- <if test="commodityType != null and commodityType != ''">
- commodityType = #{commodityType}
- </if>
- </set>
- where productID = #{productID}
- </update>
- <update id="updateImageSort">
- update productimage set sortIndex = #{sortIndex}
- where productImageID = #{productImageID}
- </update>
- <update id="cancelImageMainFlag">
- update productimage set mainFlag = 0
- where productID = #{productID}
- and mainFlag = 1
- </update>
- <update id="setImageMainFlag">
- update productimage set mainFlag = 1
- where productImageID = #{productImageID}
- </update>
- <update id="setProductImage">
- UPDATE product SET mainImage = #{mainImage}
- WHERE productID = #{productID}
- </update>
- <delete id="deleteImage">
- DELETE FROM productimage
- WHERE productImageID = #{productImageID}
- </delete>
- <delete id="mulDeleteImage">
- DELETE FROM productimage
- WHERE productImageID IN
- <foreach collection="idList" item="productImageID" index="index" open="(" separator="," close=")">
- #{productImageID}
- </foreach>
- </delete>
- <delete id="deleteParameters">
- DELETE FROM cm_product_related_parameters WHERE productId = #{productId}
- </delete>
- <delete id="deleteImageByProductId">
- DELETE FROM productimage WHERE productID = #{productID}
- </delete>
- <insert id="insertParameters" parameterType="com.caimei.modules.product.entity.ProductParameters">
- insert into
- cm_product_related_parameters
- (productId,
- paramsName,
- paramsContent,
- delFlag)
- values
- (#{productId},
- #{paramsName},
- #{paramsContent},
- #{delFlag})
- </insert>
- <insert id="insertStatusRecord">
- INSERT INTO `product_status_record` (
- `productId`,
- `modifyUserId`,
- `validFlag`,
- `remarks`,
- `addTime`
- )
- VALUES
- (
- #{productId},
- #{modifyUserId},
- #{validFlag},
- #{remarks},
- #{addTime}
- )
- </insert>
- <select id="findAllStatusRemarks" resultType="com.caimei.modules.product.entity.ProductStatusRecord">
- SELECT
- id,
- `productId`,
- `modifyUserId`,
- `validFlag`,
- `remarks`,
- `addTime`
- FROM
- `product_status_record`
- WHERE
- productId = #{productId}
- ORDER BY
- addTime DESC
- </select>
- <select id="findSplitCode" resultType="com.caimei.modules.user.entity.SplitCode">
- select shopId,commercialCode as splitCode,codeDetail as codeRemark
- from cm_shop_splitcode
- where shopId=#{shopID}
- </select>
- <select id="findSplitCodeByProduct" resultType="java.lang.String">
- select splitCode from product where productID = #{productID}
- </select>
- <select id="getShopIdByName" resultType="java.lang.Integer">
- select shopID from shop where name like concat('%',#{shopName},'%')
- </select>
- <select id="findSecondSplitCode" resultType="com.caimei.modules.user.entity.SplitCode">
- select css.shopId,css.commercialCode as splitCode,css.codeDetail as codeRemark
- from cm_shop_splitcode css
- left join product p on p.shopID = css.shopId
- left join cm_second_hand_detail cshd on p.productID = cshd.productID
- where cshd.id=#{id}
- </select>
- </mapper>
|