1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383 |
- <?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.ProductDao">
- <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",
- a.bigTypeID AS "bigTypeID",
- ifnull(a.smallTypeID,-1) AS "smallTypeID",
- ifnull(a.tinyTypeID,-1) AS "tinyTypeID",
- 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.highestUserLevelPrice AS "highestUserLevelPrice",
- a.lowestUserLevelPrice AS "lowestUserLevelPrice",
- a.lowestUserLevelID AS "lowestUserLevelID",
- a.price0 AS "price0",
- a.price0Text AS "price0Text",
- a.price0TextFlag AS "price0TextFlag",
- a.price1 AS "price1",
- a.price1Text AS "price1Text",
- a.price1TextFlag AS "price1TextFlag",
- a.price8 AS "price8",
- a.price8Text AS "price8Text",
- a.price8TextFlag AS "price8TextFlag",
- a.ladderPriceFlag AS "ladderPriceFlag",
- a.price2 AS "price2",
- a.price3 AS "price3",
- a.price4 AS "price4",
- a.price5 AS "price5",
- a.price6 AS "price6",
- a.price7 AS "price7",
- a.fee AS "fee",
- 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.rate1 AS "rate1",
- a.rate2 AS "rate2",
- 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.virtualFlag AS "virtualFlag",
- 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.speCommisionFlag AS "speCommisionFlag",
- a.speCommision AS "speCommision",
- a.videourl AS "videourl",
- a.props AS "props",
- a.providers AS "providers",
- a.serviceCommissionRatio AS "serviceCommissionRatio",
- a.reCommissionRatio AS "reCommissionRatio",
- a.pushToERPName AS "pushToERPName",
- a.prodBeans AS "prodBeans",
- a.useBeansFlag AS "useBeansFlag",
- a.privateFlag AS "privateFlag",
- a.invisibleServiceProviderIDs AS "invisibleServiceProviderIDs",
- a.displayOnCRMFlag AS "displayOnCRMFlag",
- a.needServiceFlag AS "needServiceFlag",
- a.actStatus AS "actStatus",
- a.actPrice0 AS "actPrice0",
- a.actPrice1 AS "actPrice1",
- a.actPrice2 AS "actPrice2",
- a.actPrice3 AS "actPrice3",
- a.actPrice4 AS "actPrice4",
- a.actPrice5 AS "actPrice5",
- a.actPrice6 AS "actPrice6",
- a.actPrice7 AS "actPrice7",
- a.beginTime AS "beginTime",
- a.endTime AS "endTime",
- a.actFlag AS "actFlag",
- a.actType AS "actType",
- a.actFullReduceAmount AS "actFullReduceAmount",
- a.actReduceAmount AS "actReduceAmount",
- a.actFullGiftAmount AS "actFullGiftAmount",
- a.actBuyGiftNum AS "actBuyGiftNum",
- a.onlineTime AS "onlineTime",
- a.downlineTime AS "downlineTime",
- a.shopIndexModuleID AS "shopIndexModuleID",
- a.freePostFlag AS "freePostFlag",
- a.crmBigTypeId AS "crmBigTypeId",
- a.crmSmallTypeId AS "crmSmallTypeId",
- a.costPrice AS "costPrice",
- a.costProportional AS "costProportional",
- a.costCheckFlag AS "costCheckFlag",
- a.precisehKey AS "precisehKey",
- a.docBoost AS "docBoost",
- a.cmbeanFlag AS "cmbeanFlag",
- a.cmbeanPrice AS "cmbeanPrice",
- a.cmbeanSort AS "cmbeanSort",
- s.name AS "shopName",
- a.actSort AS "actSort",
- a.actCreateTime AS "actCreateTime",
- a.recommendType AS "recommendType",
- a.aliasName as "aliasName",
- a.price0Grade as "price0Grade",
- a.price1Grade as "price1Grade",
- a.price8Grade as "price8Grade",
- a.visibility as "visibility",
- a.surplusTime as "surplusTime",
- a.productType as "productType",
- a.qualificationImg as "qualificationImg",
- a.includedTax as "includedTax",
- a.invoiceType as "invoiceType",
- a.taxPoint as "taxPoint",
- a.priceType as "priceType",
- a.tags as "tags",
- a.machineType as "machineType",
- a.trainingMethod as "trainingMethod",
- a.trainingType as "trainingType",
- a.trainingFee as "trainingFee",
- a.commodityType as "commodityType"
- </sql>
- <sql id="productJoins">
- LEFT JOIN shop s on s.shopID = a.shopID
- </sql>
- <sql id="ActivityJoins">
- LEFT JOIN shop s on s.shopID = a.shopID
- </sql>
- <update id="saveSort">
- UPDATE cm_search_recommend_product SET
- sort = #{sort}
- WHERE id = #{id}
- </update>
- <select id="findLadderPriceByNum" resultType="Integer">
- select IFNULL(buyNum,1)
- FROM product_ladder_price
- WHERE userType = 3 and ladderNum = 1 and delFlag = 0 and productID = #{productID}
- </select>
- <select id="get" resultType="Product">
- SELECT
- <include refid="productColumns"/>
- FROM product a
- <include refid="productJoins"/>
- WHERE a.productID = #{id}
- </select>
- <select id="getAllExistsProductList" resultType="Integer">
- SELECT
- a.productID
- FROM cm_mall_organize_products a
- WHERE a.delFlag = 0 and a.organizeID = #{organizeID}
- </select>
- <select id="findRecommendPage" resultType="Product">
- SELECT
- <include refid="productColumns"/>
- FROM product a
- <include refid="productJoins"/>
- <where>
- <if test="productID !=null and productID !=''">
- AND a.productID=#{productID}
- </if>
- <if test="tinyTypeID != null and tinyTypeID != ''">
- AND a.tinyTypeID = #{tinyTypeID}
- </if>
- <if test="shopID != null and shopID != ''">
- AND a.shopID = #{shopID}
- </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="cmbeanFlag != null and cmbeanFlag != ''">
- AND a.cmbeanFlag = #{cmbeanFlag}
- </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="speCommisionFlag !=null and speCommisionFlag !=''">
- AND a.speCommisionFlag=#{speCommisionFlag}
- </if>
- <if test="displayOnCRMFlag !=null and displayOnCRMFlag !=''">
- AND a.displayOnCRMFlag=#{displayOnCRMFlag}
- </if>
- <if test="crmBigTypeId !=null and crmBigTypeId !=''">
- AND a.crmBigTypeId=#{crmBigTypeId}
- </if>
- <if test="crmSmallTypeId !=null and crmSmallTypeId !=''">
- AND a.crmSmallTypeId=#{crmSmallTypeId}
- </if>
- <if test="sqlMap !=null and sqlMap !=''">
- ${sqlMap.dsf}
- </if>
- <choose>
- <when test="actType != null and actType != ''">
- AND a.actType = #{actType}
- </when>
- <otherwise>
- AND a.actType != 3
- </otherwise>
- </choose>
- AND a.validFlag != 0
- AND a.shopID not in (SELECT s.`value` FROM `sys_dict` s WHERE s.type='heheShopID')
- and a.productCategory = 1
- </where>
- <choose>
- <when test="page !=null and page.orderBy != null and page.orderBy != ''">
- ORDER BY ${page.orderBy}
- </when>
- <otherwise>
- order by case WHEN a.validFlag = 1 then 0 else 1 END asc,a.productID desc
- </otherwise>
- </choose>
- </select>
- <!--小程序商品获取采美2已上架 3已下架 9已冻结的商品-->
- <select id="findListBuyMall" resultType="Product">
- SELECT
- <include refid="productColumns"/>
- FROM product a
- <include refid="productJoins"/>
- <where>
- <if test="productID !=null and productID !=''">
- AND a.productID=#{productID}
- </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>
- AND a.validFlag in (2,3,9)
- and a.productCategory = 1
- </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="findList" resultType="Product">
- SELECT
- <include refid="productColumns"/>
- FROM product a
- <include refid="productJoins"/>
- <where>
- <if test="id !=null and id !=''">
- AND a.productID=#{id}
- </if>
- <if test="tinyTypeID != null and tinyTypeID != ''">
- AND a.tinyTypeID = #{tinyTypeID}
- </if>
- <if test="shopID != null and shopID != ''">
- AND a.shopID = #{shopID}
- </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="cmbeanFlag != null and cmbeanFlag != ''">
- AND a.cmbeanFlag = #{cmbeanFlag}
- </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="speCommisionFlag !=null and speCommisionFlag !=''">
- AND a.speCommisionFlag=#{speCommisionFlag}
- </if>
- <if test="displayOnCRMFlag !=null and displayOnCRMFlag !=''">
- AND a.displayOnCRMFlag=#{displayOnCRMFlag}
- </if>
- <if test="crmBigTypeId !=null and crmBigTypeId !=''">
- AND a.crmBigTypeId=#{crmBigTypeId}
- </if>
- <if test="crmSmallTypeId !=null and crmSmallTypeId !=''">
- AND a.crmSmallTypeId=#{crmSmallTypeId}
- </if>
- <if test="sqlMap !=null and sqlMap !=''">
- ${sqlMap.dsf}
- </if>
- AND a.validFlag != 0
- AND a.shopID not in (SELECT s.`value` FROM `sys_dict` s WHERE s.type='heheShopID')
- and a.productCategory = 1
- </where>
- <choose>
- <when test="page !=null and page.orderBy != null and page.orderBy != ''">
- ORDER BY ${page.orderBy}
- </when>
- <otherwise>
- order by case WHEN a.validFlag = 1 then 0 else 1 END asc,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
- </where>
- <choose>
- <when test="page !=null and page.orderBy != null and page.orderBy != ''">
- ORDER BY ${page.orderBy}
- </when>
- <otherwise>
- </otherwise>
- </choose>
- </select>
- <insert id="insert" parameterType="Product" keyProperty="id" useGeneratedKeys="true">
- INSERT INTO product(
- productID,
- brandID,
- bigTypeID,
- smallTypeID,
- tinyTypeID,
- selfTypeID,
- shopID,
- name,
- searchKey,
- normalPrice,
- price,
- highestUserLevelPrice,
- lowestUserLevelPrice,
- lowestUserLevelID,
- price0,
- price0Text,
- price0TextFlag,
- price1,
- price1Text,
- price1TextFlag,
- price8,
- price8Text,
- price8TextFlag,
- ladderPriceFlag,
- price2,
- price3,
- price4,
- price5,
- price6,
- price7,
- fee,
- stock,
- hasSkuFlag,
- mainImage,
- propertiesInfo,
- addTime,
- updateTime,
- weekSellNumber,
- beforeValidFlag,
- validFlag,
- favoriteTimes,
- commentScore,
- commentTimes,
- selfRecommendFlag,
- sysRecommendFlag,
- sortIndex,
- featuredFlag,
- featuredSortIndex,
- productCode,
- rate1,
- rate2,
- unit,
- synToERPFlag,
- allAreaFlag,
- provinceIDs,
- serviceNumber,
- maxBuyNumber,
- virtualFlag,
- minBuyNumber,
- packageCount,
- byFlag,
- normalProductFlag,
- wholeSaleProductFlag,
- promotionProductFlag,
- groupBuyProductFlag,
- step,
- speCommisionFlag,
- speCommision,
- videourl,
- props,
- providers,
- serviceCommissionRatio,
- reCommissionRatio,
- pushToERPName,
- prodBeans,
- useBeansFlag,
- privateFlag,
- invisibleServiceProviderIDs,
- displayOnCRMFlag,
- needServiceFlag,
- actPrice0,
- actPrice1,
- actPrice2,
- actPrice3,
- actPrice4,
- actPrice5,
- actPrice6,
- actPrice7,
- beginTime,
- endTime,
- actFlag,
- actType,
- actFullReduceAmount,
- actReduceAmount,
- actFullGiftAmount,
- actBuyGiftNum,
- onlineTime,
- downlineTime,
- shopIndexModuleID,
- freePostFlag,
- crmBigTypeId,
- crmSmallTypeId,
- costPrice,
- costProportional,
- costCheckFlag,
- precisehKey,
- docBoost,
- cmbeanFlag,
- cmbeanPrice,
- cmbeanSort
- ) VALUES (
- #{id},
- #{brandID},
- #{bigTypeID},
- #{smallTypeID},
- #{tinyTypeID},
- #{selfTypeID},
- #{shopID},
- #{name},
- #{searchKey},
- #{normalPrice},
- #{price},
- #{highestUserLevelPrice},
- #{lowestUserLevelPrice},
- #{lowestUserLevelID},
- #{price0},
- #{price0Text},
- #{price0TextFlag},
- #{price1},
- #{price1Text},
- #{price1TextFlag},
- #{price8},
- #{price8Text},
- #{price8TextFlag},
- #{ladderPriceFlag},
- #{price2},
- #{price3},
- #{price4},
- #{price5},
- #{price6},
- #{price7},
- #{fee},
- #{stock},
- #{hasSkuFlag},
- #{mainImage},
- #{propertiesInfo},
- #{addTime},
- #{updateTime},
- #{weekSellNumber},
- #{beforeValidFlag},
- #{validFlag},
- #{favoriteTimes},
- #{commentScore},
- #{commentTimes},
- #{selfRecommendFlag},
- #{sysRecommendFlag},
- #{sortIndex},
- #{featuredFlag},
- #{featuredSortIndex},
- #{productCode},
- #{rate1},
- #{rate2},
- #{unit},
- #{synToERPFlag},
- #{allAreaFlag},
- #{provinceIDs},
- #{serviceNumber},
- #{maxBuyNumber},
- #{virtualFlag},
- #{minBuyNumber},
- #{packageCount},
- #{byFlag},
- #{normalProductFlag},
- #{wholeSaleProductFlag},
- #{promotionProductFlag},
- #{groupBuyProductFlag},
- #{step},
- #{speCommisionFlag},
- #{speCommision},
- #{videourl},
- #{props},
- #{providers},
- #{serviceCommissionRatio},
- #{reCommissionRatio},
- #{pushToERPName},
- #{prodBeans},
- #{useBeansFlag},
- #{privateFlag},
- #{invisibleServiceProviderIDs},
- #{displayOnCRMFlag},
- #{needServiceFlag},
- #{actPrice0},
- #{actPrice1},
- #{actPrice2},
- #{actPrice3},
- #{actPrice4},
- #{actPrice5},
- #{actPrice6},
- #{actPrice7},
- #{beginTime},
- #{endTime},
- #{actFlag},
- #{actType},
- #{actFullReduceAmount},
- #{actReduceAmount},
- #{actFullGiftAmount},
- #{actBuyGiftNum},
- #{onlineTime},
- #{downlineTime},
- #{shopIndexModuleID},
- #{freePostFlag},
- #{crmBigTypeId},
- #{crmSmallTypeId},
- #{costPrice},
- #{costProportional},
- #{costCheckFlag},
- #{precisehKey},
- #{docBoost},
- #{cmbeanFlag},
- #{cmbeanPrice},
- #{cmbeanSort}
- )
- </insert>
- <update id="update">
- UPDATE product SET
- productID = #{id},
- brandID = #{brandID},
- tinyTypeID = #{tinyTypeID},
- selfTypeID = #{selfTypeID},
- shopID = #{shopID},
- name = #{name},
- searchKey = #{searchKey},
- normalPrice = #{normalPrice},
- price = #{price},
- highestUserLevelPrice = #{highestUserLevelPrice},
- lowestUserLevelPrice = #{lowestUserLevelPrice},
- lowestUserLevelID = #{lowestUserLevelID},
- price0 = #{price0},
- price0Text = #{price0Text},
- price0TextFlag = #{price0TextFlag},
- price1 = #{price1},
- price1Text = #{price1Text},
- price1TextFlag = #{price1TextFlag},
- price8 = #{price8},
- price8Text = #{price8Text},
- price8TextFlag = #{price8TextFlag},
- ladderPriceFlag = #{ladderPriceFlag},
- price2 = #{price2},
- price3 = #{price3},
- price4 = #{price4},
- price5 = #{price5},
- price6 = #{price6},
- price7 = #{price7},
- fee = #{fee},
- 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},
- rate1 = #{rate1},
- rate2 = #{rate2},
- unit = #{unit},
- synToERPFlag = #{synToERPFlag},
- allAreaFlag = #{allAreaFlag},
- provinceIDs = #{provinceIDs},
- serviceNumber = #{serviceNumber},
- maxBuyNumber = #{maxBuyNumber},
- virtualFlag = #{virtualFlag},
- minBuyNumber = #{minBuyNumber},
- packageCount = #{packageCount},
- byFlag = #{byFlag},
- normalProductFlag = #{normalProductFlag},
- wholeSaleProductFlag = #{wholeSaleProductFlag},
- promotionProductFlag = #{promotionProductFlag},
- groupBuyProductFlag = #{groupBuyProductFlag},
- step = #{step},
- speCommisionFlag = #{speCommisionFlag},
- speCommision = #{speCommision},
- videourl = #{videourl},
- props = #{props},
- providers = #{providers},
- serviceCommissionRatio = #{serviceCommissionRatio},
- reCommissionRatio = #{reCommissionRatio},
- pushToERPName = #{pushToERPName},
- prodBeans = #{prodBeans},
- useBeansFlag = #{useBeansFlag},
- privateFlag = #{privateFlag},
- invisibleServiceProviderIDs = #{invisibleServiceProviderIDs},
- displayOnCRMFlag = #{displayOnCRMFlag},
- needServiceFlag = #{needServiceFlag},
- actPrice0 = #{actPrice0},
- actPrice1 = #{actPrice1},
- actPrice2 = #{actPrice2},
- actPrice3 = #{actPrice3},
- actPrice4 = #{actPrice4},
- actPrice5 = #{actPrice5},
- actPrice6 = #{actPrice6},
- actPrice7 = #{actPrice7},
- beginTime = #{beginTime},
- endTime = #{endTime},
- actFlag = #{actFlag},
- actType = #{actType},
- actFullReduceAmount = #{actFullReduceAmount},
- actReduceAmount = #{actReduceAmount},
- actFullGiftAmount = #{actFullGiftAmount},
- actBuyGiftNum = #{actBuyGiftNum},
- onlineTime = #{onlineTime},
- downlineTime = #{downlineTime},
- shopIndexModuleID = #{shopIndexModuleID},
- freePostFlag = #{freePostFlag},
- crmBigTypeId = #{crmBigTypeId},
- crmSmallTypeId = #{crmSmallTypeId},
- costPrice = #{costPrice},
- costProportional = #{costProportional},
- costCheckFlag = #{costCheckFlag},
- precisehKey = #{precisehKey},
- docBoost = #{docBoost},
- cmbeanFlag = #{cmbeanFlag},
- cmbeanPrice = #{cmbeanPrice},
- cmbeanSort = #{cmbeanSort},
- actSort = #{actSort},
- actCreateTime = #{actCreateTime}
- WHERE productID = #{id}
- </update>
- <update id="updateActive">
- UPDATE product
- <set>
- <if test="actFlag != null and actFlag != ''">
- actFlag = #{actFlag},
- </if>
- <if test="actType != null and actType != ''">
- actType = #{actType},
- </if>
- <if test="actSort != null and actSort != ''">
- actSort = #{actSort},
- </if>
- <if test="actCreateTime != null and actCreateTime != ''">
- actCreateTime = #{actCreateTime},
- </if>
- </set>
- WHERE productID = #{productID}
- </update>
- <update id="updatePreferred">
- UPDATE product SET preferredFlag = #{preferredFlag}
- WHERE productID = #{productID}
- </update>
- <delete id="delete">
- DELETE FROM product
- WHERE id = #{id}
- </delete>
- <update id="deleteProduct">
- UPDATE cm_search_recommend_product
- SET delFlag = #{DateTime}
- WHERE id = #{id}
- </update>
- <select id="getAllActType" resultType="com.caimei.po.ActType">
- SELECT
- *
- FROM acttype
- where validFlag = 1
- </select>
- <select id="getSupplierProductList" resultType="com.caimei.modules.product.entity.Product">
- SELECT
- *
- FROM
- product
- <where>
- <if test="name != null and name != ''">
- AND name LIKE concat('%',#{name},'%')
- </if>
- AND shopID = #{shopID}
- AND (validFlag = 1 or validFlag = 2 or validFlag = 3 or validFlag = 9)
- </where>
- ORDER BY addTime desc
- </select>
- <select id="getGiftProductInfo" parameterType="com.caimei.modules.product.entity.GiftProduct" resultType="com.caimei.modules.product.entity.GiftProduct">
- SELECT
- g.id as "id",
- g.fullGiftProductId as "fullGiftProductId",
- g.giftProductId as "giftProductId",
- g.actType as "actType",
- g.giftProductNum as "giftProductNum",
- p.name as "productName"
- FROM
- gift_product g
- left join product p on p.productID = g.giftProductId
- <where>
- g.fullGiftProductId = #{fullGiftProductId}
- AND g.actType = #{actType}
- <if test="giftProductId != null and giftProductId != ''">
- AND g.giftProductId = #{giftProductId}
- </if>
- <if test="delFlag != null and delFlag != ''">
- AND g.delFlag = #{delFlag}
- </if>
- and p.productCategory = 1
- </where>
- </select>
- <select id="getProductSku" resultType="com.caimei.modules.product.entity.Sku">
- SELECT
- *
- FROM
- sku
- <where>
- productID = #{productId}
- AND validFlag = 1
- </where>
- </select>
- <select id="findProductBigTypeByProductID" parameterType="java.lang.Integer" resultType="java.lang.String">
- SELECT
- tb.name
- FROM
- bigType AS tb
- INNER JOIN smallType AS ts
- ON tb.bigTypeID = ts.bigTypeID
- INNER JOIN tinyType AS tt
- ON ts.smallTypeID = tt.smallTypeID
- INNER JOIN product AS tp
- ON tt.tinyTypeID = tp.tinyTypeID
- <where>
- tp.productID = #{productId}
- and tp.productCategory = 1
- </where>
- </select>
- <update id="updateGiftProudct" parameterType="com.caimei.modules.product.entity.GiftProduct">
- update gift_product
- <set >
- <if test="fullGiftProductId != null and !=''" >
- fullGiftProductId = #{fullGiftProductId},
- </if>
- <if test="giftProductId != null and !=''" >
- giftProductId = #{giftProductId},
- </if>
- <if test="productName != null and !=''" >
- productName = #{productName},
- </if>
- <if test="actType != null and !=''" >
- actType = #{actType},
- </if>
- <if test="giftProductNum != null and !=''" >
- giftProductNum = #{giftProductNum},
- </if>
- <if test="createBy != null and !=''" >
- createBy = #{createBy.id},
- </if>
- <if test="createDate != null and !=''" >
- createDate = #{createDate},
- </if>
- <if test="updateBy != null and !=''" >
- updateBy = #{updateBy.id},
- </if>
- <if test="updateDate != null and !=''" >
- updateDate = #{updateDate},
- </if>
- <if test="delFlag != null and !=''" >
- delFlag = #{delFlag},
- </if>
- </set>
- where id = #{id}
- </update>
- <insert id="insertGiftProudct" parameterType="com.caimei.modules.product.entity.GiftProduct" keyProperty="id" useGeneratedKeys="true">
- INSERT INTO gift_product(
- fullGiftProductId,
- giftProductId,
- productName,
- actType,
- giftProductNum,
- createBy,
- createDate,
- updateBy,
- updateDate,
- delFlag
- ) VALUES (
- #{fullGiftProductId},
- #{giftProductId},
- #{productName},
- #{actType},
- #{giftProductNum},
- #{createBy.id},
- #{createDate},
- #{updateBy.id},
- #{updateDate},
- #{delFlag}
- )
- </insert>
- <insert id="insertProductPriceRecord" parameterType="com.caimei.modules.product.entity.ProductPriceRecord" keyProperty="productPriceRecordID" useGeneratedKeys="true">
- INSERT INTO productpricerecord(
- `productID`,
- `shopID`,
- `highestUserLevelPrice`,
- `lowestUserLevelPrice`,
- `lowestUserLevelID`,
- `price0`,
- `price1`,
- `updateTime`
- )
- VALUES
- (
- #{productID},
- #{shopID},
- #{highestUserLevelPrice},
- #{lowestUserLevelPrice},
- #{lowestUserLevelID},
- #{price0},
- #{price1},
- #{updateTime}
- )
- </insert>
- <update id="updateCRMFlag">
- UPDATE product a SET a.displayOnCRMFlag = #{param1}
- WHERE a.productID IN
- <foreach collection="param2" item="id" index="index" open="(" separator="," close=")" >
- #{id}
- </foreach>
- </update>
- <update id="deleteActive">
- UPDATE product a SET a.actFlag = 0
- WHERE a.productID = #{id}
- </update>
- <update id="updatePostFlag">
- UPDATE product a SET a.freePostFlag = #{param1}
- WHERE a.productID IN
- <foreach collection="param2" item="id" index="index" open="(" separator="," close=")" >
- #{id}
- </foreach>
- </update>
- <select id="getBigTypeList" resultType="com.caimei.modules.product.entity.ProductBigType">
- select * from bigtype
- <where>
- validFlag = 1
- <if test="bigTypeID != null and bigTypeID != ''">
- AND bigTypeID = #{bigTypeID}
- </if>
- </where>
- </select>
- <select id="getSmallTypeList" resultType="com.caimei.modules.product.entity.ProductSmallType">
- select * from smalltype
- <where>
- validFlag = 1
- <if test="bigTypeID != null and bigTypeID != ''">
- AND bigTypeID = #{bigTypeID}
- </if>
- <if test="smallTypeID != null and smallTypeID != ''">
- AND smallTypeID = #{smallTypeID}
- </if>
- </where>
- </select>
- <select id="getTinyTypeList" resultType="com.caimei.modules.product.entity.ProducTinyType">
- select * from tinytype
- <where>
- validFlag = 1
- <if test="smallTypeID != null and smallTypeID != ''">
- AND smallTypeID = #{smallTypeID}
- </if>
- <if test="smallTypeID != null and smallTypeID != ''">
- AND smallTypeID = #{smallTypeID}
- </if>
- </where>
- </select>
- <select id="getProductTypeNameAndID" resultType="map">
- select
- b.name AS bigTypeName,
- b.bigTypeID AS bigTypeID,
- s.name AS smallTypeName,
- s.smallTypeID AS smallTypeID,
- t.name AS tinyTypeName,
- t.tinyTypeID AS tinyTypeID
- from tinytype AS t
- join smalltype AS s on t.smallTypeID = s.smallTypeID
- JOIN bigtype AS b on b.bigTypeID = s.bigTypeID
- where t.tinyTypeID = #{tinyTypeID}
- </select>
- <delete id="deleteCustomClassification">
- delete from product_custom_classification
- where productID = #{productID}
- </delete>
- <insert id="insertCustomClassification" parameterType="com.caimei.modules.product.entity.ProductCustomClassification" keyProperty="userId" useGeneratedKeys="true">
- INSERT INTO product_custom_classification(
- productID,
- bigTypeID,
- smallTypeID,
- tinyTypeID,
- createDate,
- updateDate
- ) VALUES (
- #{productID},
- #{bigTypeID},
- #{smallTypeID},
- #{tinyTypeID},
- #{createDate},
- #{updateDate}
- )
- </insert>
- <insert id="insertAddProduct">
- INSERT INTO cm_search_recommend_product(
- productID,
- tinyTypeID,
- sort,
- delFlag
- ) VALUES (
- #{productID},
- #{tinyTypeID},
- 0,
- 0
- )
- </insert>
- <insert id="insertLadderPrice">
- insert into product_ladder_price (productId, userType, ladderNum,
- buyNum, buyPrice, createBy, createDate, delFlag)
- values (#{productId}, 3, #{ladderNum},
- #{buyNum}, #{buyPrice}, #{createBy},
- #{createDate},'0')
- </insert>
- <insert id="insertProduct" keyColumn="productID" keyProperty="productID" parameterType="com.caimei.modules.product.entity.Product" useGeneratedKeys="true">
- INSERT INTO `product` (
- `brandID`,
- `tinyTypeID`,
- `classifyId`,
- <if test="productCategory != null and productCategory != '' ">
- `productCategory`,
- </if>
- `preferredFlag`,
- `selfTypeID`,
- `shopID`,
- `name`,
- `aliasName`,
- `searchKey`,
- `productRemarks`,
- `normalPrice`,
- `price`,
- `highestUserLevelPrice`,
- `lowestUserLevelPrice`,
- `lowestUserLevelID`,
- `price0`,
- `price0Grade`,
- `price0Text`,
- `price0TextFlag`,
- `price1`,
- `price1Grade`,
- `price1Text`,
- `price1TextFlag`,
- `price8`,
- `price8Grade`,
- `price8Text`,
- `price8TextFlag`,
- `ladderPriceFlag`,
- `price2`,
- `price3`,
- `price4`,
- `price5`,
- `price6`,
- `price7`,
- `fee`,
- `stock`,
- `hasSkuFlag`,
- `mainImage`,
- `propertiesInfo`,
- `addTime`,
- `updateTime`,
- `classifyAddTime`,
- `weekSellNumber`,
- `beforeValidFlag`,
- `validFlag`,
- `favoriteTimes`,
- `commentScore`,
- `commentTimes`,
- `selfRecommendFlag`,
- `sysRecommendFlag`,
- `sortIndex`,
- `featuredFlag`,
- `featuredSortIndex`,
- `productCode`,
- `rate1`,
- `rate2`,
- `unit`,
- `synToERPFlag`,
- `allAreaFlag`,
- `provinceIDs`,
- `serviceNumber`,
- `maxBuyNumber`,
- `virtualFlag`,
- `minBuyNumber`,
- `packageCount`,
- `byFlag`,
- `normalProductFlag`,
- `wholeSaleProductFlag`,
- `promotionProductFlag`,
- `groupBuyProductFlag`,
- `step`,
- `speCommisionFlag`,
- `speCommision`,
- `videourl`,
- `props`,
- `providers`,
- `serviceCommissionRatio`,
- `reCommissionRatio`,
- `pushToERPName`,
- `prodBeans`,
- `useBeansFlag`,
- `privateFlag`,
- `invisibleServiceProviderIDs`,
- `displayOnCRMFlag`,
- `needServiceFlag`,
- `actFlag`,
- `actStatus`,
- `actSort`,
- `actPrice0`,
- `actPrice1`,
- `actPrice2`,
- `actPrice3`,
- `actPrice4`,
- `actPrice5`,
- `actPrice6`,
- `actPrice7`,
- `actType`,
- `actCreateTime`,
- `actFullReduceAmount`,
- `actReduceAmount`,
- `visibility`,
- `actFullGiftAmount`,
- `actBuyGiftNum`,
- `beginTime`,
- `endTime`,
- `shopIndexModuleID`,
- `onlineTime`,
- `downlineTime`,
- `freePostFlag`,
- `crmBigTypeId`,
- `crmSmallTypeId`,
- `costPrice`,
- `costProportional`,
- `costCheckFlag`,
- `precisehKey`,
- `docBoost`,
- `cmbeanFlag`,
- `cmbeanPrice`,
- `cmbeanSort`,
- `tags`,
- `surplusTime`,
- `productType`,
- `machineType`,
- `qualificationImg`,
- `includedTax`,
- `taxPoint`,
- `invoiceType`,
- `recommendType`,
- `priceType`,
- `combinationID`,
- `combinationSort`
- )
- VALUES
- (
- #{brandID},
- #{tinyTypeID},
- #{classifyId},
- <if test="productCategory != null and productCategory != '' ">
- #{productCategory},
- </if>
- #{preferredFlag},
- #{selfTypeID},
- #{shopID},
- #{name},
- #{aliasName},
- #{searchKey},
- #{productRemarks},
- #{normalPrice},
- #{price},
- #{highestUserLevelPrice},
- #{lowestUserLevelPrice},
- #{lowestUserLevelID},
- #{price0},
- #{price0Grade},
- #{price0Text},
- #{price0TextFlag},
- #{price1},
- #{price1Grade},
- #{price1Text},
- #{price1TextFlag},
- #{price8},
- #{price8Grade},
- #{price8Text},
- #{price8TextFlag},
- #{ladderPriceFlag},
- #{price2},
- #{price3},
- #{price4},
- #{price5},
- #{price6},
- #{price7},
- #{fee},
- #{stock},
- #{hasSkuFlag},
- #{mainImage},
- #{propertiesInfo},
- #{addTime},
- #{updateTime},
- #{classifyAddTime},
- #{weekSellNumber},
- #{beforeValidFlag},
- #{validFlag},
- #{favoriteTimes},
- #{commentScore},
- #{commentTimes},
- #{selfRecommendFlag},
- #{sysRecommendFlag},
- #{sortIndex},
- #{featuredFlag},
- #{featuredSortIndex},
- #{productCode},
- #{rate1},
- #{rate2},
- #{unit},
- #{synToERPFlag},
- #{allAreaFlag},
- #{provinceIDs},
- #{serviceNumber},
- #{maxBuyNumber},
- #{virtualFlag},
- #{minBuyNumber},
- #{packageCount},
- #{byFlag},
- #{normalProductFlag},
- #{wholeSaleProductFlag},
- #{promotionProductFlag},
- #{groupBuyProductFlag},
- #{step},
- #{speCommisionFlag},
- #{speCommision},
- #{videourl},
- #{props},
- #{providers},
- #{serviceCommissionRatio},
- #{reCommissionRatio},
- #{pushToERPName},
- #{prodBeans},
- #{useBeansFlag},
- #{privateFlag},
- #{invisibleServiceProviderIDs},
- #{displayOnCRMFlag},
- #{needServiceFlag},
- #{actFlag},
- #{actStatus},
- #{actSort},
- #{actPrice0},
- #{actPrice1},
- #{actPrice2},
- #{actPrice3},
- #{actPrice4},
- #{actPrice5},
- #{actPrice6},
- #{actPrice7},
- #{actType},
- #{actCreateTime},
- #{actFullReduceAmount},
- #{actReduceAmount},
- #{visibility},
- #{actFullGiftAmount},
- #{actBuyGiftNum},
- #{beginTime},
- #{endTime},
- #{shopIndexModuleID},
- #{onlineTime},
- #{downlineTime},
- #{freePostFlag},
- #{crmBigTypeId},
- #{crmSmallTypeId},
- #{costPrice},
- #{costProportional},
- #{costCheckFlag},
- #{precisehKey},
- #{docBoost},
- #{cmbeanFlag},
- #{cmbeanPrice},
- #{cmbeanSort},
- #{tags},
- #{surplusTime},
- #{productType},
- #{machineType},
- #{qualificationImg},
- #{includedTax},
- #{taxPoint},
- #{invoiceType},
- #{recommendType},
- #{priceType},
- #{combinationID},
- #{combinationSort}
- )
- </insert>
- <insert id="insertProductDetailInfo">
- insert into productdetailinfo
- <trim prefix="(" suffix=")" suffixOverrides=",">
- <if test="productID != null">
- `productID`,
- </if>
- <if test="detailInfo != null and detailInfo != ''">
- `detailInfo`,
- </if>
- <if test="serviceInfo != null and serviceInfo != ''">
- `serviceInfo`,
- </if>
- <if test="orderInfo != null and orderInfo != ''">
- `orderInfo`,
- </if>
- </trim>
- <trim prefix="values (" suffix=")" suffixOverrides=",">
- <if test="productID != null">
- #{productID},
- </if>
- <if test="detailInfo != null and detailInfo != ''">
- #{detailInfo},
- </if>
- <if test="serviceInfo != null and serviceInfo != ''">
- #{serviceInfo},
- </if>
- <if test="orderInfo != null and orderInfo != ''">
- #{orderInfo},
- </if>
- </trim>
- </insert>
- <select id="getrecommendProductList" resultType="product">
- select
- a.*,
- csrp.sort AS sort,
- csrp.id AS recommendProductId,
- b.name AS brandName,
- s.name AS shopName
- FROM
- cm_search_recommend_product csrp
- LEFT JOIN product a on a.productID = csrp.productID
- LEFT JOIN shop s on s.shopID = a.shopID
- left join cm_brand b on b.id = a.brandID
- WHERE
- csrp.tinyTypeId = #{tinyTypeID}
- <if test="name != null and name != ''">
- AND a.name like concat('%', #{name} ,'%')
- </if>
- <if test="validFlag !=null and validFlag !=''">
- AND a.validFlag=#{validFlag}
- </if>
- <if test="shopName != null and shopName != ''">
- AND s.name like concat('%', #{shopName} ,'%')
- </if>
- <if test="brandName != null and brandName != ''">
- AND b.name like concat('%', #{brandName} ,'%')
- </if>
- and a.productCategory = 1
- AND a.validFlag != 0
- AND csrp.delFlag =0
- ORDER BY csrp.sort DESC
- </select>
- <select id="relatedProductList" resultType="product">
- select
- <include refid="productColumns"/>,
- b.name AS brandName,
- (case when a.tinyTypeID = #{tinyTypeID} then '1' else '0' end) AS defaultType
- FROM product a
- <include refid="productJoins"/>
- left join brand b on b.brandID = a.brandID
- WHERE (a.productID
- IN (select productID from product_custom_classification where tinyTypeID = #{tinyTypeID})
- OR a.tinyTypeID = #{tinyTypeID})
- <if test="name != null and name != ''">
- AND a.name like concat('%', #{name} ,'%')
- </if>
- <if test="validFlag !=null and validFlag !=''">
- AND a.validFlag=#{validFlag}
- </if>
- <if test="shopName != null and shopName != ''">
- AND s.name like concat('%', #{shopName} ,'%')
- </if>
- <if test="brandName != null and brandName != ''">
- AND b.name like concat('%', #{brandName} ,'%')
- </if>
- AND a.validFlag != 0
- and a.productCategory = 1
- </select>
- <delete id="deleteProductCustomClassification">
- delete from product_custom_classification
- where productID = #{productID} and tinyTypeID = #{tinyTypeID}
- </delete>
- <delete id="deleteLadderPriceByProductId">
- DELETE FROM product_ladder_price where productId = #{productID}
- </delete>
- <delete id="deleteLadderPriceById">
- DELETE FROM product_ladder_price where id = #{id}
- </delete>
- <select id="toAddProductCustomClassificationList" resultType="product">
- select
- <include refid="productColumns"/>,
- b.name AS brandName
- FROM product a
- <include refid="productJoins"/>
- left join cm_brand b on b.id = a.brandID
- WHERE a.tinyTypeID != #{tinyTypeID}
- and not exists
- (select pcc.id from product_custom_classification pcc where pcc.productID = a.productID and pcc.tinyTypeID = #{tinyTypeID})
- and a.validFlag = '2'
- and (select count(id) from product_custom_classification pcc where pcc.productID = a.productID) <![CDATA[ < ]]> 5
- <if test="name != null and name != ''">
- and a.name like concat('%', #{name} ,'%')
- </if>
- <if test="shopName != null and shopName != ''">
- AND s.name like concat('%', #{shopName} ,'%')
- </if>
- <if test="brandName != null and brandName != ''">
- AND b.name like concat('%', #{brandName} ,'%')
- </if>
- </select>
- <select id="toAddProductList" resultType="product">
- select
- a.*,
- b.name AS brandName,
- s.name AS shopName
- FROM product a
- LEFT JOIN shop s on s.shopID = a.shopID
- left join cm_brand b on b.id = a.brandID
- WHERE
- NOT EXISTS (select * from cm_search_recommend_product csrp where csrp.productID = a.productID and csrp.tinyTypeID = #{tinyTypeID} AND csrp.delFlag = 0)
- and a.validFlag = '2'
- <if test="name != null and name != ''">
- and a.name like concat('%', #{name} ,'%')
- </if>
- <if test="shopName != null and shopName != ''">
- AND s.name like concat('%', #{shopName} ,'%')
- </if>
- <if test="brandName != null and brandName != ''">
- AND b.name like concat('%', #{brandName} ,'%')
- </if>
- and a.productCategory = 1
- </select>
- <select id="getProductTypes" resultType="com.caimei.modules.product.entity.ProductCustomClassification">
- select *
- from product_custom_classification where productID = #{productID}
- </select>
- <select id="findRecommendActivityListPage" resultType="Product">
- SELECT
- <include refid="productColumns"/>
- FROM product a
- <include refid="ActivityJoins"/>
- <where>
- <if test="id !=null and id !=''">
- AND a.productID=#{id}
- </if>
- <if test="tinyTypeID != null and tinyTypeID != ''">
- AND a.tinyTypeID = #{tinyTypeID}
- </if>
- <if test="smallTypeID != null and smallTypeID != ''">
- AND a.smallTypeID = #{smallTypeID}
- </if>
- <if test="bigTypeID != null and bigTypeID != ''">
- AND a.bigTypeID = #{bigTypeID}
- </if>
- <if test="shopID != null and shopID != ''">
- AND a.shopID = #{shopID}
- </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="cmbeanFlag != null and cmbeanFlag != ''">
- AND a.cmbeanFlag = #{cmbeanFlag}
- </if>
- <if test="actFlag !=null and actFlag !=''">
- AND a.actFlag=#{actFlag}
- </if>
- <if test="sqlMap !=null and sqlMap !=''">
- ${sqlMap.dsf}
- </if>
- AND a.validFlag = 2
- AND (a.actType != 3 or a.`actType` IS NULL or (a.actType = 3 and STR_TO_DATE(a.endTime,'%Y-%m-%d %H:%i') <![CDATA[ < ]]> STR_TO_DATE(SYSDATE(),'%Y-%m-%d %H:%i')))
- AND a.shopID not in (SELECT s.`value` FROM `sys_dict` s WHERE s.type='heheShopID')
- and a.productCategory = 1
- </where>
- <choose>
- <when test="page !=null and page.orderBy != null and page.orderBy != ''">
- ORDER BY ${page.orderBy}
- </when>
- <otherwise>
- order by case WHEN a.validFlag = 1 then 0 else 1 END asc,a.productID desc
- </otherwise>
- </choose>
- </select>
- <select id="findGroupActivityListPage" resultType="Product">
- SELECT
- <include refid="productColumns"/>
- FROM product a
- <include refid="ActivityJoins"/>
- <where>
- <if test="id !=null and id !=''">
- AND a.productID=#{id}
- </if>
- <if test="tinyTypeID != null and tinyTypeID != ''">
- AND a.tinyTypeID = #{tinyTypeID}
- </if>
- <if test="smallTypeID != null and smallTypeID != ''">
- AND a.smallTypeID = #{smallTypeID}
- </if>
- <if test="bigTypeID != null and bigTypeID != ''">
- AND a.bigTypeID = #{bigTypeID}
- </if>
- <if test="shopID != null and shopID != ''">
- AND a.shopID = #{shopID}
- </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="cmbeanFlag != null and cmbeanFlag != ''">
- AND a.cmbeanFlag = #{cmbeanFlag}
- </if>
- <if test="actFlag !=null and actFlag !=''">
- AND a.actFlag=#{actFlag}
- </if>
- <if test="actStatus != null and actStatus != '' and actStatus == 1">
- AND STR_TO_DATE(SYSDATE(),'%Y-%m-%d %H:%i') <![CDATA[ < ]]> STR_TO_DATE(a.beginTime,'%Y-%m-%d %H:%i')
- </if>
- <if test="actStatus != null and actStatus != '' and actStatus == 2">
- AND STR_TO_DATE(SYSDATE(),'%Y-%m-%d %H:%i') <![CDATA[ > ]]> STR_TO_DATE(a.beginTime,'%Y-%m-%d %H:%i')
- AND STR_TO_DATE(SYSDATE(),'%Y-%m-%d %H:%i') <![CDATA[ < ]]> STR_TO_DATE(a.endTime,'%Y-%m-%d %H:%i')
- </if>
- <if test="sqlMap !=null and sqlMap !=''">
- ${sqlMap.dsf}
- </if>
- AND a.validFlag = 2
- AND ((a.actType != 1 AND a.actType != 2 OR a.`actType` IS NULL) or a.actFlag = 0)
- AND a.shopID not in (SELECT s.`value` FROM `sys_dict` s WHERE s.type='heheShopID')
- and a.productCategory = 1
- </where>
- <choose>
- <when test="page !=null and page.orderBy != null and page.orderBy != ''">
- ORDER BY ${page.orderBy}
- </when>
- <otherwise>
- order by case WHEN a.validFlag = 1 then 0 else 1 END asc,a.productID desc
- </otherwise>
- </choose>
- </select>
- <select id="findBigTypeList" resultType="com.caimei.modules.product.entity.ProductBigType">
- SELECT
- *
- FROM bigtype a
- <where>
- <if test="bigTypeID != null and bigTypeID != ''">
- AND a.bigTypeID = #{bigTypeID}
- </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>
- </where>
- </select>
- <select id="findSmallTypeList" resultType="com.caimei.modules.product.entity.ProductSmallType">
- SELECT
- *
- FROM smalltype a
- <where>
- <if test="smallTypeID != null and smallTypeID != ''">
- AND a.smallTypeID = #{smallTypeID}
- </if>
- <if test="bigTypeID != null and bigTypeID != ''">
- AND a.bigTypeID = #{bigTypeID}
- </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>
- </where>
- </select>
- <select id="findTinyTypeList" resultType="com.caimei.modules.product.entity.ProducTinyType">
- SELECT
- *
- FROM tinytype a
- <where>
- <if test="tinyTypeID != null and tinyTypeID != ''">
- AND a.tinyTypeID = #{tinyTypeID}
- </if>
- <if test="smallTypeID != null and smallTypeID != ''">
- AND a.smallTypeID = #{smallTypeID}
- </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>
- </where>
- </select>
- <select id="findProductRecommendList" resultType="com.caimei.modules.product.entity.CmProductRecommend">
- select
- cpr.id AS id,
- cpr.productID AS productID,
- cpr.recommendProductID AS recommendProductID,
- cpr.sort AS sort,
- pro.name AS productName,
- pro.unit AS unit,
- pro.mainImage AS img,
- cpr.shopName AS shopName
- from cm_product_recommend cpr
- join product pro on cpr.recommendProductID = pro.productID
- where cpr.productID = #{productID}
- order by cpr.sort desc
- </select>
- <select id="findProductRecommendCount" resultType="int">
- select
- count(1)
- from cm_product_recommend cpr
- where cpr.productID = #{productID}
- </select>
- <select id="findProductList" resultType="com.caimei.modules.product.entity.CmProductRecommend">
- select
- a.productID AS productID,
- a.name AS productName,
- a.unit AS unit,
- a.mainImage AS img,
- s.name AS shopName
- from product a
- <include refid="ActivityJoins"/>
- <where>
- <choose>
- <when test="commodityType != null and commodityType != ''">
- AND a.commodityType = #{commodityType}
- </when>
- <when test="bigTypeID != null and bigTypeID != ''">
- AND a.bigTypeID = #{bigTypeID}
- </when>
- <when test="smallTypeID != null and smallTypeID != ''">
- AND a.smallTypeID = #{smallTypeID}
- </when>
- <when test="tinyTypeID != null and tinyTypeID != ''">
- AND a.tinyTypeID = #{tinyTypeID}
- </when>
- </choose>
- <if test="productName != null and productName != ''">
- and a.name like concat('%', #{productName} ,'%')
- </if>
- <if test="shopName != null and shopName != ''">
- and s.name like concat('%', #{shopName} ,'%')
- </if>
- and a.productCategory = 1
- </where>
- <!-- limit 0, 10-->
- </select>
- <update id="updateRecommendType">
- UPDATE product SET
- recommendType = #{recommendType}
- WHERE productID = #{productID}
- </update>
- <update id="updateBrnadId">
- UPDATE product_new
- set brandID = #{brandID}
- WHERE productID = #{productID}
- </update>
- <update id="updateProductByBrandId">
- UPDATE product
- set brandID = null
- WHERE brandID = #{brandId}
- </update>
- <update id="updateTinyType">
- UPDATE product_new
- set tinyTypeID = #{tinyTypeID}
- WHERE productID = #{productID}
- </update>
- <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="highestUserLevelPrice != null and highestUserLevelPrice !=''">
- highestUserLevelPrice = #{highestUserLevelPrice},
- </if>
- <if test="lowestUserLevelPrice != null and lowestUserLevelPrice !=''">
- lowestUserLevelPrice = #{lowestUserLevelPrice},
- </if>
- <if test="lowestUserLevelID != null and lowestUserLevelID !=''">
- lowestUserLevelID = #{lowestUserLevelID},
- </if>
- <if test="price0 != null and price0 !=''">
- price0 = #{price0},
- </if>
- <if test="price0Grade != null and price0Grade !=''">
- price0Grade = #{price0Grade},
- </if>
- <if test="price0Text != null and price0Text !=''">
- price0Text = #{price0Text},
- </if>
- <if test="price0TextFlag != null and price0TextFlag !=''">
- price0TextFlag = #{price0TextFlag},
- </if>
- <if test="price1 != null and price1 !=''">
- price1 = #{price1},
- </if>
- <if test="price1Grade != null and price1Grade !=''">
- price1Grade = #{price1Grade},
- </if>
- <if test="price1Text != null and price1Text !=''">
- price1Text = #{price1Text},
- </if>
- <if test="price1TextFlag != null and price1TextFlag !=''">
- price1TextFlag = #{price1TextFlag},
- </if>
- <if test="price8 != null and price8 !=''">
- price8 = #{price8},
- </if>
- <if test="price8Grade != null and price8Grade !=''">
- price8Grade = #{price8Grade},
- </if>
- <if test="price8Text != null and price8Text !=''">
- price8Text = #{price8Text},
- </if>
- <if test="price8TextFlag != null and price8TextFlag !=''">
- price8TextFlag = #{price8TextFlag},
- </if>
- <if test="ladderPriceFlag != null and ladderPriceFlag !=''">
- ladderPriceFlag = #{ladderPriceFlag},
- </if>
- <if test="price2 != null and price2 !=''">
- price2 = #{price2},
- </if>
- <if test="price3 != null and price3 !=''">
- price3 = #{price3},
- </if>
- <if test="price4 != null and price4 !=''">
- price4 = #{price4},
- </if>
- <if test="price5 != null and price5 !=''">
- price5 = #{price5},
- </if>
- <if test="price6 != null and price6 !=''">
- price6 = #{price6},
- </if>
- <if test="price7 != null and price7 !=''">
- price7 = #{price7},
- </if>
- <if test="fee != null and fee !=''">
- fee = #{fee},
- </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="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="rate1 != null and rate1 !=''">
- rate1 = #{rate1},
- </if>
- <if test="rate2 != null and rate2 !=''">
- rate2 = #{rate2},
- </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="virtualFlag != null and virtualFlag !=''">
- virtualFlag = #{virtualFlag},
- </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="speCommisionFlag != null and speCommisionFlag !=''">
- speCommisionFlag = #{speCommisionFlag},
- </if>
- <if test="speCommision != null and speCommision !=''">
- speCommision = #{speCommision},
- </if>
- <if test="videourl != null and videourl !=''">
- videourl = #{videourl},
- </if>
- <if test="props != null and props !=''">
- props = #{props},
- </if>
- <if test="providers != null and providers !=''">
- providers = #{providers},
- </if>
- <if test="serviceCommissionRatio != null and serviceCommissionRatio !=''">
- serviceCommissionRatio = #{serviceCommissionRatio},
- </if>
- <if test="reCommissionRatio != null and reCommissionRatio !=''">
- reCommissionRatio = #{reCommissionRatio},
- </if>
- <if test="pushToERPName != null and pushToERPName !=''">
- pushToERPName = #{pushToERPName},
- </if>
- <if test="prodBeans != null and prodBeans !=''">
- prodBeans = #{prodBeans},
- </if>
- <if test="useBeansFlag != null and useBeansFlag !=''">
- useBeansFlag = #{useBeansFlag},
- </if>
- <if test="privateFlag != null and privateFlag !=''">
- privateFlag = #{privateFlag},
- </if>
- <if test="invisibleServiceProviderIDs != null and invisibleServiceProviderIDs !=''">
- invisibleServiceProviderIDs = #{invisibleServiceProviderIDs},
- </if>
- <if test="displayOnCRMFlag != null and displayOnCRMFlag !=''">
- displayOnCRMFlag = #{displayOnCRMFlag},
- </if>
- <if test="needServiceFlag != null and needServiceFlag !=''">
- needServiceFlag = #{needServiceFlag},
- </if>
- <if test="actFlag != null and actFlag !=''">
- actFlag = #{actFlag},
- </if>
- <if test="actSort != null and actSort !=''">
- actSort = #{actSort},
- </if>
- <if test="actPrice0 != null and actPrice0 !=''">
- actPrice0 = #{actPrice0},
- </if>
- <if test="actPrice1 != null and actPrice1 !=''">
- actPrice1 = #{actPrice1},
- </if>
- <if test="actPrice2 != null and actPrice2 !=''">
- actPrice2 = #{actPrice2},
- </if>
- <if test="actPrice3 != null and actPrice3 !=''">
- actPrice3 = #{actPrice3},
- </if>
- <if test="actPrice4 != null and actPrice4 !=''">
- actPrice4 = #{actPrice4},
- </if>
- <if test="actPrice5 != null and actPrice5 !=''">
- actPrice5 = #{actPrice5},
- </if>
- <if test="actPrice6 != null and actPrice6 !=''">
- actPrice6 = #{actPrice6},
- </if>
- <if test="actPrice7 != null and actPrice7 !=''">
- actPrice7 = #{actPrice7},
- </if>
- <if test="actType != null and actType !=''">
- actType = #{actType},
- </if>
- <if test="actCreateTime != null and actCreateTime !=''">
- actCreateTime = #{actCreateTime},
- </if>
- <if test="beginTime != null and beginTime !=''">
- beginTime = #{beginTime},
- </if>
- <if test="endTime != null and endTime !=''">
- endTime = #{endTime},
- </if>
- <if test="shopIndexModuleID != null and shopIndexModuleID !=''">
- shopIndexModuleID = #{shopIndexModuleID},
- </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="crmBigTypeId != null and crmBigTypeId !=''">
- crmBigTypeId = #{crmBigTypeId},
- </if>
- <if test="crmSmallTypeId != null and crmSmallTypeId !=''">
- crmSmallTypeId = #{crmSmallTypeId},
- </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="docBoost != null and docBoost !=''">
- docBoost = #{docBoost},
- </if>
- <if test="cmbeanFlag != null and cmbeanFlag !=''">
- cmbeanFlag = #{cmbeanFlag},
- </if>
- <if test="cmbeanPrice != null and cmbeanPrice !=''">
- cmbeanPrice = #{cmbeanPrice},
- </if>
- <if test="cmbeanSort != null and cmbeanSort !=''">
- cmbeanSort = #{cmbeanSort},
- </if>
- <if test="actBuyGiftNum != null and actBuyGiftNum !=''">
- actBuyGiftNum = #{actBuyGiftNum},
- </if>
- <if test="actFullGiftAmount != null and actFullGiftAmount !=''">
- actFullGiftAmount = #{actFullGiftAmount},
- </if>
- <if test="actFullReduceAmount != null and actFullReduceAmount !=''">
- actFullReduceAmount = #{actFullReduceAmount},
- </if>
- <if test="actReduceAmount != null and actReduceAmount !=''">
- actReduceAmount = #{actReduceAmount},
- </if>
- <if test="visibility != null and visibility !=''">
- visibility = #{visibility},
- </if>
- <if test="surplusTime != null and surplusTime !=''">
- surplusTime = #{surplusTime},
- </if>
- <if test="productType != null and productType !=''">
- productType = #{productType},
- </if>
- <if test="qualificationImg != null and qualificationImg !=''">
- qualificationImg = #{qualificationImg},
- </if>
- <if test="qualificationImg != null and qualificationImg !=''">
- qualificationImg = #{qualificationImg},
- </if>
- <if test="invoiceType != null and invoiceType !=''">
- invoiceType = #{invoiceType},
- </if>
- <if test="taxPoint != null and taxPoint !=''">
- taxPoint = #{taxPoint},
- </if>
- <if test="supplierTaxPoint != null and supplierTaxPoint !=''">
- supplierTaxPoint = #{supplierTaxPoint},
- </if>
- <if test="endTimeStr != null and endTimeStr !=''">
- endTimeStr = #{endTimeStr},
- </if>
- <if test="priceType != null and priceType !=''">
- priceType = #{priceType},
- </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="includedTax != null and includedTax !=''">
- includedTax = #{includedTax},
- </if>
- <if test="invoiceType != null and invoiceType !=''">
- invoiceType = #{invoiceType},
- </if>
- <if test="commodityType != null and commodityType != ''">
- commodityType = #{commodityType},
- </if>
- <if test="trainingMethod != null">
- trainingMethod = #{trainingMethod},
- </if>
- <if test="trainingType != null">
- trainingType = #{trainingType},
- </if>
- <if test="trainingFee != null">
- trainingFee = #{trainingFee},
- </if>
- </set>
- where productID = #{productID}
- </update>
- <update id="updateproductDetailInfo" parameterType="com.caimei.modules.product.entity.ProductDetailInfo">
- update productdetailinfo
- <set>
- <if test="propValueAlias != null and propValueAlias != ''">
- propValueAlias = #{propValueAlias},
- </if>
- <if test="propValueImages != null and propValueImages !=''">
- propValueImages = #{propValueImages},
- </if>
- <if test="detailInfo != null">
- detailInfo = #{detailInfo},
- </if>
- <if test="detailInfoTxt != null">
- detailInfoTxt = #{detailInfoTxt},
- </if>
- <if test="seoTitle != null and seoTitle !=''">
- seoTitle = #{seoTitle},
- </if>
- <if test="seoKeyword != null and seoKeyword !=''">
- seoKeyword = #{seoKeyword},
- </if>
- <if test="seoDes != null and seoDes !=''">
- seoDes = #{seoDes},
- </if>
- <if test="serviceInfo != null ">
- serviceInfo = #{serviceInfo},
- </if>
- <if test="orderInfo != null ">
- orderInfo = #{orderInfo},
- </if>
- </set>
- where productID = #{productID}
- </update>
- <update id="updateLadderPrice">
- update product_ladder_price
- set productId = #{productId},
- ladderNum = #{ladderNum},
- buyNum = #{buyNum},
- buyPrice = #{buyPrice},
- updateBy = #{updateBy},
- updateDate = #{updateDate},
- delFlag = #{delFlag}
- where id = #{id}
- </update>
- <select id="getProductByTypeName" resultType="com.caimei.modules.brand.entity.BrandAndProductType">
- select
- b.name AS "bigTypeName",b.bigTypeID,s.`name` AS "smallTypeName",s.smalltypeID,t.name AS "tinyTypeName" ,t.tinytypeID
- from tinytype_new t LEFT JOIN smalltype_new s on t.smallTypeID = s.smallTypeID LEFT JOIN bigtype_new b ON b.bigTypeID = s.bigTypeID
- where b.`name` = #{name} AND s.`name` = #{name1} AND t.name = #{name2}
- </select>
- <select id="findRecommendBySys" resultType="com.caimei.modules.product.entity.CmProductRecommend">
- select
- p.productID AS recommendProductID,
- p.name AS productName,
- p.unit AS unit,
- p.mainImage AS img,
- s.name AS shopName
- from product p
- left join shop s on s.shopID = p.shopID
- where p.tinyTypeID = #{tinyTypeID} and p.productCategory = 1
- order by p.sellNumber
- desc limit 0, 7
- </select>
- <select id="getSecondHandRecommend" resultType="CmSecondHandRecommendVo">
- select p.productID AS id,
- 1 AS type,
- p.name AS name,
- p.unit AS unit,
- p.mainImage AS img,
- s.name AS shopName,
- p.productCategory as "productCategory"
- from product p
- left join shop s on s.shopID = p.shopID
- where p.productID = #{productID}
- AND p.validFlag = '2'
- </select>
- <select id="querySecondHandRecommend" resultType="CmSecondHandRecommendVo">
- select
- p.productID AS id,
- 1 AS type,
- p.name AS name,
- p.unit AS unit,
- p.mainImage AS img,
- s.name AS shopName,
- p.productCategory as "productCategory"
- from product p
- left join shop s on s.shopID = p.shopID
- <where>
- <if test="productID != null and productID != ''">
- p.productID = #{productID}
- </if>
- <if test="productName != null and productName != ''">
- and p.name like concat('%', #{productName} ,'%')
- </if>
- AND p.validFlag = '2'
- and p.productCategory = #{queryProductType}
- </where>
- limit 0, 10
- </select>
- <select id="queryProductDetailInfo" resultType="com.caimei.modules.product.entity.ProductDetailInfo">
- SELECT * FROM
- productdetailinfo
- where productID = #{productID}
- </select>
- <select id="findProductLadderPrice" resultType="com.caimei.po.ProductLadderPrice">
- SELECT *
- FROM product_ladder_price
- WHERE
- productId = #{productId}
- AND userType = #{userType}
- AND buyNum is NOT null
- AND buyPrice is NOT null
- AND delFlag = 0
- ORDER BY ladderNum ASC
- </select>
- <select id="findActList" resultType="com.caimei.modules.product.entity.Product">
- SELECT
- <include refid="productColumns"/>
- FROM product a
- <include refid="productJoins"/>
- <where>
- <if test="id !=null and id !=''">
- AND a.productID=#{id}
- </if>
- <if test="shopID != null and shopID != ''">
- AND a.shopID = #{shopID}
- </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>
- AND a.actStatus = 1
- and a.productCategory = 1
- </where>
- <choose>
- <when test="page !=null and page.orderBy != null and page.orderBy != ''">
- ORDER BY ${page.orderBy}
- </when>
- <otherwise>
- order by case WHEN a.validFlag = 1 then 0 else 1 END asc,a.productID desc
- </otherwise>
- </choose>
- </select>
- <select id="findAllProduct" resultType="com.caimei.modules.product.entity.Product">
- select p.productID,p.mainImage,p.name,s.name as shopName from product p left join shop s on p.shopID = s.shopID
- <where>
- (p.actFlag=0 or p.actType is null) and p.validFlag = 2 and p.productCategory = 1
- <if test="productIds != null and productIds != '' ">
- and p.productID != #{productIds}
- </if>
- <if test="productID != null and productID != ''">
- and p.productID = #{productID}
- </if>
- <if test="name != null and name != ''">
- and p.name like concat('%',#{name},'%')
- </if>
- <if test="shopName != null and shopName != ''">
- and s.name like concat('%',#{shopName},'%')
- </if>
- </where>
- order by productID asc
- </select>
- <select id="findProductImage" resultType="com.caimei.modules.product.entity.Product">
- SELECT
- <include refid="productColumns"/>
- FROM product a
- <include refid="productJoins"/>
- <where>
- <if test="productID !=null">
- AND a.productID=#{productID}
- </if>
- <if test="shopID != null and shopID != ''">
- AND a.shopID = #{shopID}
- </if>
- <if test="name != null and name != ''">
- AND a.name LIKE concat('%',#{name},'%')
- </if>
- <if test="shopName != null and shopName != ''">
- AND s.name LIKE concat('%',#{shopName},'%')
- </if>
- <if test="validFlag !=null and validFlag !=''">
- AND a.validFlag=#{validFlag}
- </if>
- <if test="productCategory !=null and productCategory !=''">
- AND a.productCategory=#{productCategory}
- </if>
- <if test="ids != null and ids.size() > 0">
- AND a.productID NOT IN
- <foreach collection="ids" close=")" separator="," open="(" item="id">
- #{id}
- </foreach>
- </if>
- </where>
- <choose>
- <when test="page !=null and page.orderBy != null and page.orderBy != ''">
- ORDER BY ${page.orderBy}
- </when>
- <otherwise>
- order by a.productID asc
- </otherwise>
- </choose>
- </select>
- </mapper>
|