feat(communityCenter): 新增社区通知功能并调整收益信息相关代码
parent
e3a27c5199
commit
43b79969ee
|
@ -0,0 +1,43 @@
|
||||||
|
package com.mcwl.web.controller.communityCenter;
|
||||||
|
|
||||||
|
|
||||||
|
import com.mcwl.common.core.domain.R;
|
||||||
|
import com.mcwl.common.core.page.TableDataInfo;
|
||||||
|
import com.mcwl.communityCenter.domain.dto.*;
|
||||||
|
import com.mcwl.communityCenter.domain.vo.CommunityDetailVo;
|
||||||
|
import com.mcwl.communityCenter.service.CommunityAdviceService;
|
||||||
|
import com.mcwl.communityCenter.service.CommunityService;
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import io.swagger.annotations.ApiParam;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import javax.validation.Valid;
|
||||||
|
import javax.validation.constraints.NotNull;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 社区通知
|
||||||
|
*/
|
||||||
|
@Api(tags = "社区通知")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("communityAdvice")
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
public class CommunityAdviceController {
|
||||||
|
|
||||||
|
private final CommunityAdviceService communityAdviceService;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取通知列表
|
||||||
|
*/
|
||||||
|
@ApiOperation(value = "获取通知列表")
|
||||||
|
@PostMapping("adviceList")
|
||||||
|
public TableDataInfo getCommunityAdviceList(@RequestBody CommunityAdvicePageRes communityAdvicePageRes) {
|
||||||
|
return communityAdviceService.getCommunityAdviceList(communityAdvicePageRes);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
|
@ -12,10 +12,7 @@ import com.mcwl.communityCenter.service.QuestionService;
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
import io.swagger.annotations.ApiOperation;
|
import io.swagger.annotations.ApiOperation;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import org.springframework.web.bind.annotation.PostMapping;
|
import org.springframework.web.bind.annotation.*;
|
||||||
import org.springframework.web.bind.annotation.RequestBody;
|
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
|
||||||
|
|
||||||
import javax.validation.Valid;
|
import javax.validation.Valid;
|
||||||
|
|
||||||
|
@ -46,9 +43,9 @@ public class IncomeInfoController {
|
||||||
* 社区收益
|
* 社区收益
|
||||||
*/
|
*/
|
||||||
@ApiOperation(value = "社区收益")
|
@ApiOperation(value = "社区收益")
|
||||||
@PostMapping("communityIncome")
|
@GetMapping("communityIncome")
|
||||||
public R<IncomeInfoVo> communityIncome(@Valid @RequestBody IncomeInfoRes incomeInfoRes) {
|
public R<IncomeInfoVo> communityIncome() {
|
||||||
return incomeInfoService.communityIncome(incomeInfoRes);
|
return incomeInfoService.communityIncome();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,24 @@
|
||||||
|
package com.mcwl.communityCenter.domain.dto;
|
||||||
|
|
||||||
|
import com.mcwl.common.core.page.PageDomain;
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 社区通知列表分页请求参数
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@ApiModel(value = "社区通知列表分页请求参数")
|
||||||
|
public class CommunityAdvicePageRes extends PageDomain {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通知类型 0社区通知 1回复我的 2待我回复 3点赞
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value = "通知类型 0社区通知 1回复我的 2待我回复 3点赞")
|
||||||
|
private Integer adviceType;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
|
@ -17,12 +17,16 @@ import javax.validation.constraints.NotNull;
|
||||||
@ApiModel(value = "收益明细请求参数")
|
@ApiModel(value = "收益明细请求参数")
|
||||||
public class IncomeInfoListPageRes extends PageDomain {
|
public class IncomeInfoListPageRes extends PageDomain {
|
||||||
|
|
||||||
@NotNull(message = "社区id不能为空")
|
/**
|
||||||
@ApiModelProperty(value = "社区id", required = true)
|
* 搜索内容
|
||||||
private Long communityId;
|
*/
|
||||||
|
@ApiModelProperty(value = "搜索内容")
|
||||||
|
private String searchContent;
|
||||||
|
|
||||||
@NotNull(message = "租户id不能为空")
|
/**
|
||||||
@ApiModelProperty(value = "租户id", required = true)
|
* 收益类型
|
||||||
private Long tenantId;
|
*/
|
||||||
|
@ApiModelProperty(value = "收益类型")
|
||||||
|
private Integer type;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,74 @@
|
||||||
|
package com.mcwl.communityCenter.domain.vo;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 社区通知返回数据
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@ApiModel(value = "社区通知返回数据")
|
||||||
|
public class CommunityAdviceVo {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 社区id
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value = "社区id")
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 租户id
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value = "租户id")
|
||||||
|
private Long tenantId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 发送人
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value = "发送人")
|
||||||
|
private Long sendUserId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 发送人名称
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value = "发送人名称")
|
||||||
|
private String sendUserName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 发送人头像
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value = "发送人头像")
|
||||||
|
private String sendUserAvatar;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 标题
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value = "标题")
|
||||||
|
private String title;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 内容
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value = "内容")
|
||||||
|
private String content;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否已读
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value = "是否已读")
|
||||||
|
private Integer isRead;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建时间
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value = "创建时间")
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||||
|
private Date createTime;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
|
@ -1,5 +1,6 @@
|
||||||
package com.mcwl.communityCenter.domain.vo;
|
package com.mcwl.communityCenter.domain.vo;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
import io.swagger.annotations.ApiModel;
|
import io.swagger.annotations.ApiModel;
|
||||||
import io.swagger.annotations.ApiModelProperty;
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
import lombok.Builder;
|
import lombok.Builder;
|
||||||
|
@ -21,6 +22,12 @@ public class IncomeInfoListVo {
|
||||||
@ApiModelProperty(value = "用户名称")
|
@ApiModelProperty(value = "用户名称")
|
||||||
private String userName;
|
private String userName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户头像
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value = "用户头像")
|
||||||
|
private String avatar;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 社区名称
|
* 社区名称
|
||||||
*/
|
*/
|
||||||
|
@ -43,6 +50,7 @@ public class IncomeInfoListVo {
|
||||||
* 收益时间
|
* 收益时间
|
||||||
*/
|
*/
|
||||||
@ApiModelProperty(value = "收益时间")
|
@ApiModelProperty(value = "收益时间")
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||||
private Date createTime;
|
private Date createTime;
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,10 +1,20 @@
|
||||||
package com.mcwl.communityCenter.mapper;
|
package com.mcwl.communityCenter.mapper;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.InterceptorIgnore;
|
||||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import com.mcwl.communityCenter.domain.Community;
|
import com.mcwl.communityCenter.domain.Community;
|
||||||
import com.mcwl.communityCenter.domain.CommunityAdvice;
|
import com.mcwl.communityCenter.domain.CommunityAdvice;
|
||||||
|
import com.mcwl.communityCenter.domain.dto.CommunityAdvicePageRes;
|
||||||
|
import com.mcwl.communityCenter.domain.vo.CommunityAdviceVo;
|
||||||
import org.apache.ibatis.annotations.Mapper;
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
@Mapper
|
@Mapper
|
||||||
public interface CommunityAdviceMapper extends BaseMapper<CommunityAdvice> {
|
public interface CommunityAdviceMapper extends BaseMapper<CommunityAdvice> {
|
||||||
|
|
||||||
|
List<CommunityAdviceVo> getCommunityAdviceList(Page<CommunityAdvice> page,
|
||||||
|
@Param("communityAdvicePageRes") CommunityAdvicePageRes communityAdvicePageRes);
|
||||||
}
|
}
|
||||||
|
|
|
@ -20,14 +20,15 @@ import java.util.List;
|
||||||
public interface IncomeInfoMapper extends BaseMapper<IncomeInfo> {
|
public interface IncomeInfoMapper extends BaseMapper<IncomeInfo> {
|
||||||
|
|
||||||
@InterceptorIgnore(tenantLine = "true")
|
@InterceptorIgnore(tenantLine = "true")
|
||||||
IncomeAmountVo communityIncome(@Param("incomeInfoRes") IncomeInfoRes incomeInfoRes);
|
IncomeAmountVo communityIncome(@Param("userId") Long userId);
|
||||||
|
|
||||||
@InterceptorIgnore(tenantLine = "true")
|
@InterceptorIgnore(tenantLine = "true")
|
||||||
IncomeAmountVo questionIncome(@Param("incomeInfoRes") IncomeInfoRes incomeInfoRes);
|
IncomeAmountVo questionIncome(@Param("userId") Long userId);
|
||||||
|
|
||||||
Double totalIncome();
|
Double totalIncome();
|
||||||
|
|
||||||
@InterceptorIgnore(tenantLine = "true")
|
@InterceptorIgnore(tenantLine = "true")
|
||||||
List<IncomeInfoListVo> incomeList(Page<IncomeInfo> page,
|
List<IncomeInfoListVo> incomeList(Page<IncomeInfo> page,
|
||||||
@Param("incomeInfoListPageRes") IncomeInfoListPageRes incomeInfoListPageRes);
|
@Param("incomeInfoListPageRes") IncomeInfoListPageRes incomeInfoListPageRes,
|
||||||
|
@Param("userId") Long userId);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,8 +1,13 @@
|
||||||
package com.mcwl.communityCenter.service;
|
package com.mcwl.communityCenter.service;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.extension.service.IService;
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
import com.mcwl.common.core.page.TableDataInfo;
|
||||||
import com.mcwl.communityCenter.domain.Community;
|
import com.mcwl.communityCenter.domain.Community;
|
||||||
import com.mcwl.communityCenter.domain.CommunityAdvice;
|
import com.mcwl.communityCenter.domain.CommunityAdvice;
|
||||||
|
import com.mcwl.communityCenter.domain.dto.CommunityAdvicePageRes;
|
||||||
|
|
||||||
|
import javax.validation.Valid;
|
||||||
|
|
||||||
public interface CommunityAdviceService extends IService<CommunityAdvice> {
|
public interface CommunityAdviceService extends IService<CommunityAdvice> {
|
||||||
|
TableDataInfo getCommunityAdviceList(@Valid CommunityAdvicePageRes communityAdvicePageRes);
|
||||||
}
|
}
|
||||||
|
|
|
@ -14,7 +14,7 @@ import javax.validation.Valid;
|
||||||
public interface IncomeInfoService extends IService<IncomeInfo> {
|
public interface IncomeInfoService extends IService<IncomeInfo> {
|
||||||
|
|
||||||
|
|
||||||
R<IncomeInfoVo> communityIncome(@Valid IncomeInfoRes incomeInfoRes);
|
R<IncomeInfoVo> communityIncome();
|
||||||
|
|
||||||
TableDataInfo incomeList(@Valid IncomeInfoListPageRes incomeInfoListPageRes);
|
TableDataInfo incomeList(@Valid IncomeInfoListPageRes incomeInfoListPageRes);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,17 +1,38 @@
|
||||||
package com.mcwl.communityCenter.service.impl;
|
package com.mcwl.communityCenter.service.impl;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import com.mcwl.common.constant.HttpStatus;
|
||||||
|
import com.mcwl.common.core.page.TableDataInfo;
|
||||||
import com.mcwl.communityCenter.domain.Community;
|
import com.mcwl.communityCenter.domain.Community;
|
||||||
import com.mcwl.communityCenter.domain.CommunityAdvice;
|
import com.mcwl.communityCenter.domain.CommunityAdvice;
|
||||||
|
import com.mcwl.communityCenter.domain.dto.CommunityAdvicePageRes;
|
||||||
|
import com.mcwl.communityCenter.domain.vo.CommunityAdviceVo;
|
||||||
import com.mcwl.communityCenter.mapper.CommunityAdviceMapper;
|
import com.mcwl.communityCenter.mapper.CommunityAdviceMapper;
|
||||||
import com.mcwl.communityCenter.mapper.CommunityMapper;
|
import com.mcwl.communityCenter.mapper.CommunityMapper;
|
||||||
import com.mcwl.communityCenter.service.CommunityAdviceService;
|
import com.mcwl.communityCenter.service.CommunityAdviceService;
|
||||||
import com.mcwl.communityCenter.service.CommunityService;
|
import com.mcwl.communityCenter.service.CommunityService;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
@Service
|
@Service
|
||||||
public class CommunityAdviceServiceImpl extends ServiceImpl<CommunityAdviceMapper, CommunityAdvice>
|
public class CommunityAdviceServiceImpl extends ServiceImpl<CommunityAdviceMapper, CommunityAdvice>
|
||||||
implements CommunityAdviceService {
|
implements CommunityAdviceService {
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public TableDataInfo getCommunityAdviceList(CommunityAdvicePageRes communityAdvicePageRes) {
|
||||||
|
Page<CommunityAdvice> page = new Page<>(communityAdvicePageRes.getPageNum(), communityAdvicePageRes.getPageSize());
|
||||||
|
List<CommunityAdviceVo> communityAdviceList = baseMapper.getCommunityAdviceList(page, communityAdvicePageRes);
|
||||||
|
|
||||||
|
|
||||||
|
// 封装分页信息
|
||||||
|
TableDataInfo rspData = new TableDataInfo();
|
||||||
|
rspData.setCode(HttpStatus.SUCCESS);
|
||||||
|
rspData.setMsg("查询成功");
|
||||||
|
rspData.setRows(communityAdviceList);
|
||||||
|
rspData.setTotal(page.getTotal());
|
||||||
|
return rspData;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -40,13 +40,13 @@ public class IncomeInfoServiceImpl extends ServiceImpl<IncomeInfoMapper, IncomeI
|
||||||
* 社区收益
|
* 社区收益
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public R<IncomeInfoVo> communityIncome(IncomeInfoRes incomeInfoRes) {
|
public R<IncomeInfoVo> communityIncome() {
|
||||||
|
|
||||||
// 社区收益
|
// 社区收益
|
||||||
IncomeAmountVo communityIncome = baseMapper.communityIncome(incomeInfoRes);
|
IncomeAmountVo communityIncome = baseMapper.communityIncome(SecurityUtils.getUserId());
|
||||||
|
|
||||||
// 问答收益
|
// 问答收益
|
||||||
IncomeAmountVo questionIncome = baseMapper.questionIncome(incomeInfoRes);
|
IncomeAmountVo questionIncome = baseMapper.questionIncome(SecurityUtils.getUserId());
|
||||||
|
|
||||||
// 累计收益
|
// 累计收益
|
||||||
Double totalIncome = baseMapper.totalIncome();
|
Double totalIncome = baseMapper.totalIncome();
|
||||||
|
@ -63,8 +63,7 @@ public class IncomeInfoServiceImpl extends ServiceImpl<IncomeInfoMapper, IncomeI
|
||||||
@Override
|
@Override
|
||||||
public TableDataInfo incomeList(IncomeInfoListPageRes incomeInfoListPageRes) {
|
public TableDataInfo incomeList(IncomeInfoListPageRes incomeInfoListPageRes) {
|
||||||
Page<IncomeInfo> page = this.initPage(incomeInfoListPageRes);
|
Page<IncomeInfo> page = this.initPage(incomeInfoListPageRes);
|
||||||
page.addOrder(new OrderItem("ii.create_time", false));
|
List<IncomeInfoListVo> incomeInfoList = baseMapper.incomeList(page, incomeInfoListPageRes, SecurityUtils.getUserId());
|
||||||
List<IncomeInfoListVo> incomeInfoList = baseMapper.incomeList(page, incomeInfoListPageRes);
|
|
||||||
|
|
||||||
|
|
||||||
// 封装分页信息
|
// 封装分页信息
|
||||||
|
|
|
@ -214,7 +214,6 @@ public class PublishServiceImpl extends ServiceImpl<PublishMapper, Publish> impl
|
||||||
@Override
|
@Override
|
||||||
public TableDataInfo publishList(PublishPageRes publishPageRes) {
|
public TableDataInfo publishList(PublishPageRes publishPageRes) {
|
||||||
Page<Publish> page = this.initPage(publishPageRes);
|
Page<Publish> page = this.initPage(publishPageRes);
|
||||||
page.addOrder(new OrderItem("create_time", false));
|
|
||||||
|
|
||||||
List<Publish> publishList = baseMapper.publishList(page, publishPageRes);
|
List<Publish> publishList = baseMapper.publishList(page, publishPageRes);
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,20 @@
|
||||||
|
<?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.mcwl.communityCenter.mapper.CommunityAdviceMapper">
|
||||||
|
|
||||||
|
|
||||||
|
<select id="getCommunityAdviceList" resultType="com.mcwl.communityCenter.domain.vo.CommunityAdviceVo">
|
||||||
|
select a.*,
|
||||||
|
u.nick_name as send_user_name,
|
||||||
|
u.avatar as send_user_avatar
|
||||||
|
from cc_advice a left join sys_user u on
|
||||||
|
a.tenant_id = u.user_id
|
||||||
|
where a.del_flag = '0'
|
||||||
|
<if test="communityAdvicePageRes.adviceType != null">
|
||||||
|
and a.advice_type = #{communityAdvicePageRes.adviceType}
|
||||||
|
</if>
|
||||||
|
order by a.create_time desc
|
||||||
|
</select>
|
||||||
|
</mapper>
|
|
@ -6,21 +6,19 @@
|
||||||
|
|
||||||
|
|
||||||
<select id="communityIncome" resultType="com.mcwl.communityCenter.domain.vo.IncomeAmountVo">
|
<select id="communityIncome" resultType="com.mcwl.communityCenter.domain.vo.IncomeAmountVo">
|
||||||
SELECT SUM(IF(DATE(create_time) = CURDATE(), amount, 0)) AS today_amount,
|
SELECT SUM(IF(DATE(create_time) = CURDATE(), amount, 0)) AS today_income,
|
||||||
SUM(IF(DATE(create_time) = CURDATE() - INTERVAL 1 DAY, amount, 0)) AS yesterday_amount
|
SUM(IF(DATE(create_time) = CURDATE() - INTERVAL 1 DAY, amount, 0)) AS yesterday_income
|
||||||
FROM cc_income_info
|
FROM cc_income_info
|
||||||
WHERE tenant_id = #{incomeInfoRes.tenantId}
|
WHERE tenant_id = #{userId}
|
||||||
AND community_id = #{incomeInfoRes.communityId}
|
|
||||||
AND type = 0
|
AND type = 0
|
||||||
AND del_flag = '0'
|
AND del_flag = '0'
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="questionIncome" resultType="com.mcwl.communityCenter.domain.vo.IncomeAmountVo">
|
<select id="questionIncome" resultType="com.mcwl.communityCenter.domain.vo.IncomeAmountVo">
|
||||||
SELECT SUM(IF(DATE(create_time) = CURDATE(), amount, 0)) AS today_amount,
|
SELECT SUM(IF(DATE(create_time) = CURDATE(), amount, 0)) AS today_income,
|
||||||
SUM(IF(DATE(create_time) = CURDATE() - INTERVAL 1 DAY, amount, 0)) AS yesterday_amount
|
SUM(IF(DATE(create_time) = CURDATE() - INTERVAL 1 DAY, amount, 0)) AS yesterday_income
|
||||||
FROM cc_income_info
|
FROM cc_income_info
|
||||||
WHERE tenant_id = #{incomeInfoRes.tenantId}
|
WHERE tenant_id = #{userId}
|
||||||
AND community_id = #{incomeInfoRes.communityId}
|
|
||||||
AND type = 1
|
AND type = 1
|
||||||
AND del_flag = '0'
|
AND del_flag = '0'
|
||||||
</select>
|
</select>
|
||||||
|
@ -30,18 +28,26 @@
|
||||||
WHERE del_flag = '0'
|
WHERE del_flag = '0'
|
||||||
</select>
|
</select>
|
||||||
<select id="incomeList" resultType="com.mcwl.communityCenter.domain.vo.IncomeInfoListVo">
|
<select id="incomeList" resultType="com.mcwl.communityCenter.domain.vo.IncomeInfoListVo">
|
||||||
SELECT ii.create_by as user_name,
|
SELECT u.nick_name as user_name,
|
||||||
c.community_name as community_name,
|
u.avatar as avatar,
|
||||||
ii.type as type,
|
c.community_name as community_name,
|
||||||
ii.amount as amount,
|
ii.type as type,
|
||||||
ii.create_time as create_time
|
ii.amount as amount,
|
||||||
|
ii.create_time as create_time
|
||||||
FROM cc_income_info ii
|
FROM cc_income_info ii
|
||||||
left join cc_community c
|
left join cc_community c
|
||||||
on ii.tenant_id = c.tenant_id
|
on ii.tenant_id = c.tenant_id
|
||||||
and ii.community_id = c.id
|
and ii.community_id = c.id
|
||||||
where ii.tenant_id = #{incomeInfoListPageRes.tenantId}
|
left join sys_user u on c.tenant_id = u.user_id
|
||||||
and ii.community_id = #{incomeInfoListPageRes.communityId}
|
where ii.tenant_id = #{userId}
|
||||||
and ii.del_flag = '0'
|
<if test="incomeInfoListPageRes.type != null ">
|
||||||
|
and ii.type = #{incomeInfoListPageRes.type}
|
||||||
|
</if>
|
||||||
|
<if test="incomeInfoListPageRes.searchContent != null and incomeInfoListPageRes.searchContent != ''">
|
||||||
|
and (u.nick_name like concat('%', #{incomeInfoListPageRes.searchContent}, '%')
|
||||||
|
or c.community_name like concat('%', #{incomeInfoListPageRes.searchContent}, '%'))
|
||||||
|
</if>
|
||||||
|
and ii.del_flag = '0'
|
||||||
order by ii.create_time desc
|
order by ii.create_time desc
|
||||||
</select>
|
</select>
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|
|
@ -112,6 +112,7 @@
|
||||||
</if>
|
</if>
|
||||||
</if>
|
</if>
|
||||||
</where>
|
</where>
|
||||||
|
order by create_time desc
|
||||||
</select>
|
</select>
|
||||||
<select id="myPublishList" resultType="com.mcwl.communityCenter.domain.vo.PublishVo">
|
<select id="myPublishList" resultType="com.mcwl.communityCenter.domain.vo.PublishVo">
|
||||||
select p.*, IF(pc.id is not null, 1, 0) as is_collect
|
select p.*, IF(pc.id is not null, 1, 0) as is_collect
|
||||||
|
|
Loading…
Reference in New Issue