|
@@ -109,5 +109,59 @@
|
|
|
right join city b on a.provinceId = b.provinceId
|
|
|
right join town c on b.cityId = c.cityId where c.townId = #{townId}
|
|
|
</select>
|
|
|
-
|
|
|
+ <select id="getOrderPageSecondList" resultType="com.caimei365.commodity.model.vo.SecondListVo">
|
|
|
+ select
|
|
|
+ p.productID as productId,
|
|
|
+ p.`name` as name,
|
|
|
+ p.mainImage as image,
|
|
|
+ p.price1 as price,
|
|
|
+ p.brandID as brandId,
|
|
|
+ IF(p.brandID != 161,cb.name ,cshd.brandName) as "brandName",
|
|
|
+ cshd.sold as "sold",
|
|
|
+ cshd.detailTalkFlag as "detailTalkFlag",
|
|
|
+ cshd.onLineDate as "onLineDate",
|
|
|
+ cshd.viewingNum as "viewingNum",
|
|
|
+ cshd.provinceCityDistrict as "provinceCityDistrict"
|
|
|
+ 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="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="getSecondListByLimit" resultType="com.caimei365.commodity.model.vo.SecondListVo">
|
|
|
+ select
|
|
|
+ p.productID as productId,
|
|
|
+ p.`name` as name,
|
|
|
+ p.mainImage as image,
|
|
|
+ p.price1 as price,
|
|
|
+ p.brandID as brandId,
|
|
|
+ IF(p.brandID != 161,cb.name ,cshd.brandName) as "brandName",
|
|
|
+ cshd.sold as "sold",
|
|
|
+ cshd.detailTalkFlag as "detailTalkFlag",
|
|
|
+ cshd.onLineDate as "onLineDate",
|
|
|
+ cshd.viewingNum as "viewingNum",
|
|
|
+ cshd.provinceCityDistrict as "provinceCityDistrict"
|
|
|
+ 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="secondHandType != null and secondHandType != ''">
|
|
|
+ and cshd.secondHandType = #{secondHandType}
|
|
|
+ </if>
|
|
|
+ order by cshd.onLineDate desc
|
|
|
+ limit 10
|
|
|
+ </select>
|
|
|
</mapper>
|