123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704 |
- <?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.caimei365.user.mapper.ShopMapper">
- <insert id="insertShopCert">
- insert into shopcert (shopID, shopCertTypeID, `name`,
- image, organization, effectDate,
- loseEfficacyDate)
- values (#{shopId}, #{shopCertTypeId}, #{name},
- #{image}, #{organization}, #{effectDate},
- #{loseEfficacyDate})
- </insert>
- <update id="updateShopUserByUpdateInfo">
- update user
- set name = #{name}, userName = #{userName}, email = #{email}
- where userID = #{userId}
- </update>
- <update id="updateShopByUpdateInfo">
- update shop
- <set>
- <if test="shortName != null and shortName != ''">
- sname = #{shortName},
- </if>
- <if test="contractEmail != null and contractEmail != ''">
- contractEmail = #{contractEmail},
- </if>
- <if test="contractPhone != null and contractPhone != ''">
- contractPhone = #{contractPhone},
- </if>
- <if test="linkMan != null and linkMan != ''">
- linkMan = #{linkMan},
- </if>
- <if test="townId != null and townId != ''">
- provinceID = #{provinceId}, cityID = #{cityId}, townID = #{townId},address = #{address},
- </if>
- <if test="socialCreditCode != null and socialCreditCode != ''">
- socialCreditCode = #{socialCreditCode},
- </if>
- <if test="businessLicense != null and businessLicense != ''">
- businessLicenseImage = #{businessLicense},
- </if>
- <if test="firstShopType != null and firstShopType != ''">
- firstShopType = #{firstShopType},
- </if>
- <if test="secondShopType != null and secondShopType != ''">
- secondShopType = #{secondShopType},
- </if>
- <if test="mainProduct != null and mainProduct != ''">
- mainpro = #{mainProduct},
- </if>
- <if test="mainProductDesc != null and mainProductDesc != ''">
- productDesc = #{mainProductDesc},
- </if>
- <if test="legalPerson != null and legalPerson != ''">
- legalPerson = #{legalPerson},
- </if>
- <if test="registeredCapital != null and registeredCapital != ''">
- registeredCapital = #{registeredCapital},
- </if>
- <if test="faxNumber != null and faxNumber != ''">
- fax = #{faxNumber},
- </if>
- <if test="companyNature != null and companyNature != ''">
- nature = #{companyNature},
- </if>
- <if test="turnover != null and turnover != ''">
- turnover = #{turnover},
- </if>
- <if test="medicalPracticeLicense != null and medicalPracticeLicense != ''">
- medicalPracticeLicenseImg1 = #{medicalPracticeLicense},
- </if>
- <if test="shopDesc != null and shopDesc != ''">
- info = #{shopDesc},
- </if>
- <if test="businessScope != null and businessScope != ''">
- businessScope = #{businessScope},
- </if>
- <if test="logo != null and logo != ''">
- logo = #{logo},
- </if>
- <if test="website != null and website != ''">
- website = #{website},
- </if>
- <if test="wxApplets != null and wxApplets != ''">
- wxApplets = #{wxApplets},
- </if>
- <if test="wxOfficialAccount != null and wxOfficialAccount != ''">
- wxOfficialAccount = #{wxOfficialAccount},
- </if>
- name = #{name}
- </set>
- where shopID = #{shopId}
- </update>
- <delete id="deleteShopCertByShopId">
- DELETE FROM shopcert WHERE shopID = #{shopId}
- </delete>
- <select id="getShopCert" resultType="java.lang.String">
- SELECT image FROM shopcert WHERE shopID = #{shopId} AND shopCertTypeID = #{shopCertTypeId}
- </select>
- <select id="getShopByUserId" resultType="com.caimei365.user.model.vo.UserLoginVo">
- select
- u.userID as userId,
- u.userOrganizeID as organizeId,
- u.clubID as clubId,
- u.shopID as shopId,
- u.serviceProviderId as serviceProviderId,
- u.userName as userName,
- u.name as name,
- u.mobile as mobile,
- u.bindMobile as bindMobile,
- u.email as email,
- u.userPermission as userPermission,
- u.userIdentity as userIdentity,
- u.password as password,
- u.guideFlag as guideFlag,
- u.clubStatus as clubStatus,
- u.manufacturerStatus as shopStatus
- from user u
- where u.userId = #{userId}
- </select>
- <select id="getShopById" resultType="com.caimei365.user.model.vo.ShopVo">
- select userID as userId, shopID as shopId, name, sname as shortName, linkMan, contractMobile,
- contractEmail, contractEmail as email, provinceID as proviceId, cityID as cityId, townID as townId,
- address, socialCreditCode, businessLicenseImage as businessLicense, firstShopType, secondShopType,
- mainpro as mainProduct, productDesc as mainProductDesc,legalPerson,registeredCapital,fax as faxNumber,
- nature as companyNature, turnover, medicalPracticeLicenseImg1 as medicalPracticeLicense, info as shopDesc,
- businessScope, logo, addTime, status, contractPhone, validFlag, website, wxOfficialAccount, wxApplets
- from shop where shopID = #{shopId}
- </select>
- <select id="getShopHomeData" resultType="com.caimei365.user.model.vo.ShopHomeVo">
- select
- s.shopID as id,
- s.userID as userId,
- s.name,
- s.sname as abbr,
- s.logo,
- s.address,
- s.businessScope,
- s.businessLicenseImage as businessLicense,
- s.taxCertificateImage as taxCertificate,
- s.authorizationCertificateImage as certificate,
- s.info,
- s.productDesc,
- count(*) as normalNum
- from shop s
- where s.shopID = #{supplierId}
- group by s.shopID
- </select>
- <select id="getShopCertById" resultType="java.lang.String">
- SELECT image FROM shopcert WHERE shopID = #{shopId} AND shopCertTypeID = #{shopCertTypeId}
- </select>
- <select id="medicalPracticeLicense" resultType="java.lang.String">
- SELECT medicalPracticeLicenseImg1 FROM shop WHERE shopID = #{shopId}
- </select>
- <select id="getShopCategory" resultType="com.caimei365.user.model.vo.CmShopCategoryVo">
- SELECT
- csc.id,
- csc.shopId,
- csc.category,
- csc.sort,
- csc.addTime,
- csc.delFlag,
- (SELECT COUNT(id) FROM cm_shop_category_product WHERE categoryId = csc.id) as productNumber
- FROM cm_shop_category csc
- WHERE csc.delFlag = 0 AND csc.shopId = #{shopId}
- <if test="category != null and category != ''">
- and csc.category like concat('%', #{category}, '%')
- </if>
- order by csc.sort asc
- </select>
- <update id="updateCategorySort">
- update cm_shop_category
- set sort = #{sort}
- where id = #{id}
- </update>
- <select id="getShopCategoryById" resultType="com.caimei365.user.model.vo.CmShopCategoryVo">
- SELECT
- id,
- shopId,
- category,
- sort,
- addTime,
- delFlag
- FROM cm_shop_category
- WHERE delFlag = 0 AND id = #{id}
- limit 1
- </select>
- <select id="getCategoryProductById" resultType="com.caimei365.user.model.vo.ProductItemVo">
- SELECT
- cscp.id,
- cscp.categoryId,
- cscp.productId,
- p.name,
- p.mainImage as image,
- s.shopId,
- s.name AS shopName
- FROM cm_shop_category_product cscp
- LEFT JOIN product p ON p.productId = cscp.productId
- LEFT JOIN shop s ON s.shopId = p.shopId
- WHERE cscp.delFlag = 0 AND cscp.categoryId = #{categoryId}
- </select>
- <select id="getShopProductList" resultType="com.caimei365.user.model.vo.ProductItemVo">
- SELECT
- p.productId,
- p.name,
- p.mainImage as image,
- s.shopId,
- s.name AS shopName
- FROM product p
- LEFT JOIN cm_organize_product_info copi ON copi.productId = p.productId
- LEFT JOIN shop s ON s.shopId = p.shopId
- <where>
- copi.organizeId = 0 AND copi.validFlag = 2
- and p.shopId = #{shopId}
- <if test="name != null and name != ''">
- and p.name like concat('%', #{name}, '%')
- </if>
- </where>
- </select>
- <select id="getCategoryProductIdList" resultType="java.lang.Integer">
- SELECT
- cscp.productId
- FROM cm_shop_category_product cscp
- LEFT JOIN cm_shop_category csc ON csc.id = cscp.categoryId
- WHERE csc.shopId = #{shopId} and cscp.categoryId = #{categoryId} and cscp.delFlag = 0
- </select>
- <insert id="insertCategory" keyColumn="id" keyProperty="id" useGeneratedKeys="true">
- insert into cm_shop_category(shopId, category, sort, addTime, delFlag)
- values (#{shopId}, #{category}, #{sort}, now(), 0)
- </insert>
- <insert id="insertCategoryProduct">
- insert into cm_shop_category_product(categoryId, productId, addTime, delFlag)
- values (#{categoryId}, #{productId}, now(), 0)
- </insert>
- <update id="updateCategory">
- update cm_shop_category
- set category = #{category},
- sort = #{sort}
- where id = #{id}
- </update>
- <update id="updateCategoryProduct">
- update cm_shop_category_product
- set delFlag = 1
- where categoryId = #{categoryId}
- <if test="productIdList.size()>0">
- and productId not in
- <foreach collection="productIdList" item="productId" open="(" separator="," close=")">
- #{productId}
- </foreach>
- </if>
- </update>
- <select id="getCategoryProductIds" resultType="java.lang.Integer">
- select productId from cm_shop_category_product where categoryId = #{categoryId}
- </select>
- <update id="deleteCategory">
- update cm_shop_category
- set delFlag = 1
- where id = #{id}
- </update>
- <select id="getShopHomeImages" resultType="com.caimei365.user.model.vo.ShopBannerVo">
- select shopBannerID AS id,
- shopID AS shopId,
- image,
- link,
- title,
- info,
- sort,
- addTime
- from shopbanner
- where shopID = #{shopId}
- <if test="title != null and title != ''">
- and title like concat('%', #{title}, '%')
- </if>
- order by sort asc
- </select>
- <update id="updateShopBannerSort">
- update shopbanner
- set sort = #{sort}
- where shopBannerID = #{id}
- </update>
- <select id="getShopPromotionsByShopId" resultType="com.caimei365.user.model.vo.PromotionsVo">
- select pr.id,
- pr.name,
- pr.description,
- pr.type,
- pr.mode,
- pr.touchPrice,
- pr.reducedPrice,
- pr.beginTime,
- pr.endTime,
- pr.status,
- prp.productId,
- prp.supplierId
- from cm_promotions pr
- left join cm_promotions_product prp on pr.id = prp.promotionsId
- where prp.supplierId = #{shopId}
- and (pr.status = 1 or ( pr.status = 2 and (NOW() between pr.beginTime and pr.endTime)))
- and pr.type=3
- and pr.delFlag not in (1,2)
- order by pr.type desc
- limit 1
- </select>
- <select id="getPromotionsGifts" resultType="com.caimei365.user.model.vo.ProductItemVo">
- select
- cpg.id as id,
- p.productID as productId,
- p.shopID as shopId,
- p.`name` as `name`,
- p.mainImage as image,
- cpg.number as number,
- 0 as price,
- 2 as productType,
- (select price from cm_sku where productId=p.productId order by price asc limit 1)as originalPrice,
- (select unit from cm_sku where productId=p.productId order by price asc limit 1)as unit,
- copi.validFlag as validFlag,
- (select stock from cm_sku where productId=p.productId order by price asc limit 1)as stock
- from product p
- left join cm_organize_product_info copi on copi.productId = p.productID and copi.organizeId = 0
- left join cm_promotions_gift cpg on cpg.productId = p.productID
- where cpg.promotionsId = #{promotionsId}
- order by cpg.addTime desc
- </select>
- <select id="getShopProductCount" resultType="java.lang.Integer">
- SELECT COUNT(*)
- FROM product p
- left join cm_organize_product_info copi on p.productID = copi.productId
- WHERE p.shopID = #{shopId} and copi.organizeId = #{productOrganize}
- and p.groundMall LIKE concat('%',#{productOrganize},'%')
- <if test="validFlag != null">
- AND copi.validFlag = #{validFlag}
- </if>
- </select>
- <select id="getSalesRankingList" resultType="java.util.Map">
- SELECT cop.productID AS productId, SUM(cop.num) AS total
- FROM cm_order_product cop JOIN cm_order co ON co.orderID = cop.orderID
- WHERE cop.shopID = #{shopId} and cop.organizeID = #{organizeId}
- AND co.STATUS NOT IN ('0', '6', '7')
- AND co.delFlag = '0'
- AND co.secondHandOrderFlag != '1'
- GROUP BY productID
- ORDER BY total DESC
- LIMIT 5
- </select>
- <select id="getProductShown" resultType="com.caimei365.user.model.vo.ProductItemVo">
- SELECT name, mainImage AS image
- FROM product
- WHERE productId = #{productId}
- </select>
- <select id="getSalesStatistics" resultType="java.util.Map">
- SELECT COUNT(DISTINCT so.shopOrderID) AS orderQuantity,
- IFNULL(SUM(o.productTotalFee),0) AS orderAmount
- FROM cm_order o
- JOIN cm_shop_order so ON o.orderID = so.orderID
- WHERE o.status NOT IN('0', '6', '7')
- AND o.delFlag = '0'
- AND so.delFlag = '0'
- AND so.shopID = #{shopId}
- AND so.organizeID = #{organizeId}
- AND o.secondHandOrderFlag != '1'
- <if test="startTime != null and startTime != ''">
- AND o.orderTime <![CDATA[ >= ]]> #{startTime}
- </if>
- <if test="endTime != null and endTime != ''">
- AND o.orderTime <![CDATA[ <= ]]> #{endTime}
- </if>
- </select>
- <select id="getShopIsMark" resultType="java.lang.Integer">
- select id from cm_shop_statistics where shopId = #{shopId} and delFlag = 0 limit 1
- </select>
- <select id="getShopHomeImageCount" resultType="java.lang.Integer">
- SELECT COUNT(*) FROM shopbanner WHERE shopID = #{shopId}
- </select>
- <insert id="insertShopHomeImage">
- INSERT INTO shopbanner (shopID,title,link,info,image, sort, addTime)
- VALUES (#{shopId},#{title},#{link},#{info},#{image}, #{sort}, now())
- </insert>
- <update id="updateShopHomeImage">
- UPDATE shopbanner
- SET title = #{title}, link = #{link}, info = #{info}, image = #{image}, sort = #{sort}
- WHERE shopBannerID = #{id}
- </update>
- <delete id="deleteShopHomeImage">
- DELETE FROM shopbanner WHERE shopBannerID = #{id}
- </delete>
- <select id="getUserShopId" resultType="java.lang.Integer">
- select shopId from shop where userId = #{userId}
- </select>
- <select id="getMarketCode" resultType="java.lang.String">
- select code from cm_market_code where marketReportId = #{marketReportId} and recodeTime <![CDATA[ > ]]> now() and delFlag = 0
- </select>
- <select id="getShopInfoById" resultType="com.caimei365.user.model.vo.CmMarketShopVo">
- SELECT css.id,
- s.shopId,
- s.name,
- s.linkMan,
- s.contractMobile,
- cmr.addTime,
- <if test="type == 1">
- (SELECT reportDate FROM cm_market_report WHERE id = #{marketReportId} LIMIT 1) AS reportDate,
- </if>
- <if test="type != 1">
- (SELECT reportDate FROM cm_market_report WHERE marketId = css.id ORDER BY addTime ASC LIMIT 1) AS startDate,
- (SELECT reportDate FROM cm_market_report WHERE marketId = css.id ORDER BY addTime DESC LIMIT 1) AS endDate,
- </if>
- css.logo
- FROM cm_shop_statistics css
- left join cm_shop_product csp on csp.statisticsId = css.id
- LEFT JOIN cm_market_report cmr ON cmr.marketId = csp.id
- LEFT JOIN shop s ON s.shopId = css.shopId
- WHERE css.delFlag = 0
- <if test="type == 1">
- and cmr.id = #{marketReportId}
- </if>
- <if test="type != 1">
- and css.shopId = #{shopId}
- </if>
- ORDER BY cmr.addTime DESC
- limit 1
- </select>
- <select id="getMarketReportIds" resultType="java.lang.Integer">
- select id from cm_market_report
- where delFlag = 0
- <if test="type == 1">
- and id = #{marketReportId}
- </if>
- <if test="type != 1">
- and marketId = #{marketId}
- and visible = 1
- </if>
- <if test="startTime != null and startTime != ''">
- and reportDate <![CDATA[ >= ]]> #{startTime}
- </if>
- <if test="endTime != null and endTime != ''">
- and reportDate <![CDATA[ <= ]]> #{endTime}
- </if>
- <if test="marketReportId == null">
- <if test="startTime == null or startTime == '' ">
- <if test="endTime == null or endTime == ''">
- order by addTime desc
- limit 1
- </if>
- </if>
- </if>
- </select>
- <select id="getMarketStage" resultType="com.caimei365.user.model.vo.StageVo">
- SELECT cms.id,
- cms.stage,
- cms.theme,
- cms.addTime,
- cmr.reportDate
- FROM cm_market_stage cms
- LEFT JOIN cm_market_report cmr ON cmr.id = cms.marketReportId
- where cms.marketReportId in
- <foreach collection="marketReportIds" item="marketReportId" open="(" separator="," close=")">
- #{marketReportId}
- </foreach>
- </select>
- <select id="getMarketFunnelModel" resultType="com.caimei365.user.model.vo.FunnelModelVo">
- SELECT id,
- impressions,
- hits,
- visits,
- consultation,
- report
- FROM cm_market_funnelModel
- WHERE marketReportId in
- <foreach collection="marketReportIds" item="marketReportId" open="(" separator="," close=")">
- #{marketReportId}
- </foreach>
- </select>
- <select id="getMarketArticleReadVolume" resultType="com.caimei365.user.model.vo.ArticleReadVolumeVo">
- SELECT id,
- firstTime,
- title,
- link,
- titleReferred,
- type,
- keyword,
- channel,
- touchNumber,
- wechatNumber
- FROM cm_market_articleReadVolume
- WHERE marketReportId in
- <foreach collection="marketReportIds" item="marketReportId" open="(" separator="," close=")">
- #{marketReportId}
- </foreach>
- </select>
- <select id="getMarketImpressions" resultType="com.caimei365.user.model.vo.ImpressionsVo">
- SELECT id,
- generalNumber,
- microBlog,
- redBookNumber,
- otherNumber
- FROM cm_market_impressions
- WHERE marketReportId in
- <foreach collection="marketReportIds" item="marketReportId" open="(" separator="," close=")">
- #{marketReportId}
- </foreach>
- </select>
- <select id="getMarketReadVolume" resultType="com.caimei365.user.model.vo.ReadVolumeVo">
- SELECT id,
- generalNumber,
- microBlog,
- redBookNumber,
- otherNumber
- FROM cm_market_readVolume
- WHERE marketReportId in
- <foreach collection="marketReportIds" item="marketReportId" open="(" separator="," close=")">
- #{marketReportId}
- </foreach>
- </select>
- <select id="getMarketSummary" resultType="com.caimei365.user.model.vo.SummaryVo">
- SELECT id,
- keyword,
- seoRanking,
- searchVolume
- FROM cm_market_summary
- WHERE marketReportId in
- <foreach collection="marketReportIds" item="marketReportId" open="(" separator="," close=")">
- #{marketReportId}
- </foreach>
- </select>
- <select id="getMarketVisits" resultType="com.caimei365.user.model.vo.VisitsVo">
- SELECT id,
- clubNumber,
- touristNumber
- FROM cm_market_visits
- WHERE marketReportId in
- <foreach collection="marketReportIds" item="marketReportId" open="(" separator="," close=")">
- #{marketReportId}
- </foreach>
- </select>
- <select id="getMarketProportion" resultType="com.caimei365.user.model.vo.ProportionVo">
- SELECT id,
- search,
- general,
- microBlog,
- directAccess
- FROM cm_market_proportion
- WHERE marketReportId in
- <foreach collection="marketReportIds" item="marketReportId" open="(" separator="," close=")">
- #{marketReportId}
- </foreach>
- </select>
- <select id="getMarketPageDuration" resultType="com.caimei365.user.model.vo.PageDurationVo">
- SELECT id,
- pageLabel,
- accessDuration
- FROM cm_market_pageDuration
- WHERE marketReportId in
- <foreach collection="marketReportIds" item="marketReportId" open="(" separator="," close=")">
- #{marketReportId}
- </foreach>
- </select>
- <select id="getMarketAdvertHits" resultType="com.caimei365.user.model.vo.AdvertHitsVo">
- SELECT id,
- POSITION,
- home,
- infoCenter,
- hits
- FROM cm_market_advertHits
- WHERE marketReportId in
- <foreach collection="marketReportIds" item="marketReportId" open="(" separator="," close=")">
- #{marketReportId}
- </foreach>
- </select>
- <select id="getMarketRemark" resultType="com.caimei365.user.model.vo.CmMarketRemarkVo">
- SELECT id,
- remarkNumber,
- addTime
- FROM cm_market_remark
- WHERE marketReportId in
- <foreach collection="marketReportIds" item="marketReportId" open="(" separator="," close=")">
- #{marketReportId}
- </foreach>
- </select>
- <select id="getShopKeyword" resultType="java.lang.String">
- SELECT cusf.keyword
- FROM cm_user_search_frequency cusf
- LEFT JOIN cm_shop_label csl ON csl.keywordId = cusf.id
- LEFT JOIN cm_shop_relevance csr ON csr.id = csl.relevanceId
- where csr.shopId = #{shopId}
- </select>
- <select id="getRegion" resultType="java.lang.String">
- SELECT region FROM cm_behavior_record_index
- where
- (
- <foreach collection="labels" item="label" open="(" separator="or" close=")">
- label LIKE concat('%', #{label}, '%')
- </foreach>
- )
- <if test="startTime != null and startTime != ''">
- and accessDate <![CDATA[ >= ]]> #{startTime}
- </if>
- <if test="startTime != null and startTime != ''">
- AND accessDate <![CDATA[ <= ]]> #{endTime}
- </if>
- </select>
- <!--用户身份-->
- <select id="getUserIdentity" resultType="com.caimei365.user.model.vo.ReturnEntityVo">
- SELECT
- (CASE c.linkManIdentity
- WHEN 1 THEN '老板'
- WHEN 2 THEN '采购'
- WHEN 3 THEN '运营'
- WHEN 4 THEN '运营'
- END) AS name,
- COUNT(c.userId) as value
- FROM cm_behavior_record_index cbri
- LEFT JOIN club c ON c.userId = cbri.userId
- LEFT JOIN USER u ON u.userId = cbri.userId
- WHERE
- cbri.userId != 0
- AND u.userIdentity = 2
- <if test="startTime != null and startTime != ''">
- and cbri.accessDate <![CDATA[ >= ]]> #{startTime}
- </if>
- <if test="startTime != null and startTime != ''">
- AND cbri.accessDate <![CDATA[ <= ]]> #{endTime}
- </if>
- AND (
- <foreach collection="labels" item="label" open="(" separator="or" close=")">
- cbri.label LIKE concat('%', #{label}, '%')
- </foreach>
- )
- GROUP BY c.linkManIdentity
- </select>
- <!--机构类型-->
- <select id="getClubType" resultType="com.caimei365.user.model.vo.ReturnEntityVo">
- SELECT
- (CASE c.firstClubType
- WHEN 1 THEN '医美'
- WHEN 2 THEN '生美'
- WHEN 3 THEN '其他'
- WHEN 4 THEN '其他'
- WHEN 5 THEN '其他'
- END) AS name,
- COUNT(c.userId) as value
- FROM cm_behavior_record_index cbri
- LEFT JOIN club c ON c.userId = cbri.userId
- LEFT JOIN USER u ON u.userId = cbri.userId
- WHERE
- cbri.userId != 0
- AND u.userIdentity = 2
- <if test="startTime != null and startTime != ''">
- and cbri.accessDate <![CDATA[ >= ]]> #{startTime}
- </if>
- <if test="startTime != null and startTime != ''">
- AND cbri.accessDate <![CDATA[ <= ]]> #{endTime}
- </if>
- AND (
- <foreach collection="labels" item="label" open="(" separator="or" close=")">
- cbri.label LIKE concat('%', #{label}, '%')
- </foreach>
- )
- GROUP BY c.firstClubType
- </select>
- <select id="getMarketReportDataList" resultType="java.lang.String">
- select cmr.reportDate
- from cm_market_report cmr
- left join cm_shop_statistics css on css.id = cmr.marketId
- where cmr.delFlag = 0 and cmr.visible = 1 and css.shopId = #{shopId}
- </select>
- </mapper>
|