提交 9de5db46 作者: zhenjie

Merge branch 'develop'

......@@ -26,6 +26,10 @@ public class ReleaseReportDTO {
private Integer postsReleaseCount;
@ApiModelProperty(value = "话题发布数量")
private Integer topicReleaseCount;
@ApiModelProperty(value = "新闻发布数量")
private Integer newsReleaseCount;
@ApiModelProperty(value = "招标信息数量")
private Integer tenderReleaseCount;
@ApiModelProperty(value = "订单金额")
private BigDecimal serviceOrderAmount;
}
......@@ -32,6 +32,9 @@ public class UserTopicDynamicsQO {
@ApiModelProperty(value = "用户id",example = "1")
private Integer userAccountId;
@ApiModelProperty(value = "token用户id",hidden = true)
private Integer userId;
/**
* 初始化起始查询行并返回当前页
......
......@@ -18,4 +18,4 @@ patches:
images:
- name: REGISTRY/NAMESPACE/IMAGE:TAG
newName: mmc-registry.cn-shenzhen.cr.aliyuncs.com/sharefly-dev/ims
newTag: 3091f41e782f14c17c403ad8e5eb91d761ada7b4
newTag: 3b66b1c259021cdfab3b75cb9dd8f0c4489bf08b
......@@ -135,12 +135,16 @@ public class GambitController extends BaseController{
@ApiOperation(value = "我的关注")
@PostMapping("/myInterestList")
public ResultBody<MyAttentionDO> myInterestList(HttpServletRequest request, @RequestBody UserTopicDynamicsQO userTopicDynamicsQO){
Integer userId = this.getUserLoginInfoFromRedis(request).getUserAccountId();
userTopicDynamicsQO.setUserId(userId);
return ResultBody.success(gambitService.myInterestList(userTopicDynamicsQO));
}
@ApiOperation(value = "我的粉丝")
@PostMapping("/myFansList")
public ResultBody<MyFansDO> myFansList(HttpServletRequest request, @RequestBody UserTopicDynamicsQO userTopicDynamicsQO){
Integer userId = this.getUserLoginInfoFromRedis(request).getUserAccountId();
userTopicDynamicsQO.setUserId(userId);
return ResultBody.success(gambitService.myFansList(userTopicDynamicsQO));
}
......
......@@ -187,6 +187,8 @@ public interface DynamicDao {
List<ForumGambitDO> selectGambit(Integer id);
List<ForumGambitDO> selectGambitBack(Integer id);
void insertforumFirstLevelReview(ForumFirstLevelReviewDO forumFirstLevelReviewDO);
......
......@@ -63,4 +63,8 @@ public interface TenderDao {
List<Integer> listApplyTenderInfoIds(List<Integer> tenderInfoIds, Integer applyUserId);
TenderInfoDO getInfoById(Integer id);
int getNewsReleaseCount();
int getTenderReleaseCount();
}
......@@ -84,6 +84,8 @@ public interface GambitDao {
void updateAttentionExchange(Integer userAccountId, Integer attentionUserAccountId);
void updateAttentionExchanges(Integer userAccountId, Integer attentionUserAccountId,Integer userAccountId1, Integer attentionUserAccountId1);
ForumAttentionDO selectAttentionMessage(Integer userAccountId, Integer attentionUserAccountId);
List<ForumDynamicGambitDO> appGambitList(TopicDynamicsQO topicDynamicsQO);
......@@ -108,11 +110,19 @@ public interface GambitDao {
List<ForumDynamicGambitDO> likedList(UserTopicDynamicsQO userTopicDynamicsQO);
int myInterestListCount(UserTopicDynamicsQO userTopicDynamicsQO);
List<MyAttentionDO> myInterestListCount(UserTopicDynamicsQO userTopicDynamicsQO);
List<MyAttentionDO> myInterestListCounts(UserTopicDynamicsQO userTopicDynamicsQO);
List<MyAttentionDO> myInterestList(UserTopicDynamicsQO userTopicDynamicsQO);
int myFansListCount(UserTopicDynamicsQO userTopicDynamicsQO);
List<MyAttentionDO> myInterestLists(UserTopicDynamicsQO userTopicDynamicsQO);
ForumCountDO selectUserCount(Integer userAccountId);
List<MyFansDO> myFansListCount(UserTopicDynamicsQO userTopicDynamicsQO);
List<MyFansDO> myFansListCounts(UserTopicDynamicsQO userTopicDynamicsQO);
List<MyFansDO> myFansList(UserTopicDynamicsQO userTopicDynamicsQO);
......@@ -128,6 +138,8 @@ public interface GambitDao {
int selectCountAttentions(Integer userAccountId,Integer userId);
int selectCountAttentionMutualAttention(Integer userAccountId,Integer userId);
int selectGambitAndDynamic(Integer id);
Integer selectStatus(Integer id, Integer userId);
......@@ -135,4 +147,8 @@ public interface GambitDao {
List<DynamicGambitDO> selectDynamicGambit(Integer dynamicId);
void updateGambits(Integer gambitId);
List<MyFansDO> myFansLists(UserTopicDynamicsQO userTopicDynamicsQO);
List<ForumAttentionDO> selectAttentionCount(Integer userAccountId, Integer userId);
}
......@@ -42,6 +42,9 @@ public class ForumCountDO implements Serializable {
@ApiModelProperty(value = "是否关注",example = "true表示已关注 null没有关注")
private Boolean status;
@ApiModelProperty(value = "是否关注",example = "true表示已关注 null没有关注")
private Boolean statusList;
@ApiModelProperty(value = "实名认证的用户信息")
private UserAccountMessageVo userAccountMessageVo;
......
package com.mmc.csf.release.entity.forum;
import com.mmc.csf.user.vo.UserAccountVO;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
......@@ -31,6 +32,11 @@ public class MyAttentionDO implements Serializable {
@ApiModelProperty(value = "用户信息")
private ForumCountDO countDO;
private UserAccountVO userAccountVO;
@ApiModelProperty(value = "前端忽略此字段",hidden = true)
private Integer attentionUserAccountId;
......
package com.mmc.csf.release.entity.forum;
import com.mmc.csf.user.vo.UserAccountVO;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
......@@ -31,6 +32,10 @@ public class MyFansDO implements Serializable {
@ApiModelProperty(value = "用户信息")
private ForumCountDO countDO;
private UserAccountVO userAccountVO;
@ApiModelProperty(value = "前端忽略此字段",hidden = true)
private Integer attentionUserAccountId;
......
......@@ -4,6 +4,7 @@ import com.mmc.csf.common.util.web.ResultBody;
import com.mmc.csf.data.dto.ReleaseReportDTO;
import com.mmc.csf.release.dao.DynamicDao;
import com.mmc.csf.release.dao.RequirementsDao;
import com.mmc.csf.release.dao.TenderDao;
import com.mmc.csf.release.service.data.ReleaseReportService;
import org.springframework.stereotype.Service;
......@@ -21,6 +22,8 @@ public class ReleaseReportServiceImpl implements ReleaseReportService {
private RequirementsDao requirementsDao;
@Resource
private DynamicDao dynamicDao;
@Resource
private TenderDao tenderDao;
@Override
public ResultBody<ReleaseReportDTO> getReleaseReportData() {
......@@ -34,8 +37,14 @@ public class ReleaseReportServiceImpl implements ReleaseReportService {
// 获取话题发布总数
int gambitReleaseCount = dynamicDao.getGambitReleaseCount();
releaseReportDTO.setTopicReleaseCount(gambitReleaseCount);
// 获取新闻发布总数
int newsReleaseCount = tenderDao.getNewsReleaseCount();
releaseReportDTO.setNewsReleaseCount(newsReleaseCount);
// 获取招标信息总数
int tenderReleaseCount = tenderDao.getTenderReleaseCount();
releaseReportDTO.setTenderReleaseCount(tenderReleaseCount);
// 信息发布总数
releaseReportDTO.setReleaseCount(orderCount + dynamicCount + gambitReleaseCount);
releaseReportDTO.setReleaseCount(orderCount + dynamicCount + gambitReleaseCount + newsReleaseCount + tenderReleaseCount);
// 获取订单金额
BigDecimal serviceOrderAmount = requirementsDao.getServiceOrderAmount();
releaseReportDTO.setServiceOrderAmount(serviceOrderAmount);
......
......@@ -30,9 +30,7 @@ import org.springframework.stereotype.Service;
import org.springframework.web.client.RestTemplate;
import javax.servlet.http.HttpServletRequest;
import java.util.ArrayList;
import java.util.List;
import java.util.Set;
import java.util.*;
import java.util.stream.Collectors;
/**
......@@ -159,6 +157,7 @@ public class GambitServiceImpl implements GambitService {
}
}else{
ForumAttentionDO forumAttentionDO = gambitDao.selectAttentionMessage(userAccountId, attentionUserAccountId);
ForumAttentionDO forumAttentionDOs = gambitDao.selectAttentionM(userAccountId,attentionUserAccountId);
if (forumAttentionDO!=null){
if (forumAttentionDO.getMutualAttention().equals(false)){
gambitDao.removeAttention(userAccountId,attentionUserAccountId);
......@@ -170,6 +169,19 @@ public class GambitServiceImpl implements GambitService {
gambitDao.forumCountAttentionNO(attentionUserAccountId);
}
}
if (forumAttentionDOs!=null){
if (forumAttentionDOs.getMutualAttention().equals(false)){
gambitDao.removeAttention(userAccountId,attentionUserAccountId);
gambitDao.forumCountFansNO(userAccountId);
gambitDao.forumCountAttentionNO(attentionUserAccountId);
}else{
Integer userAccountId1=attentionUserAccountId;
Integer attentionUserAccountId1=userAccountId;
gambitDao.updateAttentionExchanges(userAccountId,attentionUserAccountId,userAccountId1,attentionUserAccountId1);
gambitDao.forumCountFansNO(userAccountId);
gambitDao.forumCountAttentionNO(attentionUserAccountId);
}
}
}
return ResultBody.success();
}
......@@ -272,8 +284,69 @@ public class GambitServiceImpl implements GambitService {
Integer pageNo = userTopicDynamicsQO.getPageNo();
userTopicDynamicsQO.buildCurrentPage();
int count = gambitDao.myInterestListCount(userTopicDynamicsQO);
List<MyAttentionDO> myAttentionDOS = gambitDao.myInterestList(userTopicDynamicsQO);
Integer userId = userTopicDynamicsQO.getUserId();
Integer userAccountId1 = userTopicDynamicsQO.getUserAccountId();
if (userAccountId1==null){
userTopicDynamicsQO.setUserAccountId(userId);
}
ArrayList<MyAttentionDO> listCount = new ArrayList<>();
List<MyAttentionDO> myAttentionDOSCount=null;
int count =0;
myAttentionDOSCount=gambitDao.myInterestListCount(userTopicDynamicsQO);
if (myAttentionDOSCount.size()!=0){
for (MyAttentionDO myAttentionDO : myAttentionDOSCount) {
listCount.add(myAttentionDO);
}
}
myAttentionDOSCount=gambitDao.myInterestListCounts(userTopicDynamicsQO);
if (myAttentionDOSCount.size()!=0){
for (MyAttentionDO myAttentionDO : myAttentionDOSCount) {
listCount.add(myAttentionDO);
}
}
ArrayList<MyAttentionDO> collectCount = listCount.stream().collect(Collectors.collectingAndThen(
Collectors.toCollection(() -> new TreeSet<>(Comparator.comparing(MyAttentionDO::getId))), ArrayList::new));
count=collectCount.size();
ArrayList<MyAttentionDO> list = new ArrayList<>();
List<MyAttentionDO> myAttentionDOS =null;
myAttentionDOS= gambitDao.myInterestList(userTopicDynamicsQO);
if (myAttentionDOS.size()!=0){
for (MyAttentionDO myAttentionDO : myAttentionDOS) {
list.add(myAttentionDO);
}
}
myAttentionDOS= gambitDao.myInterestLists(userTopicDynamicsQO);
if (myAttentionDOS.size()!=0){
for (MyAttentionDO myAttentionDO : myAttentionDOS) {
list.add(myAttentionDO);
}
}
ArrayList<MyAttentionDO> collect = list.stream().collect(Collectors.collectingAndThen(
Collectors.toCollection(() -> new TreeSet<>(Comparator.comparing(MyAttentionDO::getId))), ArrayList::new));
myAttentionDOS=collect;
for (MyAttentionDO myAttentionDO : myAttentionDOS) {
if (userTopicDynamicsQO.getUserAccountId().equals(myAttentionDO.getUserAccountId())){
myAttentionDO.setUserAccountId(myAttentionDO.getAttentionUserAccountId());
ForumCountDO forumCountDO = gambitDao.selectUserCount(myAttentionDO.getUserAccountId());
myAttentionDO.setCountDO(forumCountDO);
}
Integer userAccountId = myAttentionDO.getUserAccountId();
UserAccountVO info = info(userAccountId);
myAttentionDO.setUserAccountVO(info);
int i = gambitDao.selectCountAttentions(userId, myAttentionDO.getUserAccountId());
if (i!=0){
ForumCountDO countDO = myAttentionDO.getCountDO();
countDO.setStatus(true);
countDO.setStatusList(true);
}
int i1 = gambitDao.selectCountAttentions(myAttentionDO.getUserAccountId(), userId);
if (i1!=0){
ForumCountDO countDO = myAttentionDO.getCountDO();
countDO.setStatusList(true);
}
}
return PageResult.buildPage(pageNo, userTopicDynamicsQO.getPageSize(),count,myAttentionDOS);
}
......@@ -281,9 +354,88 @@ public class GambitServiceImpl implements GambitService {
public PageResult myFansList(UserTopicDynamicsQO userTopicDynamicsQO) {
Integer pageNo = userTopicDynamicsQO.getPageNo();
userTopicDynamicsQO.buildCurrentPage();
int count = gambitDao.myFansListCount(userTopicDynamicsQO);
List<MyFansDO> myAttentionDOS = gambitDao.myFansList(userTopicDynamicsQO);
return PageResult.buildPage(pageNo, userTopicDynamicsQO.getPageSize(),count,myAttentionDOS);
Integer userId = userTopicDynamicsQO.getUserId();
Integer userAccountId1 = userTopicDynamicsQO.getUserAccountId();
if (userAccountId1==null){
userTopicDynamicsQO.setUserAccountId(userId);
}
List<MyFansDO> listCount =new ArrayList<>();
List<MyFansDO> myFansDOSCount=null;
int allCount =0;
myFansDOSCount = gambitDao.myFansListCount(userTopicDynamicsQO);
if (myFansDOSCount.size()!=0){
for (MyFansDO myFansDO : myFansDOSCount) {
listCount.add(myFansDO);
}
}
myFansDOSCount = gambitDao.myFansListCounts(userTopicDynamicsQO);
if (myFansDOSCount.size()!=0){
for (MyFansDO myFansDO : myFansDOSCount) {
listCount.add(myFansDO);
}
}
ArrayList<MyFansDO> collectCount = listCount.stream().collect(Collectors.collectingAndThen(
Collectors.toCollection(() -> new TreeSet<>(Comparator.comparing(MyFansDO::getId))), ArrayList::new));
int count =collectCount.size();
List<MyFansDO> list =new ArrayList<>();
List<MyFansDO> myFansDOS=null;
myFansDOS=gambitDao.myFansList(userTopicDynamicsQO);
if (myFansDOS.size()!=0){
for (MyFansDO myFansDO : myFansDOS) {
list.add(myFansDO);
}
}
myFansDOS=gambitDao.myFansLists(userTopicDynamicsQO);
if (myFansDOS.size()!=0){
for (MyFansDO myFansDO : myFansDOS) {
list.add(myFansDO);
}
}
ArrayList<MyFansDO> collect = list.stream().collect(Collectors.collectingAndThen(
Collectors.toCollection(() -> new TreeSet<>(Comparator.comparing(MyFansDO::getId))), ArrayList::new));
myFansDOS=collect;
for (MyFansDO myAttentionDO : myFansDOS) {
if (userTopicDynamicsQO.getUserAccountId().equals(myAttentionDO.getUserAccountId())){
myAttentionDO.setUserAccountId(myAttentionDO.getAttentionUserAccountId());
ForumCountDO forumCountDO = gambitDao.selectUserCount(myAttentionDO.getUserAccountId());
myAttentionDO.setCountDO(forumCountDO);
}
Integer userAccountId = myAttentionDO.getUserAccountId();
UserAccountVO info = info(userAccountId);
myAttentionDO.setUserAccountVO(info);
int i = gambitDao.selectCountAttentions(userId, myAttentionDO.getUserAccountId());
if(i!=0){
ForumCountDO countDO = myAttentionDO.getCountDO();
countDO.setStatus(true);
}
if (myAttentionDO.getMutualAttention().equals(1)){
ForumCountDO countDO = myAttentionDO.getCountDO();
countDO.setStatusList(true);
}
int i1 = gambitDao.selectCountAttentions(myAttentionDO.getUserAccountId(), userId);
if (i1!=0){
ForumCountDO countDO = myAttentionDO.getCountDO();
countDO.setStatusList(true);
}
List<ForumAttentionDO> forumAttentionDOS = gambitDao.selectAttentionCount(userTopicDynamicsQO.getUserAccountId(), userTopicDynamicsQO.getUserId());
List<ForumAttentionDO> collect1 = forumAttentionDOS.stream().filter(m -> m.getMutualAttention().equals(true)).collect(Collectors.toList());
List<ForumAttentionDO> collect2 = collect1.stream().filter(s -> s.getUserAccountId().equals(userTopicDynamicsQO.getUserId()) ||
s.getAttentionUserAccountId().equals(userTopicDynamicsQO.getUserId()) ).collect(Collectors.toList());
for (ForumAttentionDO forumAttentionDO : collect2) {
if (myAttentionDO.getUserAccountId().equals(forumAttentionDO.getUserAccountId())||
myAttentionDO.getAttentionUserAccountId().equals(forumAttentionDO.getAttentionUserAccountId())){
ForumCountDO countDO = myAttentionDO.getCountDO();
countDO.setStatusList(true);
}
}
}
return PageResult.buildPage(pageNo, userTopicDynamicsQO.getPageSize(),count,myFansDOS);
}
......@@ -291,12 +443,16 @@ public class GambitServiceImpl implements GambitService {
public ResultBody userMessage(Integer userAccountId,Integer userId) {
ForumCountDO forumCountDO= gambitDao.userMessage(userAccountId);
int i= gambitDao.selectCountAttentions(userAccountId,userId);
int i1 = gambitDao.selectCountAttentionMutualAttention(userId, userAccountId);
UserAccountMessageVo userAccountMessageVo = infoMessage(userAccountId);
forumCountDO.setUserAccountMessageVo(userAccountMessageVo);
// int i = gambitDao.selectCountAttention(userId);
if (i!=0){
forumCountDO.setStatus(true);
}
if (i1!=0){
forumCountDO.setStatus(true);
}
return ResultBody.success(forumCountDO);
}
......
......@@ -81,7 +81,7 @@ public class BackstageForumServiceImpl implements BackstageForumService {
for (ForumDynamicDO forumDynamicDO : dynamicList) {
Integer id = forumDynamicDO.getDynamicId();
ArrayList<String> list = new ArrayList<>();
List<ForumGambitDO> gambitDOS = dynamicDao.selectGambit(id);
List<ForumGambitDO> gambitDOS = dynamicDao.selectGambitBack(id);
for (ForumGambitDO gambitDO : gambitDOS) {
list.add(gambitDO.getGambitName());
}
......
......@@ -27,6 +27,7 @@ import com.mmc.csf.release.dao.LikeDAO;
import com.mmc.csf.release.dao.gambit.GambitDao;
import com.mmc.csf.release.entity.forum.*;
import com.mmc.csf.release.entity.forum.ForumReviewDO;
import com.mmc.csf.release.entity.gambit.ForumAttentionDO;
import com.mmc.csf.release.entity.gambit.ForumGambitDO;
import com.mmc.csf.release.feign.UserAppApi;
import com.mmc.csf.release.forum.vo.*;
......@@ -294,6 +295,7 @@ public class DynamicServiceImpl implements DynamicService {
public PageResult dynamicList(
Integer pageNo, Integer pageSize, Integer userId, HttpServletRequest request, Integer gambitId,Integer dynId,Integer userAccountIds,
String description,List<String> gambitName) {
Integer tokenUserId =userId;
int count = dynamicDao.countDynamicList(dynId,userAccountIds,description);
if (count == 0) {
return PageResult.buildPage(pageNo, pageSize, 0);
......@@ -445,9 +447,38 @@ public class DynamicServiceImpl implements DynamicService {
for (DynamicVO dynamicVO : dynamicVOList) {
Integer userAccountId = dynamicVO.getUserAccountId();
int countAttention= gambitDao.selectCountAttentions(userAccountId,userId);
if (countAttention!=0){
// int countA=gambitDao.selectCountAttentions(userId,userAccountId);
List<ForumAttentionDO> forumAttentionDOS = gambitDao.selectAttentionCount(userAccountId, userId);
if (countAttention!=0){
dynamicVO.setStatus(true);
}
}
// if (countA!=0){
// dynamicVO.setStatus(true);
// }
System.out.println(userId);
for (ForumAttentionDO forumAttentionDO : forumAttentionDOS) {
if (forumAttentionDO!=null){
Integer userAccountId1 = dynamicVO.getUserAccountId();
if (userAccountId1.equals(userId)&& forumAttentionDO.getMutualAttention().equals(false)){
if (forumAttentionDO.getAttentionUserAccountId().equals(dynamicVO.getUserAccountId())||
forumAttentionDO.getUserAccountId().equals(dynamicVO.getUserAccountId())
){
dynamicVO.setStatus(true);
}
}
if (forumAttentionDO.getMutualAttention().equals(true)){
if (forumAttentionDO.getAttentionUserAccountId().equals(dynamicVO.getUserAccountId())||
forumAttentionDO.getUserAccountId().equals(dynamicVO.getUserAccountId())
){
dynamicVO.setStatus(true);
}
}
}
}
if (tokenUserId.equals(dynamicVO.getUserAccountId())){
dynamicVO.setStatus(null);
}
}
return PageResult.buildPage(pageNo, pageSize, count, dynamicVOList);
}
......
......@@ -248,6 +248,24 @@
AND fdg.dynamic_id = #{id}
</select>
<select id="selectGambitBack" resultType="com.mmc.csf.release.entity.gambit.ForumGambitDO">
SELECT DISTINCT
gf.id,
gf.gambit_name,
gf.gambit_icon,
gf.gambit_cover,
gf.post_count,
gf.gambit_property,
gf.user_account_id,
gf.discussion_count
FROM
forum_dynamic_gambit fdg
INNER JOIN forum_gambit gf
WHERE
fdg.gambit_id = gf.id
AND fdg.dynamic_id = #{id}
</select>
<select id="selectGambitDTO" resultType="com.mmc.csf.release.gambit.dto.ForumGambitDTO">
SELECT DISTINCT
......
......@@ -70,8 +70,9 @@
<resultMap id="myInterestListMap" type="com.mmc.csf.release.entity.forum.MyAttentionDO">
<result property="id" column="id"/>
<result property="userAccountId" column="attention_user_account_id" />
<result property="userAccountId" column="user_account_id" />
<result property="mutualAttention" column="mutual_attention"/>
<result property="attentionUserAccountId" column="attention_user_account_id"/>
<collection property="dynamicCount" ofType="java.lang.Integer"
select="selectCountUser" column="{userAccountId=user_account_id}">
</collection>
......@@ -80,10 +81,12 @@
</collection>
</resultMap>
<resultMap id="myFansListMap" type="com.mmc.csf.release.entity.forum.MyFansDO">
<result property="id" column="id"/>
<result property="userAccountId" column="attention_user_account_id" />
<result property="userAccountId" column="user_account_id" />
<result property="mutualAttention" column="mutual_attention"/>
<result property="attentionUserAccountId" column="attention_user_account_id"/>
<collection property="dynamicCount" ofType="java.lang.Integer"
select="selectCountUser" column="{userAccountId=user_account_id}">
</collection>
......@@ -197,6 +200,14 @@
select count(*) from forum_attention where attention_user_account_id=#{userId} and user_account_id=#{userAccountId}
</select>
<select id="selectCountAttentionMutualAttention" resultType="java.lang.Integer">
select count(*) from forum_attention where attention_user_account_id=#{userId} and user_account_id=#{userAccountId} and mutual_attention=1
</select>
<select id="selectAttentionCount" resultType="com.mmc.csf.release.entity.gambit.ForumAttentionDO">
select user_account_id,attention_user_account_id,mutual_attention from forum_attention where attention_user_account_id=#{userId} or user_account_id=#{userAccountId} or attention_user_account_id=#{userAccountId} or user_account_id=#{userId} and mutual_attention=1
</select>
<select id="selectGambitAndDynamic" resultType="java.lang.Integer">
select count(*) from forum_dynamic_gambit where gambit_id=#{id}
</select>
......@@ -556,6 +567,14 @@
where user_account_id=#{userAccountId} and attention_user_account_id=#{attentionUserAccountId}
</update>
<update id="updateAttentionExchanges">
update forum_attention set user_account_id=#{userAccountId1} ,
attention_user_account_id=#{attentionUserAccountId1},
mutual_attention=false,
update_time=NOW()
where user_account_id=#{attentionUserAccountId} and attention_user_account_id=#{userAccountId}
</update>
<select id="appGambitList" resultMap="appGambitListMap">
SELECT DISTINCT
fd.id,
......@@ -647,20 +666,49 @@
limit #{pageNo}, #{pageSize}
</select>
<select id="myInterestListCount" resultType="java.lang.Integer">
select count(*) from forum_attention where attention_user_account_id=#{userAccountId}
<select id="myInterestListCount" resultMap="myInterestListMap">
select attention_user_account_id,mutual_attention,id,user_account_id from forum_attention where attention_user_account_id=#{userAccountId}
</select>
<select id="myInterestListCounts" resultMap="myInterestListMap">
select attention_user_account_id,mutual_attention,id,user_account_id from forum_attention where attention_user_account_id=#{userAccountId} or user_account_id=#{userAccountId} and mutual_attention=1
</select>
<select id="myInterestList" resultMap="myInterestListMap">
select attention_user_account_id,mutual_attention,id from forum_attention where attention_user_account_id=#{userAccountId}
select attention_user_account_id,mutual_attention,id,user_account_id from forum_attention where attention_user_account_id=#{userAccountId}
ORDER BY
create_time DESC
limit #{pageNo}, #{pageSize}
</select>
<select id="myInterestLists" resultMap="myInterestListMap">
select attention_user_account_id,mutual_attention,id,user_account_id from forum_attention where attention_user_account_id=#{userAccountId} or user_account_id=#{userAccountId} and mutual_attention=1
ORDER BY
create_time DESC
limit #{pageNo}, #{pageSize}
</select>
<select id="myFansListCount" resultType="java.lang.Integer">
select count(*) from forum_attention where attention_user_account_id=#{userAccountId}
<select id="myFansListCount" resultMap="myFansListMap">
select user_account_id,mutual_attention,id,attention_user_account_id from forum_attention where user_account_id=#{userAccountId}
</select>
<select id="myFansListCounts" resultMap="myFansListMap">
select user_account_id,mutual_attention,id,attention_user_account_id from forum_attention where
user_account_id=#{userAccountId} or attention_user_account_id=#{userAccountId} and mutual_attention=1
</select>
<select id="myFansList" resultMap="myFansListMap">
select user_account_id,mutual_attention,id,attention_user_account_id from forum_attention where attention_user_account_id=#{userAccountId}
select user_account_id,mutual_attention,id,attention_user_account_id from forum_attention where user_account_id=#{userAccountId}
ORDER BY
create_time DESC
limit #{pageNo}, #{pageSize}
</select>
<select id="myFansLists" resultMap="myFansListMap">
select user_account_id,mutual_attention,id,attention_user_account_id from forum_attention where
user_account_id=#{userAccountId} or attention_user_account_id=#{userAccountId} and mutual_attention=1
ORDER BY
create_time DESC
limit #{pageNo}, #{pageSize}
......
......@@ -43,8 +43,8 @@
<insert id="addTenderNewsDO" useGeneratedKeys="true"
keyProperty="id" parameterType="com.mmc.csf.release.entity.tender.TenderNewsDO">
insert into tender_news(tender_name, is_using, port, create_time,url)
values (#{tenderName}, #{using}, #{port}, NOW(),#{url})
insert into tender_news(tender_name, is_using, port, create_time, url)
values (#{tenderName}, #{using}, #{port}, NOW(), #{url})
</insert>
<insert id="batchAddTenderInfo" useGeneratedKeys="true"
......@@ -312,7 +312,7 @@
<select id="listNewListTenderInfo" resultType="com.mmc.csf.release.entity.tender.TenderInfoDO">
select
ti.id, ti.tender_news_id, ti.tender_price, ti.tender_info_no, ti.tender_title, ti.is_deleted, ti.create_time,
ti.update_time, ti.tender_content
ti.update_time, ti.tender_content
from tender_news tn INNER JOIN tender_info ti ON tn.id = ti.tender_news_id
where
tn.is_deleted = 0 and tn.is_using = 1 and ti.is_deleted = 0
......@@ -346,20 +346,28 @@
</select>
<select id="getInfoById" resultType="com.mmc.csf.release.entity.tender.TenderInfoDO">
SELECT
id,
tender_news_id,
tender_price,
tender_info_no,
tender_title,
is_deleted,
create_time,
update_time,
tender_content
FROM
tender_info
WHERE
is_deleted = 0 and id = #{id}
SELECT id,
tender_news_id,
tender_price,
tender_info_no,
tender_title,
is_deleted,
create_time,
update_time,
tender_content
FROM tender_info
WHERE is_deleted = 0
and id = #{id}
</select>
<select id="getNewsReleaseCount" resultType="java.lang.Integer">
select count(*)
from industry_news
where is_deleted = 0
</select>
<select id="getTenderReleaseCount" resultType="java.lang.Integer">
select count(*)
from tender_info
where is_deleted = 0
</select>
</mapper>
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论