|
@@ -92,17 +92,17 @@
|
|
|
<if test="courseRequestVo.instructorId != null and courseRequestVo.instructorId !=''">
|
|
|
and b.user_id=#{courseRequestVo.instructorId}
|
|
|
</if>
|
|
|
- <if test="courseRequestVo.instructorId != null and courseRequestVo.instructorId !=''">
|
|
|
+ <if test="courseRequestVo.siteId != null and courseRequestVo.siteId !=''">
|
|
|
and b.site_id=#{courseRequestVo.siteId}
|
|
|
</if>
|
|
|
- <if test="courseRequestVo.instructorId != null and courseRequestVo.instructorId !=''">
|
|
|
- and b.site_id=#{courseRequestVo.siteId}
|
|
|
+ <if test="courseRequestVo.priceType != null">
|
|
|
+ and b.price_type=#{courseRequestVo.priceType}
|
|
|
</if>
|
|
|
GROUP BY b.id
|
|
|
</select>
|
|
|
<select id="findByLaLoList" resultType="org.jeecg.modules.app.vo.course.CourseResponseVo">
|
|
|
- select b.`name`,e.address,b.original_price,b.selling_price
|
|
|
- ,b.id,b.price_type,b.good_rate,e.latitude,e.longitude,count(c.courses_id) as coursesNum,
|
|
|
+ select b.`name`,e.address,b.original_price,b.selling_price,b.cover
|
|
|
+ ,b.id,b.price_type,ROUND(b.good_rate * 100) as good_rate ,e.latitude,e.longitude,count(c.courses_id) as coursesNum,
|
|
|
ST_Distance_Sphere(
|
|
|
POINT(#{courseRequestVo.longitude}, #{courseRequestVo.latitude}),
|
|
|
POINT(e.longitude, e.latitude)
|
|
@@ -110,6 +110,16 @@
|
|
|
FROM nm_courses b
|
|
|
LEFT JOIN nm_courses_price_rules c on b.id= c.courses_id
|
|
|
LEFT JOIN nm_site e on e.id = b.site_id
|
|
|
+ where 1=1
|
|
|
+ <if test="courseRequestVo.instructorId != null and courseRequestVo.instructorId !=''">
|
|
|
+ and b.user_id=#{courseRequestVo.instructorId}
|
|
|
+ </if>
|
|
|
+ <if test="courseRequestVo.siteId != null and courseRequestVo.siteId !=''">
|
|
|
+ and b.site_id=#{courseRequestVo.siteId}
|
|
|
+ </if>
|
|
|
+ <if test="courseRequestVo.priceType != null">
|
|
|
+ and b.price_type=#{courseRequestVo.priceType}
|
|
|
+ </if>
|
|
|
GROUP BY b.id
|
|
|
<if test="courseRequestVo.orderByType != null and courseRequestVo.orderByType == '1'">
|
|
|
ORDER BY km DESC
|
|
@@ -120,6 +130,9 @@
|
|
|
<if test="courseRequestVo.orderByType != null and courseRequestVo.orderByType == '0'">
|
|
|
ORDER BY b.create_time DESC
|
|
|
</if>
|
|
|
+ <if test="courseRequestVo.orderByType != null and courseRequestVo.orderByType == '0'">
|
|
|
+ ORDER BY b.good_rate DESC
|
|
|
+ </if>
|
|
|
</select>
|
|
|
<select id="findByList" resultType="org.jeecg.modules.app.vo.course.CourseResponseVo">
|
|
|
select b.`name`,e.address,b.original_price,b.selling_price
|
|
@@ -127,6 +140,16 @@
|
|
|
FROM nm_courses b
|
|
|
LEFT JOIN nm_courses_price_rules c on b.id= c.courses_id
|
|
|
LEFT JOIN nm_site e on e.id = b.site_id
|
|
|
+ where 1=1
|
|
|
+ <if test="courseRequestVo.instructorId != null and courseRequestVo.instructorId !=''">
|
|
|
+ and b.user_id=#{courseRequestVo.instructorId}
|
|
|
+ </if>
|
|
|
+ <if test="courseRequestVo.siteId != null and courseRequestVo.siteId !=''">
|
|
|
+ and b.site_id=#{courseRequestVo.siteId}
|
|
|
+ </if>
|
|
|
+ <if test="courseRequestVo.priceType != null">
|
|
|
+ and b.price_type=#{courseRequestVo.priceType}
|
|
|
+ </if>
|
|
|
GROUP BY b.id
|
|
|
<if test="courseRequestVo.orderByType != null and courseRequestVo.orderByType == '1'">
|
|
|
ORDER BY b.create_time DESC
|