123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412 |
- <?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.commodity.mapper.PageMapper">
- <select id="getPageTypeSort" resultType="java.lang.Integer">
- select typeSort from cm_page
- where id = #{pageId} and enabledStatus = '1'
- </select>
- <select id="getHotSearchByPageId" resultType="com.caimei365.commodity.model.vo.HotSearchVo">
- select
- id, pageId, name, isHot, link, pcStatus, sort, appletsStatus, creationTime
- from
- cm_page_hot_search
- where
- pageId = #{pageId}
- <if test="source == 1">
- and pcStatus = 1
- </if>
- <if test="source == 2">
- and appletsStatus = 1
- </if>
- order by -sort desc, creationTime desc
- </select>
- <select id="getHomePageFloor" resultType="com.caimei365.commodity.model.vo.PageFloorVo">
- select id, type, floorTitle as title, floorDetail as detail
- from new_page_floor
- where delFlag = 0
- <if test="source == 1">
- AND wwwEnabledStatus = 1
- </if>
- <if test="source == 2">
- AND crmEnabledStatus = 1
- </if>
- order by -sort desc,createDate desc
- </select>
- <select id="getFloorByPageId" resultType="com.caimei365.commodity.model.vo.PageFloorVo">
- select id, title ,description as detail
- from cm_page_centre
- where pageId = #{pageId}
- <if test="source == 1">
- and enabledStatus = 1
- </if>
- <if test="source == 2">
- and crmEnabledStatus = 1
- </if>
- order by -sort desc, createDate desc
- </select>
- <select id="getFloorContentById" resultType="com.caimei365.commodity.model.vo.FloorContentVo">
- select
- id, floorId, centreId, templateType, pcAdsImage1, pcAdsImage2, pcAdsImage3,pcAdsImage4,pcAdsImage5,
- appletsAdsImage1, appletsAdsImage2, appletsAdsImage3, appletsAdsImage4, appletsAdsImage5, adsLink1, adsLink2, adsLink3
- from new_page_floor_content where floorId = #{id}
- </select>
- <select id="getFloorImageById" resultType="com.caimei365.commodity.model.vo.FloorImageVo">
- select
- id, floorId, centreId, productId, name, link, image, appletsImage, label, pcStatus, appletsStatus, sort, createDate
- from new_page_floor_image
- where floorId = #{id}
- <if test="source == 1">
- and pcStatus = 1
- </if>
- <if test="source == 2">
- and appletsStatus = 1
- </if>
- order by -sort desc, createDate desc
- </select>
- <select id="getFloorContentByCentreId" resultType="com.caimei365.commodity.model.vo.FloorContentVo">
- select id,
- floorId,
- centreId,
- templateType,
- pcAdsImage1,
- pcAdsImage2,
- pcAdsImage3,
- pcAdsImage4,
- pcAdsImage5,
- appletsAdsImage1,
- appletsAdsImage2,
- appletsAdsImage3,
- appletsAdsImage4,
- appletsAdsImage5,
- adsLink1,
- adsLink2,
- adsLink3,
- adsLink4,
- adsLink5,
- displayDate1,
- displayDate2,
- displayDate3
- from new_page_floor_content
- where centreId = #{id}
- </select>
- <select id="getFloorImageByCentreId" resultType="com.caimei365.commodity.model.vo.FloorImageVo">
- select
- id, floorId, centreId, productId, name, link, image, appletsImage,adsImage, label,content, pcStatus, appletsStatus, sort,displaySort, createDate
- from new_page_floor_image
- where centreId = #{id}
- <if test="source == 1">
- and pcStatus = 1
- </if>
- <if test="source == 2">
- and appletsStatus = 1
- </if>
- order by -sort desc, createDate desc
- </select>
- <select id="getProductItemById" resultType="com.caimei365.commodity.model.vo.ProductItemVo">
- select
- p.productID as productId,
- p.actStatus,
- p.name,
- p.aliasName,
- p.mainImage as image,
- p.unit,
- p.productCode as code,
- p.price1TextFlag as priceFlag,
- p.price1 as price,
- p.shopID as shopId,
- p.searchKey as keyword,
- p.price8Text as beautyActFlag,
- p.minBuyNumber as minBuyNumber,
- p.maxBuyNumber as maxBuyNumber,
- p.ladderPriceFlag,
- p.normalPrice,
- p.step,
- p.shopID as shopId,
- p.taxPoint as taxRate,
- p.includedTax,
- p.invoiceType,
- p.productCategory as productCategory,
- p.validFlag,
- p.featuredFlag,
- p.commodityType,
- p.bigTypeID as bigTypeId,
- p.smallTypeID as smallTypeId,
- p.tinyTypeID as tinyTypeId,
- p.visibility as visibility,
- cshd.detailTalkFlag as detailTalkFlag
- from product p
- left join cm_second_hand_detail cshd on p.productID = cshd.productID
- where p.productID = #{productId} and p.validFlag = 2
- </select>
- <select id="getSupplierFloorImage" resultType="com.caimei365.commodity.model.vo.ShopFloorVo">
- select id, crmImage, wwwImage, wwwLink
- from new_page_quality_supplier_image
- limit 1
- </select>
- <select id="getSupplierImage" resultType="com.caimei365.commodity.model.vo.ShopImageVo">
- select
- id, supplierName, image, link, sort, wwwEnabledStatus, crmEnabledStatus,
- createBy, createDate, updateBy, updateDate, delFlag
- from
- new_page_quality_supplier
- where
- delFlag = 0
- <if test="source == 1">
- and wwwEnabledStatus = 1
- </if>
- <if test="source == 2">
- and crmEnabledStatus = 1
- </if>
- order by - sort desc,createDate desc
- </select>
- <select id="getProductDetails" resultType="com.caimei365.commodity.model.vo.ProductDetailVo">
- select productID as productId, shopID as shopId, name, aliasName, commodityType, mainImage, stock, invoiceType,
- bigTypeID as bigTypeId, smallTypeID as smallTypeId, tinyTypeID as tinyTypeId, searchKey, visibility,
- brandID as brandId, productType, tags, unit, normalPrice, price1 as price, includedTax, minBuyNumber,
- productCategory, serviceNumber, taxPoint, supplierTaxPoint, price1TextFlag as priceFlag, actFlag, ladderPriceFlag,
- addTime, hasSkuFlag, sellNumber, sortIndex, featuredFlag, costCheckFlag, recommendType, machineType,
- productCode, updateTime, validFlag, searchKey, allAreaFlag, step, costPrice, provinceIds, qualificationImg,
- trainingMethod, trainingType ,trainingFee
- from product
- where productID = #{productId}
- </select>
- <select id="getBuyAgainProducts" resultType="com.caimei365.commodity.model.vo.ProductItemVo">
- select
- p.productID as productId,
- p.actStatus,
- p.name,
- p.aliasName,
- p.mainImage as image,
- p.unit,
- p.productCode as code,
- p.price1TextFlag as priceFlag,
- p.price1 as price,
- p.costPrice,
- p.costCheckFlag,
- p.shopID as shopId,
- p.searchKey as keyword,
- p.price8Text as beautyActFlag,
- p.minBuyNumber as minBuyNumber,
- p.maxBuyNumber as maxBuyNumber,
- p.ladderPriceFlag,
- p.normalPrice,
- p.step,
- p.shopID as shopId,
- p.taxPoint as taxRate,
- p.includedTax,
- p.invoiceType,
- p.productCategory as productCategory,
- p.validFlag,
- p.featuredFlag,
- p.commodityType,
- p.bigTypeID as bigTypeId,
- p.smallTypeID as smallTypeId,
- p.tinyTypeID as tinyTypeId,
- rpp.currentPrice as discountPrice
- from
- repeat_purchase_price rpp
- left join product p on rpp.productId = p.productID
- where rpp.delFlag = '0' and p.validFlag='2'
- and rpp.userId = #{userId}
- order by rpp.createTime desc
- </select>
- <select id="getEquipmentById" resultType="com.caimei365.commodity.model.vo.EquipmentVo">
- select id, type, title, keywords, description, headImage as image
- from cm_page
- where id = #{equipmentId} and type='2' and enabledStatus=1
- </select>
- <select id="getEquipmentParametersByType" resultType="com.caimei365.commodity.model.vo.EquipmentParameterVo">
- select id, pageId as parentId, name, content, type
- from cm_page_name_content
- where pageId = #{equipmentId}
- and type = #{typeId}
- </select>
- <select id="getImageLinkByFloorId" resultType="com.caimei365.commodity.model.vo.ImageLinkVo">
- select a.id,
- a.title,
- a.link,
- a.image
- from cm_page_image a
- right join cm_page_centre_image b on b.imageId=a.id
- where b.centreId=#{floorId} and a.enabledStatus=1
- order by a.sort desc,a.createDate desc
- </select>
- <select id="getProductRecommendsById" resultType="com.caimei365.commodity.model.search.ProductListVo">
- select
- p.productID as productId,
- p.actStatus,
- p.`name` as `name`,
- p.mainImage as image,
- IFNULL(p.visibility,3) as visibility
- from product as p
- left join cm_product_recommend as pr on pr.recommendProductID = p.productID
- where
- pr.productID = #{productId} and p.validFlag = 2
- order by pr.sort desc
- </select>
- <select id="getAutoProductRecommends" resultType="com.caimei365.commodity.model.search.ProductListVo">
- select
- p.productID as productId,
- p.actStatus,
- p.`name` as `name`,
- p.mainImage as image,
- IFNULL(p.visibility,3) as visibility
- from product as p
- where p.validFlag = 2
- and p.commodityType = (select commodityType from product as p1 where p1.productID = #{productId})
- and p.smallTypeID = (select smallTypeID from product as p2 where p2.productID = #{productId})
- order by p.sellNumber desc limit 0,7
- </select>
- <select id="findCmPageById" resultType="com.caimei365.commodity.model.vo.CmPageVo">
- select id,
- type,
- title,
- keywords,
- description,
- headImage,
- crmHeadImage,
- headLink,
- headText,
- redPacketBeginTime,
- redPacketEndTime,
- infoBarStatus
- from cm_page
- where id = #{pageId}
- and enabledStatus = '1'
- </select>
- <select id="getSearchKeyword" resultType="java.lang.String">
- select name from keyword
- where validFlag=1
- order by sortIndex desc
- </select>
- <select id="getTopMenus" resultType="com.caimei365.commodity.model.vo.TopMenuVo">
- select
- id,
- navigationName as name,
- type,
- link,
- icon,
- sort
- from new_page_first_navigation
- where delFlag = 0
- <if test="source == 1">
- and wwwEnabledStatus = 1
- </if>
- <if test="source == 2">
- and crmEnabledStatus = 1
- </if>
- order by -sort desc,createDate desc
- limit 8
- </select>
- <select id="getHelpPageTypes" resultType="com.caimei365.commodity.model.vo.BaseLinkVo">
- select
- c_helpPageTypeID as id,
- c_helpPageTypeName as name
- from c_helpPageType
- </select>
- <select id="getHelpPagesByType" resultType="com.caimei365.commodity.model.vo.BaseLinkVo">
- select
- helpPageID as id,
- helpPageTypeID as typeId,
- title as name
- from helpPage
- where validFlag = 1
- and helpPageTypeID = #{typeId}
- order by sortIndex
- </select>
- <select id="getFriendLinks" resultType="com.caimei365.commodity.model.vo.BaseLinkVo">
- select id,name,link
- from new_page_friendship_link
- where delFlag = 0 order by id
- </select>
- <select id="getMaintenanceIdByCode" resultType="java.lang.Integer">
- select cmInstrumentMaintenanceId from cm_instrument_maintenance_links where linkCode = #{code}
- </select>
- <select id="getMaintenanceById" resultType="com.caimei365.commodity.model.vo.ProductRepairVo">
- SELECT
- a.id AS "id",
- a.orderNo AS "orderNo",
- a.userId AS "userId",
- a.instrumentName AS "instrumentName",
- a.manufacturer AS "manufacturer",
- a.instrumentBrand AS "instrumentBrand",
- a.maintenanceNum AS "maintenanceNum",
- a.instrumentImage1 AS "instrumentImage1",
- a.instrumentImage2 AS "instrumentImage2",
- a.instrumentImage3 AS "instrumentImage3",
- a.instrumentImage4 AS "instrumentImage4",
- a.instrumentImage5 AS "instrumentImage5",
- a.problemDescription AS "problemDescription",
- a.userAccount AS "userAccount",
- a.userName AS "userName",
- a.userContact AS "userContact",
- a.userMobile AS "userMobile",
- concat(a.provinceName, a.cityName, a.townName, a.userAddress) AS userAddress,
- a.maintainerName AS "maintainerName",
- a.maintainerMobile AS "maintainerMobile",
- a.maintainerAddress AS "maintainerAddress",
- a.status AS "status",
- a.authenticity AS "authenticity",
- a.serviceRating AS "serviceRating",
- a.serviceEvaluate AS "serviceEvaluate",
- a.solveStatus AS "solveStatus",
- a.cancelReason AS "cancelReason",
- a.submitDate AS "submitDate",
- a.dockingDate AS "dockingDate",
- a.evaluateDate AS "evaluateDate",
- a.cancelDate AS "cancelDate",
- a.provinceName AS "provinceName",
- a.cityName AS "cityName",
- a.townName AS "townName",
- b.type AS "viewerType"
- FROM cm_instrument_maintenance a
- LEFT JOIN cm_instrument_maintenance_links b on a.id = b.cmInstrumentMaintenanceId
- WHERE a.id = #{id}
- limit 1
- </select>
- <select id="findAllCoupon" resultType="com.caimei365.commodity.model.vo.CouponVo">
- SELECT
- `id` AS "couponId",
- `couponAmount`,
- `touchPrice`,
- `startDate`,
- `endDate`,
- `couponType`,
- `userId`,
- `shopId`,
- `productType`,
- `categoryType`
- FROM
- cm_coupon
- WHERE
- delFlag = 0
- AND NOW() BETWEEN startDate
- AND endDate
- AND status != 2
- AND couponsMode = 0
- <if test="userId > 0">
- AND (couponType IN (0,1,3)
- OR couponType = 2 AND userId = #{userId}
- OR (SELECT registerTime FROM USER WHERE userID = #{userId}) <![CDATA[ >= ]]> startDate)
- </if>
- ORDER BY
- createDate DESC
- </select>
- <select id="findAllProductId" resultType="integer">
- SELECT
- productId
- FROM
- cm_coupon_product
- WHERE
- couponId = #{couponId}
- <if test="source == 1">
- AND pcStatus = 2
- </if>
- <if test="source == 2">
- AND appletsStatus = 1
- </if>
- </select>
- </mapper>
|