修改视频圈接口

This commit is contained in:
yangjun 2024-07-23 20:24:29 +08:00
parent 0be47be770
commit e7bb3b9bf7
8 changed files with 51 additions and 6 deletions

View File

@ -74,11 +74,8 @@ public class AppShipinquanController {
@GetMapping("/contentlist")
@ApiOperation("获取评论数据列表")
public Result list(BlShipinquanPinglun entity, Integer page, Integer limit){
QueryWrapper<BlShipinquanPinglun> qw = new QueryWrapper<>();
qw.orderByDesc("create_time");
qw.eq("shipinquan_id",entity.getShipinquanId());
IPage<BlShipinquanPinglun> pageList = pinglunservice.page(new Page<>(page,limit),qw);
public Result contentlist(BlShipinquanPinglun entity, Integer page, Integer limit){
IPage<BlShipinquanPinglun> pageList = pinglunservice.contentlist(new Page<>(page,limit),entity);
return Result.success().put("data",pageList);
}

View File

@ -1,10 +1,13 @@
package com.sqx.modules.shipinquan.dao;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.sqx.modules.shipinquan.entity.BlShipinquanPinglun;
import org.apache.ibatis.annotations.Mapper;
@Mapper
public interface BlShipinquanPinglunDao extends BaseMapper<BlShipinquanPinglun> {
IPage<BlShipinquanPinglun> contentlist(Page<Object> objectPage, BlShipinquanPinglun entity);
}

View File

@ -52,6 +52,9 @@ public class BlShipinquan implements Serializable {
@TableField(exist = false)
private String userId;
@TableField(exist = false)
private String artificerName;
}

View File

@ -1,6 +1,7 @@
package com.sqx.modules.shipinquan.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
@ -32,6 +33,10 @@ public class BlShipinquanPinglun implements Serializable {
private Long createBy;//创建人
private String content;//发布内容
private int shipinquanId;//主表id
@TableField(exist = false)
private String userName;
@TableField(exist = false)
private String userPhoto;
}

View File

@ -1,8 +1,11 @@
package com.sqx.modules.shipinquan.service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.sqx.modules.shipinquan.entity.BlShipinquanPinglun;
public interface BlShipinquanPinglunService extends IService<BlShipinquanPinglun> {
IPage<BlShipinquanPinglun> contentlist(Page<Object> objectPage, BlShipinquanPinglun entity);
}

View File

@ -1,5 +1,7 @@
package com.sqx.modules.shipinquan.service.impl;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.sqx.modules.shipinquan.dao.BlShipinquanPinglunDao;
import com.sqx.modules.shipinquan.entity.BlShipinquanPinglun;
@ -9,4 +11,8 @@ import org.springframework.stereotype.Service;
@Service
public class BlShipinquanPinglunServiceImpl extends ServiceImpl<BlShipinquanPinglunDao, BlShipinquanPinglun> implements BlShipinquanPinglunService {
@Override
public IPage<BlShipinquanPinglun> contentlist(Page<Object> objectPage, BlShipinquanPinglun entity) {
return baseMapper.contentlist(objectPage,entity);
}
}

View File

@ -30,8 +30,8 @@
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_name as artificer_name,
b.artificer_img AS artificerImg,
if(c.id is null,0,1) as sfdz
FROM bl_shipinquan a

View File

@ -0,0 +1,28 @@
<?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.sqx.modules.shipinquan.dao.BlShipinquanPinglunDao">
<select id="contentlist" resultType="com.sqx.modules.shipinquan.entity.BlShipinquanPinglun">
select
a.id,
a.create_by,
a.create_time,
a.content,
a.shipinquan_id,
b.user_name as user_name,
b.avatar as user_photo
from bl_shipinquan_pinglun a
LEFT JOIN tb_user b on a.create_by = b.user_id
<where>
<if test="params.shipinquanId!=null and params.shipinquanId!=''">
and a.shipinquan_id = #{params.shipinquanId}
</if>
</where>
order by a.create_time desc
</select>
</mapper>