发布通告功能
This commit is contained in:
parent
2d54c21bb7
commit
c255617a7b
@ -131,6 +131,15 @@ public class BusiNoticeController extends BaseController
|
||||
return success();
|
||||
}
|
||||
|
||||
@Log(title = "通告", businessType = BusinessType.INSERT)
|
||||
@PostMapping("saveOrUpdate")
|
||||
public AjaxResult saveOrUpdate(@RequestBody BusiNotice busiNotice)
|
||||
{
|
||||
JSONObject res = new JSONObject();
|
||||
res.put("noticeId", busiNoticeService.saveOrUpdateVo(busiNotice));
|
||||
return success(res);
|
||||
}
|
||||
|
||||
|
||||
@Log(title = "通告", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
@ -258,4 +267,25 @@ public class BusiNoticeController extends BaseController
|
||||
IPage<BusiNoticeVo> list = busiNoticeService.loveList(query,page);
|
||||
return success(list);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 小程序端查询我的通告
|
||||
* @author zcy
|
||||
* @date 15:39 2025/3/29
|
||||
* @param query 查询条件
|
||||
* @param pageNum 1
|
||||
* @param pageSize 10
|
||||
* @return com.ruoyi.common.core.domain.AjaxResult
|
||||
**/
|
||||
@GetMapping("/myNoticeList")
|
||||
public AjaxResult myNoticeList(AppNoticeQuery query,
|
||||
@RequestParam(name = "pageNum", defaultValue = "1") Integer pageNum,
|
||||
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize)
|
||||
{
|
||||
Page<BusiNotice> page = new Page<>(pageNum, pageSize);
|
||||
IPage<BusiNoticeVo> list = busiNoticeService.myNoticeList(query,page);
|
||||
return success(list);
|
||||
}
|
||||
}
|
||||
|
@ -117,8 +117,7 @@ public class BusiNoticeSignController extends BaseController
|
||||
* 用户通告报名
|
||||
*/
|
||||
@PostMapping("/userSign")
|
||||
public AjaxResult userSign(@RequestBody AppNoticeSign appNoticeSign)
|
||||
{
|
||||
public AjaxResult userSign(@RequestBody AppNoticeSign appNoticeSign) throws Exception {
|
||||
busiNoticeSignService.userSign(appNoticeSign);
|
||||
return success();
|
||||
}
|
||||
|
@ -4,6 +4,7 @@ import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import com.alibaba.fastjson2.JSONArray;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.ruoyi.common.annotation.Excel;
|
||||
@ -51,7 +52,8 @@ public class BusiNotice extends DlBaseEntity
|
||||
private String province;
|
||||
/** 城市 */
|
||||
private String city;
|
||||
|
||||
//是否平台结算
|
||||
private Integer isPlatformFree;
|
||||
/** 稿费下限 */
|
||||
@Excel(name = "稿费下限")
|
||||
private BigDecimal feeDown;
|
||||
@ -63,6 +65,8 @@ public class BusiNotice extends DlBaseEntity
|
||||
/** 是否需自报价 */
|
||||
@Excel(name = "是否需自报价")
|
||||
private Integer isSelfPrice;
|
||||
//是否有赠品 0 1
|
||||
private String haveGift;
|
||||
|
||||
/** 赠品明细 */
|
||||
@Excel(name = "赠品明细")
|
||||
@ -167,4 +171,7 @@ public class BusiNotice extends DlBaseEntity
|
||||
@TableField(exist = false)
|
||||
private List<String> customForm;
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
@ -68,6 +68,15 @@ public interface BusiNoticeMapper extends BaseMapper<BusiNotice> {
|
||||
* @return com.ruoyi.common.core.domain.AjaxResult
|
||||
**/
|
||||
IPage<BusiNoticeVo> loveList(@Param("entity") AppNoticeQuery query, Page<BusiNotice> page);
|
||||
/**
|
||||
* 小程序端我的通告列表
|
||||
* @author zcy
|
||||
* @date 15:39 2025/3/29
|
||||
* @param query 查询条件
|
||||
* @return com.ruoyi.common.core.domain.AjaxResult
|
||||
**/
|
||||
IPage<BusiNoticeVo> myNoticeList(@Param("entity") AppNoticeQuery query, Page<BusiNotice> page);
|
||||
|
||||
|
||||
/**
|
||||
* 小程序端查询通告详细信息
|
||||
|
@ -31,5 +31,7 @@ public class AppNoticeQuery {
|
||||
private Double feeDown;
|
||||
//用户id
|
||||
private Long userId;
|
||||
//'全部', '审核中', '已通过', '未合作'
|
||||
private String reportStatus;
|
||||
|
||||
}
|
||||
|
@ -46,6 +46,7 @@ public interface IBusiNoticeService extends IService<BusiNotice>
|
||||
* @param data 保存参数
|
||||
*/
|
||||
void updateByIdVo(BusiNotice data);
|
||||
String saveOrUpdateVo(BusiNotice data);
|
||||
void removeByIdsVo(List<String> ids);
|
||||
|
||||
/**
|
||||
@ -93,6 +94,9 @@ public interface IBusiNoticeService extends IService<BusiNotice>
|
||||
|
||||
IPage<BusiNoticeVo> loveList(AppNoticeQuery query, Page<BusiNotice> page);
|
||||
|
||||
IPage<BusiNoticeVo> myNoticeList(AppNoticeQuery query, Page<BusiNotice> page);
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
@ -16,5 +16,5 @@ import com.ruoyi.busi.query.AppNoticeSign;
|
||||
public interface IBusiNoticeSignService extends IService<BusiNoticeSign>
|
||||
{
|
||||
IPage<BusiNoticeSign> queryListPage(BusiNoticeSign pageReqVO, Page<BusiNoticeSign> page);
|
||||
void userSign(AppNoticeSign appNoticeSign);
|
||||
void userSign(AppNoticeSign appNoticeSign) throws Exception;
|
||||
}
|
||||
|
@ -7,7 +7,9 @@ import cn.hutool.core.util.StrUtil;
|
||||
import com.alibaba.fastjson2.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.ruoyi.base.domain.BaseCategory;
|
||||
import com.ruoyi.base.domain.BaseCity;
|
||||
import com.ruoyi.base.service.IBaseCategoryService;
|
||||
import com.ruoyi.base.service.IBaseCityService;
|
||||
import com.ruoyi.busi.domain.*;
|
||||
import com.ruoyi.busi.mapper.BusiNoticeSignMapper;
|
||||
import com.ruoyi.busi.query.AppNoticeQuery;
|
||||
@ -72,6 +74,8 @@ public class BusiNoticeServiceImpl extends ServiceImpl<BusiNoticeMapper,BusiNoti
|
||||
private IBusiSubscribeService subscribeService;
|
||||
@Autowired
|
||||
private IBusiNoticeFormService busiNoticeFormService;
|
||||
@Autowired
|
||||
private IBaseCityService cityService;
|
||||
|
||||
|
||||
@Override
|
||||
@ -184,6 +188,29 @@ public class BusiNoticeServiceImpl extends ServiceImpl<BusiNoticeMapper,BusiNoti
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public String saveOrUpdateVo(BusiNotice data) {
|
||||
if(StringUtils.isNotEmpty(data.getCity())){
|
||||
//转换城市名称
|
||||
LambdaQueryWrapper<BaseCity> queryWrapper =new LambdaQueryWrapper<>();
|
||||
queryWrapper.eq(BaseCity::getCityId,data.getCity());
|
||||
BaseCity city = cityService.getOne(queryWrapper);
|
||||
String cityName = city.getName();
|
||||
queryWrapper =new LambdaQueryWrapper<>();
|
||||
queryWrapper.eq(BaseCity::getCityId,city.getParentId());
|
||||
BaseCity parentCity = cityService.getOne(queryWrapper);
|
||||
data.setCity(cityName);
|
||||
data.setProvince(parentCity.getName());
|
||||
}
|
||||
if (StringUtils.isNotEmpty(data.getId())){
|
||||
this.updateByIdVo(data);
|
||||
}else {
|
||||
this.saveVo(data);
|
||||
}
|
||||
return data.getId();
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public void removeByIdsVo(List<String> ids) {
|
||||
@ -279,10 +306,6 @@ public class BusiNoticeServiceImpl extends ServiceImpl<BusiNoticeMapper,BusiNoti
|
||||
IPage<BusiNoticeVo> pageList = busiNoticeMapper.queryAppListPage(query,page);
|
||||
List<String> idList = pageList.getRecords().stream().map(BusiNotice::getId).collect(Collectors.toList());
|
||||
if(!idList.isEmpty()){
|
||||
//查报名数量
|
||||
List<Map<String,Object>> mapList = busiNoticeSignMapper.selectReportNumByIdList(idList);
|
||||
//转map
|
||||
Map<String,Object> objectMap = mapList.stream().collect(Collectors.toMap(each-> Objects.toString(each.get("id"),""),each->each.get("reportNum")));
|
||||
//查博主类型字典
|
||||
List<BaseCategory> categoryList = baseCategoryService.listByParentCode(DictConstants.BLOGGER_TYPES_KEY,null);
|
||||
//转map
|
||||
@ -292,11 +315,6 @@ public class BusiNoticeServiceImpl extends ServiceImpl<BusiNoticeMapper,BusiNoti
|
||||
if(null==item.getViewNum()){
|
||||
item.setViewNum(0);
|
||||
}
|
||||
if(!objectMap.containsKey(item.getId()) || null==objectMap.get(item.getId())){
|
||||
item.setReportNum(0);
|
||||
}else{
|
||||
item.setReportNum((Integer) objectMap.get(item.getId()));
|
||||
}
|
||||
item.setBloggerTypesText(noticeUtils.translateBloggerTypes(item.getBloggerTypes(),categoryMap));
|
||||
if(StringUtils.isNotEmpty(item.getImages())){
|
||||
item.setMainImage(item.getImages().split(StrUtil.COMMA)[0]);
|
||||
@ -321,10 +339,6 @@ public class BusiNoticeServiceImpl extends ServiceImpl<BusiNoticeMapper,BusiNoti
|
||||
IPage<BusiNoticeVo> pageList = busiNoticeMapper.appFootprintList(query,page);
|
||||
List<String> idList = pageList.getRecords().stream().map(BusiNotice::getId).collect(Collectors.toList());
|
||||
if(!idList.isEmpty()){
|
||||
//查报名数量
|
||||
List<Map<String,Object>> mapList = busiNoticeSignMapper.selectReportNumByIdList(idList);
|
||||
//转map
|
||||
Map<String,Object> objectMap = mapList.stream().collect(Collectors.toMap(each-> Objects.toString(each.get("id"),""),each->each.get("reportNum")));
|
||||
//查博主类型字典
|
||||
List<BaseCategory> categoryList = baseCategoryService.listByParentCode(DictConstants.BLOGGER_TYPES_KEY,null);
|
||||
//转map
|
||||
@ -334,11 +348,7 @@ public class BusiNoticeServiceImpl extends ServiceImpl<BusiNoticeMapper,BusiNoti
|
||||
if(null==item.getViewNum()){
|
||||
item.setViewNum(0);
|
||||
}
|
||||
if(!objectMap.containsKey(item.getId()) || null==objectMap.get(item.getId())){
|
||||
item.setReportNum(0);
|
||||
}else{
|
||||
item.setReportNum((Integer) objectMap.get(item.getId()));
|
||||
}
|
||||
|
||||
item.setBloggerTypesText(noticeUtils.translateBloggerTypes(item.getBloggerTypes(),categoryMap));
|
||||
if(StringUtils.isNotEmpty(item.getImages())){
|
||||
item.setMainImage(item.getImages().split(StrUtil.COMMA)[0]);
|
||||
@ -394,6 +404,7 @@ public class BusiNoticeServiceImpl extends ServiceImpl<BusiNoticeMapper,BusiNoti
|
||||
}
|
||||
res.put("isLove",false);
|
||||
res.put("isSign",false);
|
||||
res.put("passSign",false);
|
||||
if (null != userId){
|
||||
LambdaQueryWrapper<BusiUserLove> queryWrapper =new LambdaQueryWrapper<>();
|
||||
queryWrapper.eq(BusiUserLove::getUserId,userId).eq(BusiUserLove::getLoveUserId,detail.getUserId());
|
||||
@ -405,6 +416,11 @@ public class BusiNoticeServiceImpl extends ServiceImpl<BusiNoticeMapper,BusiNoti
|
||||
if(busiNoticeSignMapper.selectOne(new LambdaQueryWrapper<BusiNoticeSign>().eq(BusiNoticeSign::getNoticeId, noticeId).eq(BusiNoticeSign::getUserId, userId).last("limit 1"))!=null){
|
||||
res.put("isSign",true);
|
||||
}
|
||||
|
||||
//当前用户是否已通过当前报名
|
||||
if(busiNoticeSignMapper.selectOne(new LambdaQueryWrapper<BusiNoticeSign>().eq(BusiNoticeSign::getNoticeId, noticeId).eq(BusiNoticeSign::getUserId, userId).eq(BusiNoticeSign::getStatus,"1").last("limit 1"))!=null){
|
||||
res.put("passSign",true);
|
||||
}
|
||||
}
|
||||
return res;
|
||||
}
|
||||
@ -442,7 +458,26 @@ public class BusiNoticeServiceImpl extends ServiceImpl<BusiNoticeMapper,BusiNoti
|
||||
subscribeDataObj.setFeeDown(null);
|
||||
subscribeDataObj.setFeeUp(null);
|
||||
}
|
||||
return baseMapper.subscribeList(subscribeDataObj,page);
|
||||
IPage<BusiNoticeVo> pageList = baseMapper.subscribeList(subscribeDataObj, page);
|
||||
|
||||
List<String> idList = pageList.getRecords().stream().map(BusiNotice::getId).collect(Collectors.toList());
|
||||
if(!idList.isEmpty()){
|
||||
//查博主类型字典
|
||||
List<BaseCategory> categoryList = baseCategoryService.listByParentCode(DictConstants.BLOGGER_TYPES_KEY,null);
|
||||
//转map
|
||||
Map<String,String> categoryMap = categoryList.stream().collect(Collectors.toMap(BaseCategory::getCode,BaseCategory::getTitle));
|
||||
pageList.getRecords().forEach(item->{
|
||||
//报名数量、浏览量、相关字典转换
|
||||
if(null==item.getViewNum()){
|
||||
item.setViewNum(0);
|
||||
}
|
||||
item.setBloggerTypesText(noticeUtils.translateBloggerTypes(item.getBloggerTypes(),categoryMap));
|
||||
if(StringUtils.isNotEmpty(item.getImages())){
|
||||
item.setMainImage(item.getImages().split(StrUtil.COMMA)[0]);
|
||||
}
|
||||
});
|
||||
}
|
||||
return pageList;
|
||||
}else {
|
||||
//未设置订阅则使用常规查询
|
||||
return this.queryAppListPage(query,page);
|
||||
@ -461,7 +496,57 @@ public class BusiNoticeServiceImpl extends ServiceImpl<BusiNoticeMapper,BusiNoti
|
||||
//获取当前登录用户
|
||||
Long userId = SecurityUtils.getUserId();
|
||||
query.setUserId(userId);
|
||||
return baseMapper.loveList(query,page);
|
||||
IPage<BusiNoticeVo> pageList = baseMapper.loveList(query, page);
|
||||
List<String> idList = pageList.getRecords().stream().map(BusiNotice::getId).collect(Collectors.toList());
|
||||
if(!idList.isEmpty()){
|
||||
//查博主类型字典
|
||||
List<BaseCategory> categoryList = baseCategoryService.listByParentCode(DictConstants.BLOGGER_TYPES_KEY,null);
|
||||
//转map
|
||||
Map<String,String> categoryMap = categoryList.stream().collect(Collectors.toMap(BaseCategory::getCode,BaseCategory::getTitle));
|
||||
pageList.getRecords().forEach(item->{
|
||||
//报名数量、浏览量、相关字典转换
|
||||
if(null==item.getViewNum()){
|
||||
item.setViewNum(0);
|
||||
}
|
||||
item.setBloggerTypesText(noticeUtils.translateBloggerTypes(item.getBloggerTypes(),categoryMap));
|
||||
if(StringUtils.isNotEmpty(item.getImages())){
|
||||
item.setMainImage(item.getImages().split(StrUtil.COMMA)[0]);
|
||||
}
|
||||
});
|
||||
}
|
||||
return pageList;
|
||||
}
|
||||
/**
|
||||
* 小程序端我的通告列表
|
||||
* @author zcy
|
||||
* @date 15:39 2025/3/29
|
||||
* @param query 查询条件
|
||||
* @return com.ruoyi.common.core.domain.AjaxResult
|
||||
**/
|
||||
@Override
|
||||
public IPage<BusiNoticeVo> myNoticeList(AppNoticeQuery query, Page<BusiNotice> page) {
|
||||
//获取当前登录用户
|
||||
Long userId = SecurityUtils.getUserId();
|
||||
query.setUserId(userId);
|
||||
IPage<BusiNoticeVo> pageList = baseMapper.myNoticeList(query, page);
|
||||
List<String> idList = pageList.getRecords().stream().map(BusiNotice::getId).collect(Collectors.toList());
|
||||
if(!idList.isEmpty()){
|
||||
//查博主类型字典
|
||||
List<BaseCategory> categoryList = baseCategoryService.listByParentCode(DictConstants.BLOGGER_TYPES_KEY,null);
|
||||
//转map
|
||||
Map<String,String> categoryMap = categoryList.stream().collect(Collectors.toMap(BaseCategory::getCode,BaseCategory::getTitle));
|
||||
pageList.getRecords().forEach(item->{
|
||||
//报名数量、浏览量、相关字典转换
|
||||
if(null==item.getViewNum()){
|
||||
item.setViewNum(0);
|
||||
}
|
||||
item.setBloggerTypesText(noticeUtils.translateBloggerTypes(item.getBloggerTypes(),categoryMap));
|
||||
if(StringUtils.isNotEmpty(item.getImages())){
|
||||
item.setMainImage(item.getImages().split(StrUtil.COMMA)[0]);
|
||||
}
|
||||
});
|
||||
}
|
||||
return pageList;
|
||||
}
|
||||
|
||||
|
||||
|
@ -4,6 +4,7 @@ import java.util.List;
|
||||
|
||||
import com.alibaba.fastjson2.JSONArray;
|
||||
import com.alibaba.fastjson2.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.ruoyi.busi.query.AppNoticeSign;
|
||||
import com.ruoyi.common.core.domain.model.LoginUser;
|
||||
import com.ruoyi.common.utils.DateUtils;
|
||||
@ -39,9 +40,14 @@ public class BusiNoticeSignServiceImpl extends ServiceImpl<BusiNoticeSignMapper,
|
||||
* @param appNoticeSign 报名实体
|
||||
*/
|
||||
@Override
|
||||
public void userSign(AppNoticeSign appNoticeSign) {
|
||||
public void userSign(AppNoticeSign appNoticeSign) throws Exception {
|
||||
LoginUser loginUser = SecurityUtils.getLoginUser();
|
||||
//当前用户是否已报名该通告
|
||||
if(busiNoticeSignMapper.selectOne(new LambdaQueryWrapper<BusiNoticeSign>().eq(BusiNoticeSign::getNoticeId, appNoticeSign.getNoticeId()).eq(BusiNoticeSign::getUserId, loginUser.getUserId()).last("limit 1"))!=null){
|
||||
throw new Exception("请勿重复报名!");
|
||||
}
|
||||
for (JSONObject cardInfo : appNoticeSign.getCardList()) {
|
||||
|
||||
BusiNoticeSign busiNoticeSign =new BusiNoticeSign();
|
||||
busiNoticeSign.setNoticeId(appNoticeSign.getNoticeId());
|
||||
busiNoticeSign.setUserId(loginUser.getUserId());
|
||||
|
@ -41,7 +41,9 @@ public class NoticeUtils {
|
||||
List<String> rtnList = new ArrayList<>();
|
||||
List<String> bloggerTypeList = Arrays.asList(bloggerTypes.split(StrUtil.COMMA));
|
||||
bloggerTypeList.forEach(item->{
|
||||
rtnList.add(categoryMap.get(item));
|
||||
if(categoryMap.get(item)!=null){
|
||||
rtnList.add(categoryMap.get(item));
|
||||
}
|
||||
});
|
||||
return String.join(" ",rtnList);
|
||||
}
|
||||
|
@ -1,9 +1,12 @@
|
||||
package com.ruoyi.busi.vo;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.ruoyi.busi.domain.BusiNotice;
|
||||
import com.ruoyi.common.annotation.Excel;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
@Data
|
||||
public class BusiNoticeVo extends BusiNotice {
|
||||
/**发布者名称**/
|
||||
@ -29,4 +32,9 @@ public class BusiNoticeVo extends BusiNotice {
|
||||
* 审核人姓名
|
||||
*/
|
||||
private String approvalUserName;
|
||||
//报名时间
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm")
|
||||
private Date signTime;
|
||||
|
||||
|
||||
}
|
||||
|
@ -66,11 +66,13 @@ order by dbns.create_time desc
|
||||
dbn.*,
|
||||
dbnv.view_num AS viewNum,
|
||||
su.avatar,
|
||||
su.nick_name AS userNickName
|
||||
su.nick_name AS userNickName,
|
||||
count(sign.id) as reportNum
|
||||
FROM
|
||||
dl_busi_notice dbn
|
||||
LEFT JOIN dl_busi_notice_view dbnv ON dbn.id = dbnv.id
|
||||
LEFT JOIN sys_user su ON dbn.user_id = su.user_id
|
||||
left join dl_busi_notice_sign sign on sign.notice_id = dbn.id and sign.del_flag = 0
|
||||
WHERE
|
||||
dbn.del_flag = 0
|
||||
AND (dbn.approval_status = '1')
|
||||
@ -105,6 +107,7 @@ order by dbns.create_time desc
|
||||
<if test="entity.feeDown!=null">
|
||||
AND ( dbn.fee_down >=#{entity.feeDown} )
|
||||
</if>
|
||||
group by dbn.id
|
||||
ORDER BY
|
||||
<choose>
|
||||
<when test="entity.sortBy=='new'">
|
||||
@ -141,12 +144,14 @@ order by dbns.create_time desc
|
||||
dbn.*,
|
||||
dbnv.view_num AS viewNum,
|
||||
su.avatar,
|
||||
su.nick_name AS userNickName
|
||||
su.nick_name AS userNickName,
|
||||
count(sign.id) as reportNum
|
||||
FROM
|
||||
dl_busi_notice dbn
|
||||
LEFT JOIN dl_busi_notice_view dbnv ON dbn.id = dbnv.id
|
||||
inner join dl_member_footprint footprint on footprint.notice_id = dbn.id and footprint.user_id = #{entity.userId}
|
||||
LEFT JOIN sys_user su ON dbn.user_id = su.user_id
|
||||
left join dl_busi_notice_sign sign on sign.notice_id = dbn.id and sign.del_flag = 0
|
||||
WHERE
|
||||
dbn.del_flag = 0
|
||||
AND (dbn.approval_status = '1')
|
||||
@ -182,6 +187,7 @@ order by dbns.create_time desc
|
||||
<if test="entity.feeDown!=null">
|
||||
AND ( dbn.fee_down >=#{entity.feeDown} )
|
||||
</if>
|
||||
group by dbn.id
|
||||
ORDER BY
|
||||
<choose>
|
||||
<when test="entity.sortBy=='new'">
|
||||
@ -203,23 +209,25 @@ order by dbns.create_time desc
|
||||
dbn.*,
|
||||
dbnv.view_num AS viewNum,
|
||||
su.avatar,
|
||||
su.nick_name AS userNickName
|
||||
su.nick_name AS userNickName,
|
||||
count(sign.id) as reportNum
|
||||
FROM
|
||||
dl_busi_notice dbn
|
||||
LEFT JOIN dl_busi_notice_view dbnv ON dbn.id = dbnv.id
|
||||
LEFT JOIN sys_user su ON dbn.user_id = su.user_id
|
||||
left join dl_busi_notice_sign sign on sign.notice_id = dbn.id and sign.del_flag = 0
|
||||
WHERE
|
||||
dbn.del_flag = 0
|
||||
AND (dbn.approval_status = '1')
|
||||
and dbn.end_date >= CURDATE()
|
||||
<if test="entity.platformCode!=null and entity.platformCode!=''">
|
||||
<if test="entity.platformCode!=null and entity.platformCode.size>0">
|
||||
and dbn.platform_code IN
|
||||
<foreach collection="entity.platformCode" item="it" open="(" close=")" separator=",">
|
||||
-- platform_code 包含it
|
||||
#{it}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="entity.bloggerTypeCode!=null and entity.bloggerTypeCode!=''">
|
||||
<if test="entity.bloggerTypeCode!=null and entity.bloggerTypeCode.size>0">
|
||||
and
|
||||
<foreach collection="entity.bloggerTypeCode" item="it" open="(" close=")" separator="or">
|
||||
dbn.blogger_types like concat('%',#{it},'%')
|
||||
@ -229,7 +237,7 @@ order by dbns.create_time desc
|
||||
and dbn.settle_type = #{entity.settleTypeCode}
|
||||
</if>
|
||||
|
||||
<if test="entity.keywordsList!=null and entity.keywordsList!=''">
|
||||
<if test="entity.keywordsList!=null and entity.keywordsList.size>0 ">
|
||||
and
|
||||
<foreach collection="entity.keywordsList" item="it" open="(" close=")" separator="or">
|
||||
title like concat('%',#{it},'%') or detail like concat('%',#{it},'%') or brand like concat('%',#{it},'%')
|
||||
@ -247,21 +255,12 @@ order by dbns.create_time desc
|
||||
<if test="entity.feeDown!=null">
|
||||
AND ( dbn.fee_down >=#{entity.feeDown} )
|
||||
</if>
|
||||
group by dbn.id
|
||||
ORDER BY
|
||||
<choose>
|
||||
<when test="entity.sortBy=='new'">
|
||||
-- 查最新的 --
|
||||
dbn.create_time DESC
|
||||
</when>
|
||||
<when test="entity.sortBy=='money'">
|
||||
-- 查高奖励 --
|
||||
dbn.fee_up DESC
|
||||
</when>
|
||||
<otherwise>
|
||||
-- 默认正序排列 --
|
||||
dbn.create_time DESC
|
||||
</otherwise>
|
||||
</choose>
|
||||
|
||||
-- 默认正序排列 --
|
||||
dbn.create_time DESC
|
||||
|
||||
|
||||
</select>
|
||||
<select id="loveList" resultType="com.ruoyi.busi.vo.BusiNoticeVo">
|
||||
@ -269,31 +268,62 @@ order by dbns.create_time desc
|
||||
dbn.*,
|
||||
dbnv.view_num AS viewNum,
|
||||
su.avatar,
|
||||
su.nick_name AS userNickName
|
||||
su.nick_name AS userNickName,
|
||||
count(sign.id) as reportNum
|
||||
FROM
|
||||
dl_busi_notice dbn
|
||||
LEFT JOIN dl_busi_notice_view dbnv ON dbn.id = dbnv.id
|
||||
LEFT JOIN sys_user su ON dbn.user_id = su.user_id
|
||||
inner join dl_busi_user_love love on dbn.user_id = love.love_user_id and love.user_id = #{entity.userId}
|
||||
left join dl_busi_notice_sign sign on sign.notice_id = dbn.id and sign.del_flag = 0
|
||||
WHERE
|
||||
dbn.del_flag = 0
|
||||
AND (dbn.approval_status = '1')
|
||||
and dbn.end_date >= CURDATE()
|
||||
group by dbn.id
|
||||
ORDER BY
|
||||
<choose>
|
||||
<when test="entity.sortBy=='new'">
|
||||
-- 查最新的 --
|
||||
dbn.create_time DESC
|
||||
</when>
|
||||
<when test="entity.sortBy=='money'">
|
||||
-- 查高奖励 --
|
||||
dbn.fee_up DESC
|
||||
</when>
|
||||
<otherwise>
|
||||
-- 默认正序排列 --
|
||||
dbn.create_time DESC
|
||||
</otherwise>
|
||||
</choose>
|
||||
dbn.create_time DESC
|
||||
</select>
|
||||
<select id="myNoticeList" resultType="com.ruoyi.busi.vo.BusiNoticeVo">
|
||||
SELECT
|
||||
dbn.*,
|
||||
dbnv.view_num AS viewNum,
|
||||
su.avatar,
|
||||
su.nick_name AS userNickName,
|
||||
count(sign.id) as reportNum,
|
||||
sign.create_time as signTime,
|
||||
CASE
|
||||
WHEN sign.status = '0' AND dbn.end_date >= CURDATE() THEN '审核中'
|
||||
WHEN sign.status = '1' THEN '已通过'
|
||||
WHEN sign.status = '0' AND dbn.end_date < CURDATE() THEN '未合作'
|
||||
ELSE '已过期'
|
||||
END AS signStatus
|
||||
FROM
|
||||
dl_busi_notice dbn
|
||||
LEFT JOIN dl_busi_notice_view dbnv ON dbn.id = dbnv.id
|
||||
LEFT JOIN sys_user su ON dbn.user_id = su.user_id
|
||||
inner join dl_busi_user_love love on dbn.user_id = love.love_user_id and love.user_id = #{entity.userId}
|
||||
inner join dl_busi_notice_sign sign on sign.notice_id = dbn.id and sign.del_flag = 0 and sign.user_id = #{entity.userId}
|
||||
WHERE
|
||||
dbn.del_flag = 0
|
||||
AND (dbn.approval_status = '1')
|
||||
<if test="entity.reportStatus!=null and entity.reportStatus!='' ">
|
||||
<choose>
|
||||
<when test="entity.reportStatus=='审核中'">
|
||||
and sign.status ='0' and dbn.end_date >= CURDATE()
|
||||
</when>
|
||||
<when test="entity.reportStatus=='已通过'">
|
||||
and sign.status ='1'
|
||||
</when>
|
||||
<when test="entity.reportStatus=='未合作'">
|
||||
and sign.status ='0' and dbn.end_date < CURDATE()
|
||||
</when>
|
||||
|
||||
</choose>
|
||||
</if>
|
||||
group by dbn.id
|
||||
ORDER BY
|
||||
dbn.create_time DESC
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
|
Loading…
Reference in New Issue
Block a user