123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631 |
- <?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.module.product.dao.ProductModuleDao">
- <sql id="BigType_Column_List">
- bigTypeID, typeSort, `name`, bigTypeCode, wwwValidFlag, crmValidFlag, wwwIcon, crmIcon, addTime, sortIndex
- </sql>
- <sql id="SmallType_Column_List">
- smallTypeID, bigTypeID, `name`, smallTypeCode, wwwValidFlag, crmValidFlag, wwwIcon, crmIcon, addTime, sortIndex
- </sql>
- <sql id="Tinytype_Column_List">
- tinyTypeID, smallTypeID, `name`, tinyTypeCode, wwwValidFlag, crmValidFlag, wwwIcon, crmIcon, addTime, sortIndex
- </sql>
- <sql id="Product_Column_List">
- productID, brandID,bigTypeID,smallTypeID, tinyTypeID,productCategory, preferredFlag, selfTypeID, shopID, `name`, aliasName, searchKey, productRemarks,
- normalPrice, price, highestUserLevelPrice, lowestUserLevelPrice, lowestUserLevelID,
- price0, price0Grade, price0Text, price0TextFlag, price1, price1Grade, price1Text,
- price1TextFlag, price8, price8Grade, price8Text, price8Text as beautyActFlag, price8TextFlag, ladderPriceFlag,
- price2, price3, price4, price5, price6, price7, fee, stock, hasSkuFlag, mainImage,
- propertiesInfo, addTime, updateTime, sellNumber, 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, beginTime, endTime, shopIndexModuleID, onlineTime,
- downlineTime, freePostFlag, crmBigTypeId, crmSmallTypeId, costPrice, costProportional,
- costCheckFlag, precisehKey, docBoost, cmbeanFlag, cmbeanPrice, cmbeanSort, actBuyGiftNum,
- actFullGiftAmount, actFullReduceAmount, actReduceAmount, visibility, surplusTime,
- priceType, tags, recommendType, machineType, taxPoint, supplierTaxPoint, includedTax,
- invoiceType,commodityType
- </sql>
- <sql id="ProductDetail_Column_List">
- productDetailInfoID, productID, propValueAlias, propValueImages, detailInfo, detailInfoTxt,
- seoTitle, seoKeyword, seoDes, serviceInfo, orderInfo
- </sql>
- <sql id="LadderPrice_Column_List">
- id, productId, userType, ladderNum, buyNum, buyPrice, createBy, createDate, updateBy,
- updateDate, delFlag
- </sql>
- <sql id="Image_Column_List">
- productImageID, productID, shopID, addTime, image, mainFlag, sortIndex
- </sql>
- <sql id="Shop_Column_List">
- s.shopID, s.userID, s.`name`, s.sname, s.nameEn, s.site, s.ledgerNo, s.logo, s.rebateAmount, s.`level`,
- s.score, s.productCount, s.legalPerson, s.businessLicense, s.businessLicenseImage, s.taxCertificate,
- s.taxCertificateImage, s.provinceID, s.cityID, s.townID, s.address, s.registeredCapital, s.nature,
- s.turnover, s.linkMan, s.contractPhone, s.contractMobile, s.fax, s.zipCode, s.linkMan1, s.duty1,
- s.contractPhone1, s.contractMobile1, s.contractQQ1, s.wechat1, s.contractEmail1, s.linkMan2,
- s.duty2, s.contractPhone2, s.contractMobile2, s.contractQQ2, s.wechat2, s.contractEmail2, s.`scope`,
- s.info, s.productDesc, s.lng, s.lat, s.addTime, s.auditStatus, s.auditTime, s.auditNote, s.favoriteTimes,
- s.validFlag, s.payFlag1, s.auditFlag1, s.payFlag2, s.auditFlag2, s.payFlag3, s.auditFlag3, s.note,
- s.`status`, s.sortIndex, s.rate1, s.rate2, s.masterFlag, s.erpFlag, s.shopSecret, s.masterLogo, s.cooperateFlag,
- s.bail, s.businessScope, s.socialCreditCode, s.mainpro, s.firstShopType, s.secondShopType, s.medicalPracticeLicenseImg1,
- s.medicalPracticeLicenseImg2, s.medicalPracticeLicenseImg3, s.bankAccount, s.bankAccountName,
- s.bankName, s.ableRebateAmount,s.authorizationCertificateImage
- </sql>
- <select id="getBigType" resultType="com.caimei.module.base.entity.vo.BigtypeVo">
- select
- <include refid="BigType_Column_List" />
- from bigtype
- where
- typeSort = #{typeSort}
- <if test="source == 'www'.toString()">
- and wwwValidFlag = '1'
- </if>
- <if test="source == 'crm'.toString()">
- and crmValidFlag = '1'
- </if>
- order by ifnull(sortIndex,10000) ASC,addTime DESC
- </select>
- <select id="getSmallType" resultType="com.caimei.module.base.entity.vo.SmalltypeVo">
- select
- <include refid="SmallType_Column_List" />
- from smalltype
- where bigTypeID = #{bigTypeID,jdbcType=INTEGER}
- <if test="source == 'www'.toString()">
- and wwwValidFlag = '1'
- </if>
- <if test="source == 'crm'.toString()">
- and crmValidFlag = '1'
- </if>
- order by ifnull(sortIndex,10000) ASC,addTime DESC
- </select>
- <select id="getTinytype" resultType="com.caimei.module.base.entity.vo.TinytypeVo">
- select
- <include refid="Tinytype_Column_List" />
- from tinytype
- where smallTypeID = #{smallTypeID,jdbcType=INTEGER}
- <if test="source == 'www'.toString()">
- and wwwValidFlag = '1'
- </if>
- <if test="source == 'crm'.toString()">
- and crmValidFlag = '1'
- </if>
- order by ifnull(sortIndex,10000) ASC,addTime DESC
- </select>
- <!-- sortType (3:价格升序, 4:价格降序, 7:人气, 8:销量) -->
- <select id="getProductsByTypeId" resultType="com.caimei.module.base.entity.vo.ProductVo" parameterType="java.lang.Integer">
- select
- <include refid="Product_Column_List" />
- from product
- <trim prefix="WHERE (" suffix=")" prefixOverrides="AND |OR ">
- <if test="bigTypeIDList != null and bigTypeIDList.size() > 0">
- OR bigTypeID in
- <foreach collection="bigTypeIDList" open="(" separator="," close=")" item="bigTypeID">
- #{bigTypeID}
- </foreach>
- </if>
- <if test="smallTypeIDList != null and smallTypeIDList.size() > 0">
- OR smallTypeID in
- <foreach collection="smallTypeIDList" open="(" separator="," close=")" item="smallTypeID">
- #{smallTypeID}
- </foreach>
- </if>
- <if test="tinyTypeIDList != null and tinyTypeIDList.size() > 0">
- OR tinyTypeID in
- <foreach collection="tinyTypeIDList" open="(" separator="," close=")" item="tinyTypeID">
- #{tinyTypeID}
- </foreach>
- </if>
- </trim>
- and validFlag = 2
- <choose>
- <when test="sortType == 1">
- order by price1 asc
- </when>
- <when test="sortType == 2">
- order by price1 desc
- </when>
- <when test="sortType == 3">
- order by favoriteTimes asc
- </when>
- <when test="sortType == 4">
- order by favoriteTimes desc
- </when>
- <when test="sortType == 5">
- order by sellNumber asc
- </when>
- <when test="sortType == 6">
- order by sellNumber desc
- </when>
- <otherwise>
- order by productID desc
- </otherwise>
- </choose>
- </select>
- <select id="searchProduct" resultType="com.caimei.module.base.entity.vo.ProductVo">
- select
- *
- from product
- where validFlag = 2
- and name like CONCAT('%',#{searchWord,jdbcType=VARCHAR},'%')
- </select>
- <select id="findProductById" resultType="com.caimei.module.base.entity.vo.ProductVo">
- select
- <include refid="Product_Column_List" />
- from product
- where validFlag in (2,3,9)
- and productId = #{productId,jdbcType=BIGINT}
- </select>
- <select id="findProductUnlimited" resultType="com.caimei.module.base.entity.vo.ProductVo">
- select
- <include refid="Product_Column_List" />
- from product
- where productId = #{productId,jdbcType=BIGINT}
- </select>
- <select id="getSearchHistoryList" resultType="com.caimei.module.base.entity.vo.SearchHistoryVo">
- select id, userId, searchWord, searchDate, delFlag
- from user_search_history
- where userId = #{userId,jdbcType=BIGINT}
- order by id desc
- </select>
- <select id="getSearchHistoryIdByWord" resultType="java.lang.Long">
- select id
- from user_search_history
- where searchWord = #{searchWord,jdbcType=VARCHAR}
- limit 1
- </select>
- <select id="findLowerLadderPrice" resultType="com.caimei.module.base.entity.vo.LadderPriceVo">
- select
- <include refid="LadderPrice_Column_List" />
- from product_ladder_price
- WHERE delFlag = '0'
- AND productId = #{productId,jdbcType=BIGINT}
- ORDER BY ladderNum DESC
- LIMIT 1
- </select>
- <select id="findProductImage" resultType="com.caimei.module.base.entity.vo.ProductImageVo">
- select
- <include refid="Image_Column_List" />
- from productimage
- where productID = #{productID,jdbcType=INTEGER}
- ORDER BY mainFlag DESC
- </select>
- <select id="findImageByProductId" resultType="String">
- select
- image
- from productimage
- where productID = #{productID,jdbcType=INTEGER}
- ORDER BY mainFlag DESC
- </select>
- <select id="findProductImageString" resultType="string">
- select
- image
- from productimage
- where productID = #{productID,jdbcType=INTEGER}
- ORDER BY mainFlag DESC
- </select>
- <select id="findProductDetailById" resultType="com.caimei.module.base.entity.vo.ProductDetailVo">
- select
- <include refid="ProductDetail_Column_List" />
- from productdetailinfo
- where productId = #{productId,jdbcType=BIGINT}
- </select>
- <select id="findProductShopById" resultType="com.caimei.module.base.entity.vo.ShopVo">
- SELECT
- <include refid="Shop_Column_List" />
- ,count(*) as normalNum
- FROM shop s
- left join product p on s.shopID = p.shopID and p.validFlag = 2
- where s.shopID = #{shopID,jdbcType=INTEGER}
- group by s.shopID
- </select>
- <select id="findProductNormalNumById" resultType="java.lang.Integer">
- SELECT
- count(*) as normalNum
- FROM product p
- where p.shopID = #{shopID,jdbcType=INTEGER}
- and p.validFlag = 2
- group by p.shopID
- </select>
- <!--新品上线(001) 优惠商品(010) 常用商品(100),三者同时存在111-->
- <select id="getProductsByPreferredFlag" resultType="com.caimei.module.base.entity.vo.ProductVo">
- select
- <include refid="Product_Column_List" />
- from product
- where validFlag = 2
- <if test="preferredFlag == 100">
- and preferredFlag in (100,101,110,111)
- </if>
- <if test="preferredFlag == 10">
- and preferredFlag in (10,11,110,111)
- </if>
- <if test="preferredFlag == 1">
- and preferredFlag in (1,11,101,111)
- </if>
- </select>
- <update id="updateSearchHistoryById" parameterType="com.caimei.module.base.entity.vo.SearchHistoryVo">
- update user_search_history
- <set>
- <if test="userId != null">
- userId = #{userId,jdbcType=BIGINT},
- </if>
- <if test="searchWord != null">
- searchWord = #{searchWord,jdbcType=VARCHAR},
- </if>
- <if test="searchDate != null">
- searchDate = #{searchDate,jdbcType=TIMESTAMP},
- </if>
- <if test="delFlag != null">
- delFlag = #{delFlag,jdbcType=VARCHAR},
- </if>
- </set>
- where id = #{id,jdbcType=BIGINT}
- </update>
- <update id="updateViewingNum">
- UPDATE cm_second_hand_detail SET
- viewingNum = #{viewingNum}
- WHERE productID = #{productID}
- </update>
- <update id="updatSecondHnadproductSold">
- UPDATE cm_second_hand_detail SET sold = 1 where productID = #{productID}
- </update>
- <update id="updateProductValidFlag">
- UPDATE product SET validFlag = #{validFlag} where productID = #{productID}
- </update>
- <insert id="insertSearchHistory" keyColumn="id" keyProperty="id" parameterType="com.caimei.module.base.entity.vo.SearchHistoryVo">
- insert into user_search_history
- <trim prefix="(" suffix=")" suffixOverrides=",">
- <if test="userId != null">
- userId,
- </if>
- <if test="searchWord != null">
- searchWord,
- </if>
- <if test="searchDate != null">
- searchDate,
- </if>
- <if test="delFlag != null">
- delFlag,
- </if>
- </trim>
- <trim prefix="values (" suffix=")" suffixOverrides=",">
- <if test="userId != null">
- #{userId,jdbcType=BIGINT},
- </if>
- <if test="searchWord != null">
- #{searchWord,jdbcType=VARCHAR},
- </if>
- <if test="searchDate != null">
- #{searchDate,jdbcType=TIMESTAMP},
- </if>
- <if test="delFlag != null">
- #{delFlag,jdbcType=VARCHAR},
- </if>
- </trim>
- </insert>
- <insert id="saveSencondHandProduct" parameterType="com.caimei.module.base.entity.po.SeconHandProduct" keyProperty="id" useGeneratedKeys="true">
- INSERT INTO cm_second_hand_detail(
- productID,
- sold,
- secondHandType,
- instrumentType,
- fixedYears,
- maturityYears,
- companyName,
- detailTalkFlag,
- originalPrice,
- contactName,
- contactMobile,
- dockingPeopleName,
- dockingPeopleMobile,
- secondProductType,
- townId,
- brandName,
- provinceCityDistrict,
- address,
- productQuality,
- productDetails,
- viewingNum,
- payStatus,
- payAmount,
- payFormData,
- payType,
- payDate,
- submitDate,
- reviewedDate,
- onLineDate,
- source,
- publisher
- ) VALUES (
- #{productID},
- #{sold},
- #{secondHandType},
- #{instrumentType},
- #{fixedYears},
- #{maturityYears},
- #{companyName},
- #{detailTalkFlag},
- #{originalPrice},
- #{contactName},
- #{contactMobile},
- #{dockingPeopleName},
- #{dockingPeopleMobile},
- #{secondProductType},
- #{townId},
- #{brandName},
- #{provinceCityDistrict},
- #{address},
- #{productQuality},
- #{productDetails},
- #{viewingNum},
- #{payStatus},
- #{payAmount},
- #{payFormData},
- #{payType},
- #{payDate},
- #{submitDate},
- #{reviewedDate},
- #{onLineDate},
- #{source},
- #{publisher}
- )
- </insert>
- <!--删除大于10条的历史记录-->
- <delete id="deleteSearchHistoryByUserId">
- DELETE FROM user_search_history
- WHERE userId=#{userId}
- AND id NOT IN (
- SELECT temp.id FROM (
- SELECT id FROM user_search_history WHERE userId=#{userId} ORDER BY id DESC LIMIT 10
- ) AS temp
- )
- </delete>
- <select id="getAddressInfo" resultType="com.caimei.module.base.entity.vo.AddressVo">
- SELECT a.name as "province"
- ,b.name as "city"
- ,c.name as "town"
- ,c.townId as "townID"
- FROM province a
- RIGHT JOIN city b ON a.provinceId = b.provinceId
- RIGHT JOIN town c ON b.cityId = c.cityId WHERE c.townId = #{townId}
- </select>
- <delete id="deleteAllSearchHistory">
- DELETE FROM
- user_search_history
- WHERE
- userId=#{userId}
- </delete>
- <select id="findLadderPrice" resultType="com.caimei.module.base.entity.vo.LadderPriceVo">
- SELECT
- <include refid="LadderPrice_Column_List" />
- FROM
- product_ladder_price
- WHERE
- productId = #{productID}
- AND userType = '3'
- AND delFlag = '0'
- ORDER BY
- ladderNum ASC
- </select>
- <select id="getRecommendIds" resultType="java.lang.Integer">
- SELECT recommendProductID FROM cm_product_recommend WHERE productID=#{productID} ORDER BY sort ASC
- </select>
- <select id="getRecommendByIds" resultType="com.caimei.module.base.entity.vo.ProductVo">
- SELECT
- <include refid="Product_Column_List"/>
- FROM
- product
- WHERE
- validFlag = '2'
- AND productID IN
- <foreach collection="productIDs" open="(" separator="," close=")" item="productID">
- #{productID}
- </foreach>
- </select>
- <select id="getDeFaultRecommend" resultType="com.caimei.module.base.entity.vo.ProductVo">
- select
- <include refid="Product_Column_List" />
- from product
- where validFlag = 2
- and tinyTypeID = #{tinyTypeID}
- order by sellNumber desc,onlineTime desc
- limit 7
- </select>
- <select id="getSeconHandProductList" resultType="com.caimei.module.base.entity.po.SeconHandProduct">
- SELECT
- IF(p.brandID != 161,cb.name ,cshd.brandName) as "brandName",p.*,
- cshd.sold AS "sold",
- cshd.secondHandType AS "secondHandType",
- cshd.instrumentType AS "instrumentType",
- cshd.fixedYears AS "fixedYears",
- cshd.maturityYears AS "maturityYears",
- cshd.companyName AS "companyName",
- cshd.detailTalkFlag AS "detailTalkFlag",
- cshd.originalPrice AS "originalPrice",
- cshd.contactName AS "contactName",
- cshd.contactMobile AS "contactMobile",
- cshd.secondProductType AS "secondProductType",
- cshd.provinceCityDistrict AS "provinceCityDistrict",
- cshd.townId as "townId",
- cshd.address AS "address",
- cshd.productQuality AS "productQuality",
- cshd.productDetails AS "productDetails",
- cshd.viewingNum AS "viewingNum",
- cshd.payStatus AS "payStatus",
- cshd.payAmount AS "payAmount",
- cshd.payFormData AS "payFormData",
- cshd.payType AS "payType",
- cshd.payDate AS "payDate",
- cshd.submitDate AS "submitDate",
- cshd.reviewedDate AS "reviewedDate",
- cshd.onLineDate AS "onLineDate",
- cshd.source AS "source",
- cshd.showContactFlag AS "showContactFlag"
- FROM
- product p
- LEFT JOIN cm_second_hand_detail cshd ON p.productID = cshd.productID
- left join cm_brand cb on cb.id = p.brandID
- WHERE
- p.productCategory = 2
- AND p.validFlag = 2
- <if test="name != null and name != ''">
- and p.name like CONCAT('%',#{name},'%')
- </if>
- <if test="secondHandType != null and secondHandType != ''">
- and cshd.secondHandType = #{secondHandType}
- </if>
- <if test="instrumentType != null and instrumentType != '' and instrumentType != '0' and instrumentType != 0">
- and cshd.instrumentType like CONCAT('%',#{instrumentType},'%')
- </if>
- ORDER BY cshd.onLineDate DESC
- </select>
- <select id="getSencondHandProductDetail" resultType="com.caimei.module.base.entity.po.SeconHandProduct">
- SELECT
- IF(p.brandID != 161,cb.name ,cshd.brandName) as "brandName",p.*,cb.*,cshd.*,cb.description as "brandInfo"
- FROM
- product p
- LEFT JOIN cm_second_hand_detail cshd ON p.productID = cshd.productID
- left join cm_brand cb on cb.id = p.brandID
- WHERE
- p.productCategory = 2
- AND p.productID = #{productId}
- </select>
- <select id="getBrandList" resultType="com.caimei.module.base.entity.po.CmBrand">
- select b.id AS id, b.name AS name from cm_brand b
- where b.status = '1' and b.delFlag = '0' and b.description is not null and b.description != '' and b.id not in (161)
- order by b.sort
- </select>
- <select id="getSecondHandProductRecommend" resultType="com.caimei.module.base.entity.po.SeconHandProduct">
- select * from cm_second_hand_recommend cshr LEFT JOIN product p on cshr.recommendProductID = p.productID where cshr.delFlag = 0 and p.validFlag = 2 and cshr.secondHandProductID = #{productId};
- </select>
- <select id="getOrderSecondHandProductList" resultType="com.caimei.module.base.entity.po.SeconHandProduct">
- SELECT
- *
- FROM
- product p
- LEFT JOIN cm_second_hand_detail cshd ON cshd.productID = p.productID
- WHERE
- p.productCategory = 2 and p.validFlag = 2
- <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="searchKeyword != null and searchKeyword != ''">
- and p.name like CONCAT('%',#{searchKeyword},'%')
- </if>
- and cshd.sold != 1
- ORDER BY cshd.onLineDate DESC
- </select>
- <select id="getSeconHandProductByLimit" resultType="com.caimei.module.base.entity.po.SeconHandProduct">
- SELECT
- *
- FROM
- product p
- LEFT JOIN cm_second_hand_detail cshd ON p.productID = cshd.productID
- WHERE
- p.productCategory = 2
- AND p.validFlag = 2
- <if test="secondHandType != null and secondHandType != ''">
- and cshd.secondHandType = #{secondHandType}
- </if>
- ORDER BY cshd.onLineDate DESC
- limit 10
- </select>
- <select id="getSecondHandProductListByMaturity"
- resultType="com.caimei.module.base.entity.po.SeconHandProduct">
- SELECT
- *
- FROM
- cm_second_hand_detail cshd
- LEFT JOIN product p ON p.productID = cshd.productID
- WHERE
- p.validFlag = 2
- AND cshd.onLineDate <![CDATA[ < ]]> #{beforeDays}
- </select>
- <select id="findTypeName" resultType="java.lang.String">
- SELECT
- CONCAT_WS("-", b.name,s.name, t.name)
- FROM
- bigtype b
- LEFT JOIN smalltype s ON s.smallTypeID = #{smallTypeID}
- LEFT JOIN tinytype t ON t.tinyTypeID = #{tinyTypeID}
- WHERE
- b.bigTypeID = #{bigTypeID};
- </select>
- <select id="getBrand" resultType="com.caimei.module.base.entity.vo.BrandVo">
- SELECT * FROM cm_brand WHERE id = #{brandID}
- </select>
- <select id="getBigTypeIdBySmallTypeId" resultType="java.lang.Integer">
- select bigTypeID from smalltype where smallTypeID = #{typeId}
- </select>
- <select id="getBigTypeIdByTinyTypeId" resultType="java.lang.Integer">
- select bigTypeID from smalltype
- where smallTypeID =
- (SELECT smallTypeID from tinytype where tinyTypeID = #{typeId})
- </select>
- <select id="getBigTypeByBigTypeId" resultType="com.caimei.module.base.entity.vo.BigtypeVo">
- select
- <include refid="BigType_Column_List" />
- from bigtype
- where bigTypeID = #{bigTypeID}
- </select>
- <select id="findAuthProductByProductId" resultType="com.caimei.module.base.entity.vo.AuthProductVo">
- select p.name as productName,
- p.snCode,
- p.image as productImage,
- p.certificateImage,
- b.authLogo,
- b.name as brandName,
- c.name as productionPlace,
- a.id as authId,
- a.authParty,
- u.authUserId as authUserId,
- u.name as shopName,
- i.securityLink,
- i.type as shopType,
- i.statementType,
- i.statementContent,
- i.statementLink,
- i.statementImage
- from cm_brand_auth_product p
- left join cm_brand_auth a on p.authId = a.id
- left join cm_brand_auth_user u on a.authUserId = u.authUserId
- left join cm_brand_auth_shop_info i on u.authUserId = i.authUserId
- left join cm_brand b on i.brandId = b.id
- left join country c on i.countryId = c.countryId
- where p.id = #{productId} and p.status = 1
- </select>
- <select id="getParamsByProductId" resultType="com.caimei.module.base.entity.po.CmBrandProductParamPo">
- select name,content from cm_brand_product_param where productId = #{productId}
- </select>
- <select id="findStatementFileByAuthUserId" resultType="com.caimei.module.base.entity.vo.StatementFileVo">
- select name,ossName,md5Hex,uploadTime
- from cm_brand_auth_file
- where authUserId = #{authUserId}
- limit 1
- </select>
- </mapper>
|