|
@@ -143,6 +143,14 @@
|
|
where productID = #{productID,jdbcType=INTEGER}
|
|
where productID = #{productID,jdbcType=INTEGER}
|
|
ORDER BY mainFlag DESC
|
|
ORDER BY mainFlag DESC
|
|
</select>
|
|
</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 id="findProductImageString" resultType="string">
|
|
select
|
|
select
|
|
image
|
|
image
|
|
@@ -196,6 +204,11 @@
|
|
</set>
|
|
</set>
|
|
where id = #{id,jdbcType=BIGINT}
|
|
where id = #{id,jdbcType=BIGINT}
|
|
</update>
|
|
</update>
|
|
|
|
+ <update id="updateViewingNum">
|
|
|
|
+ UPDATE cm_second_hand_detail SET
|
|
|
|
+ viewingNum = #{viewingNum}
|
|
|
|
+ WHERE id = #{id}
|
|
|
|
+ </update>
|
|
<insert id="insertSearchHistory" keyColumn="id" keyProperty="id" parameterType="com.caimei.module.base.entity.vo.SearchHistoryVo">
|
|
<insert id="insertSearchHistory" keyColumn="id" keyProperty="id" parameterType="com.caimei.module.base.entity.vo.SearchHistoryVo">
|
|
insert into user_search_history
|
|
insert into user_search_history
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
@@ -227,6 +240,67 @@
|
|
</if>
|
|
</if>
|
|
</trim>
|
|
</trim>
|
|
</insert>
|
|
</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,
|
|
|
|
+ secondProductType,
|
|
|
|
+ townId,
|
|
|
|
+ brandName,
|
|
|
|
+ provinceCityDistrict,
|
|
|
|
+ address,
|
|
|
|
+ productQuality,
|
|
|
|
+ productDetails,
|
|
|
|
+ viewingNum,
|
|
|
|
+ payStatus,
|
|
|
|
+ payAmount,
|
|
|
|
+ payFormData,
|
|
|
|
+ payType,
|
|
|
|
+ payDate,
|
|
|
|
+ submitDate,
|
|
|
|
+ reviewedDate,
|
|
|
|
+ onLineDate
|
|
|
|
+ ) VALUES (
|
|
|
|
+ #{productID},
|
|
|
|
+ #{sold},
|
|
|
|
+ #{secondHandType},
|
|
|
|
+ #{instrumentType},
|
|
|
|
+ #{fixedYears},
|
|
|
|
+ #{maturityYears},
|
|
|
|
+ #{companyName},
|
|
|
|
+ #{detailTalkFlag},
|
|
|
|
+ #{originalPrice},
|
|
|
|
+ #{contactName},
|
|
|
|
+ #{contactMobile},
|
|
|
|
+ #{secondProductType},
|
|
|
|
+ #{townId},
|
|
|
|
+ #{brandName},
|
|
|
|
+ #{provinceCityDistrict},
|
|
|
|
+ #{address},
|
|
|
|
+ #{productQuality},
|
|
|
|
+ #{productDetails},
|
|
|
|
+ #{viewingNum},
|
|
|
|
+ #{payStatus},
|
|
|
|
+ #{payAmount},
|
|
|
|
+ #{payFormData},
|
|
|
|
+ #{payType},
|
|
|
|
+ #{payDate},
|
|
|
|
+ #{submitDate},
|
|
|
|
+ #{reviewedDate},
|
|
|
|
+ #{onLineDate}
|
|
|
|
+ )
|
|
|
|
+ </insert>
|
|
|
|
+
|
|
<!--删除大于10条的历史记录-->
|
|
<!--删除大于10条的历史记录-->
|
|
<delete id="deleteSearchHistoryByUserId">
|
|
<delete id="deleteSearchHistoryByUserId">
|
|
DELETE FROM user_search_history
|
|
DELETE FROM user_search_history
|
|
@@ -237,6 +311,17 @@
|
|
) AS temp
|
|
) AS temp
|
|
)
|
|
)
|
|
</delete>
|
|
</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 id="deleteAllSearchHistory">
|
|
DELETE FROM
|
|
DELETE FROM
|
|
user_search_history
|
|
user_search_history
|
|
@@ -279,4 +364,40 @@
|
|
order by sellNumber desc,onlineTime desc
|
|
order by sellNumber desc,onlineTime desc
|
|
limit 7
|
|
limit 7
|
|
</select>
|
|
</select>
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ <select id="getSeconHandProductList" resultType="com.caimei.module.base.entity.po.SeconHandProduct">
|
|
|
|
+ SELECT
|
|
|
|
+ *,IF(p.brandID != 161,cb.name ,cshd.brandName) as "brandName"
|
|
|
|
+ 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 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
|
|
|
|
+ *,cb.name as "brandName"
|
|
|
|
+ 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>
|
|
</mapper>
|
|
</mapper>
|