修改视频圈查询功能

This commit is contained in:
yangjun 2024-07-23 19:34:52 +08:00
parent 9a050aa76d
commit c87ca07f9d
3 changed files with 33 additions and 2 deletions

View File

@ -41,6 +41,7 @@ public class AppShipinquanController {
return service.findPage(page,limit,entity);
}
@PostMapping("/add")
@ApiOperation("添加视频内容")
public Result add(@RequestBody BlShipinquan BlShipinquan){

View File

@ -36,4 +36,22 @@ public class BlShipinquan implements Serializable {
@TableField(exist = false)
private String sfdz;//是否点赞0未点赞 1点赞
@TableField(exist = false)
private String parType;//1推荐视频 2附近视频 3关注视频
/**
* 经度
*/
@TableField(exist = false)
private String longitude;
/**
* 纬度
*/
@TableField(exist = false)
private String latitude;
@TableField(exist = false)
private String userId;
}

View File

@ -30,18 +30,30 @@
a.pls,
a.type,
a.pic_path,
(st_distance (point (b.longitude, b.latitude),point('125.377434','43.872621') ) *111195) as distance,
b.artificer_id as create_by,
b.artificer_img AS artificerImg,
if(c.id is null,0,1) as sfdz
FROM bl_shipinquan a
left join artificer b on a.create_by = b.user_id
left join bl_shipinquan_dianzan c on a.id = b.user_id
left join bl_shipinquan_dianzan c on a.id = b.user_id <if test="params.userId!=null and params.userId!=''">and c.create_by = #{params.userId}</if>
left join collect_artificer d on b.artificer_id = d.artificer_id
<where>
<if test="params.userId!=null and params.userId!=''">
and d.user_id = #{params.userId}
</if>
<if test="params.createBy!=null and params.createBy!=''">
and a.create_by = #{params.createBy}
</if>
</where>
order by create_time desc
<if test="params.longitude!=null and params.longitude!='' and params.latitude!=null and params.latitude!=''">
order by (st_distance (point (b.longitude, b.latitude),point(#{params.longitude},#{params.longitude}) ) *111195) asc,create_time desc
</if>
<if test="params.longitude==null or params.longitude=='' or params.latitude==null or params.latitude==''">
order by create_time desc
</if>
</select>
</mapper>