1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192 |
- <?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.PriceMapper">
- <select id="getIdentityByUserId" resultType="java.lang.Integer">
- select userIdentity from user where userID = #{userId}
- </select>
- <select id="getDetailPrice" resultType="com.caimei365.commodity.model.vo.PriceVo">
- select
- p.productID as productId,
- p.price1 as price,
- p.minBuyNumber as minBuyNumber,
- p.maxBuyNumber as maxBuyNumber,
- p.price1TextFlag as priceFlag,
- p.ladderPriceFlag as ladderPriceFlag,
- p.normalPrice as normalPrice,
- p.costPrice as costPrice,
- p.costProportional as costProportional,
- p.costCheckFlag as costCheckFlag,
- p.step as step,
- p.shopID as shopId,
- p.taxPoint as taxRate,
- p.includedTax as includedTax,
- p.invoiceType as invoiceType
- from product p
- where productID = #{productId}
- </select>
- <select id="getListPriceByProductIds" resultType="com.caimei365.commodity.model.vo.PriceVo">
- select
- p.productID as productId,
- p.price1 as price,
- p.minBuyNumber as minBuyNumber,
- p.maxBuyNumber as maxBuyNumber,
- p.price1TextFlag as priceFlag,
- p.ladderPriceFlag as ladderPriceFlag,
- p.normalPrice as normalPrice,
- p.costPrice as costPrice,
- p.costProportional as costProportional,
- p.costCheckFlag as costCheckFlag,
- p.step as step,
- p.shopID as shopId,
- p.includedTax as includedTax,
- p.invoiceType as invoiceType,
- p.taxPoint as taxRate
- from product p
- where productID in
- <foreach collection="productIds" open="(" separator="," close=")" item="productId">
- #{productId}
- </foreach>
- </select>
- <select id="getladderPricesByProductId" resultType="com.caimei365.commodity.model.vo.LadderPriceVo">
- select
- id, productId, ladderNum, buyNum, buyPrice
- from product_ladder_price
- where productId = #{productId} and userType = 3 and delFlag = 0
- order by ladderNum asc
- </select>
- <select id="findLowerLadderPrice" resultType="com.caimei365.commodity.model.vo.LadderPriceVo">
- select
- id, productId, ladderNum, buyNum, buyPrice
- from product_ladder_price
- where productId = #{productId} and userType = 3 and delFlag = 0
- order by ladderNum DESC
- limit 1
- </select>
- <select id="findMaxLadderPrice" resultType="com.caimei365.commodity.model.vo.LadderPriceVo">
- select
- id, productId, ladderNum, buyNum, buyPrice
- from product_ladder_price
- where productId = #{productId} and userType = 3 and delFlag = 0
- order by ladderNum asc
- limit 1
- </select>
- <select id="getRepurchasePrice" resultType="java.lang.Double">
- select
- r.currentPrice
- from repeat_purchase_price r
- left join product p on p.productID = r.productId
- where r.productId = #{productId} and userId = #{userId}
- and ((p.costCheckFlag=1 and r.currentPrice <![CDATA[ >= ]]> p.costPrice) or p.costCheckFlag=2)
- and p.price1 <![CDATA[ >= ]]> r.currentPrice
- and r.delFlag = 0
- </select>
- <select id="getTaxByProductId" resultType="com.caimei365.commodity.model.vo.TaxVo">
- select
- p.includedTax as includedTax,
- p.invoiceType as invoiceType,
- p.taxPoint as taxPoint
- from product p
- where productID = #{productId}
- </select>
- </mapper>
|