提交 16003be1 authored 作者: liupengfei's avatar liupengfei

--no commit message

上级 ef83f3f8
......@@ -23,6 +23,7 @@ import tk.mybatis.mapper.entity.Example.Criteria;
import com.zrqx.core.constant.talk.TalkRequestPath;
import com.zrqx.core.enums.ResponseCodeEnum;
import com.zrqx.core.exception.BaseException;
import com.zrqx.core.form.member.bg.member.QueryMemberForm;
import com.zrqx.core.form.talk.bg.AddHotForm;
import com.zrqx.core.form.talk.bg.QueryTalkForm;
import com.zrqx.core.form.talk.bg.SortTalkForm;
......@@ -34,6 +35,7 @@ import com.zrqx.core.model.talk.Talk;
import com.zrqx.core.util.page.PageInfo;
import com.zrqx.core.util.page.PageParam;
import com.zrqx.core.util.response.CallBack;
import com.zrqx.core.vo.talk.StatisticVO;
import com.zrqx.core.vo.talk.TalkListVO;
import com.zrqx.talk.bg.service.ImgsService;
import com.zrqx.talk.bg.service.ReplyService;
......@@ -61,7 +63,6 @@ public class TalkController {
if (null != pageParam && StringUtils.isBlank(pageParam.getOrderBy())) {
pageParam.setOrderBy("sortNum desc, publishDate desc");
}
entity.setEndTime(entity.getEndTime()+" 23:59:59");
return CallBack.success(talkService.queryTalkList(entity, pageParam));
}
......@@ -141,7 +142,11 @@ public class TalkController {
return CallBack.success();
}
@ApiOperation(value = "统计信息", notes = "统计信息")
@GetMapping(value = TalkRequestPath.STATISTICS)
public CallBack<StatisticVO> selectstatistics(QueryMemberForm form) {
return CallBack.success(talkService.selectstatistics(form));
}
/*@ApiOperation(value = "根据作者id查询提问、回答、获赞、采纳", notes = "根据作者id查询提问、回答、获赞、采纳")
@PostMapping(value = TalkRequestPath.STATISTICNUM)
......
package com.zrqx.talk.bg.mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import com.zrqx.core.form.member.bg.member.QueryMemberForm;
import com.zrqx.core.mapper.BaseMapper;
import com.zrqx.core.model.talk.Reply;
public interface ReplyMapper extends BaseMapper<Reply> {
/**
* 获取回复数
* @param m
* @return
* @author xjg
* @date 2019年1月24日 下午1:51:43
*/
@Select("<script>"
+ " SELECT COUNT(*) from reply WHERE replyerId = #{form.id} "
+ "<if test = '"+NOTBLANK+"(form.statisticsBeginTime)' >"
+ "<![CDATA["
+ " and createDate >= #{form.statisticsBeginTime} "
+ "]]>"
+ "</if>"
+ "<if test = '"+NOTBLANK+"(form.statisticsEndTime)' >"
+ "<![CDATA["
+ " and createDate <= #{form.statisticsEndTime} "
+ "]]>"
+ "</if>"
+ "</script>")
Integer selectReplyNum(@Param("form") QueryMemberForm form);
}
......@@ -5,6 +5,7 @@ import java.util.List;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import com.zrqx.core.form.member.bg.member.QueryMemberForm;
import com.zrqx.core.form.talk.bg.QueryTalkForm;
import com.zrqx.core.mapper.BaseMapper;
import com.zrqx.core.model.talk.Talk;
......@@ -12,25 +13,25 @@ import com.zrqx.core.vo.talk.TalkListVO;
public interface TalkMapper extends BaseMapper<Talk> {
@Select("<script>select * from talk where talkType=#{talkType} "
+ "<if test = '" + NOTBLANK + "(keyword)' >"
+ "<if test = 'type==1' >"
+ "and theme like concat(#{keyword},'%') "
@Select("<script>select * from talk where plateId=#{form.plateId} "
+ "<if test = '" + NOTBLANK + "(form.keyword)' >"
+ "<if test = 'form.type==1' >"
+ "and theme like concat(#{form.keyword},'%') "
+ "</if>"
+ "<if test = 'type==2' >"
+ "and authorName like concat(#{keyword},'%') "
+ "<if test = 'form.type==2' >"
+ "and authorName like concat(#{form.keyword},'%') "
+ "</if>"
+ "</if>"
+ "<if test = 'status !=null' >" + "and status = #{status} "
+ "</if>" + "<if test = '" + NOTBLANK+ "(startTime)' >"
+ "<![CDATA[" + "and publishDate >= #{startTime} "
+ "<if test = 'form.status !=null' >" + "and status = #{form.status} "
+ "</if>" + "<if test = '" + NOTBLANK+ "(form.startTime)' >"
+ "<![CDATA[" + "and publishDate >= #{form.startTime} "
+ "]]>"
+ "</if>"
+ "<if test = '"
+ NOTBLANK
+ "(endTime)' >" + "<![CDATA[" + "and publishDate <= #{endTime} " + "]]>" + "</if>"
+ "(form.endTime)' >" + "<![CDATA[" + "and publishDate <= #{form.endTime} " + "]]>" + "</if>"
+ "</script>")
List<TalkListVO> queryTalkList(QueryTalkForm queryTalkForm);
List<TalkListVO> queryTalkList(@Param("form")QueryTalkForm form);
@Select("<script>"
+ "delete t,r from talk t left join reply r on t.id =r.talkId where t.id in"
......@@ -40,6 +41,26 @@ public interface TalkMapper extends BaseMapper<Talk> {
+ "</script>")
Integer deleteByIds(@Param("array") Integer[] ids);
/**
* 获取发布数
* @param memberId
* @return
* @author xjg
* @date 2019年1月21日 下午7:05:38
*/
@Select("<script>"
+ " SELECT COUNT(id) FROM talk WHERE talkType = 0 and authorId = #{form.id} "
+ "<if test = '"+NOTBLANK+"(form.statisticsBeginTime)' >"
+ "<![CDATA["
+ " and publishDate >= #{form.statisticsBeginTime} "
+ "]]>"
+ "</if>"
+ "<if test = '"+NOTBLANK+"(form.statisticsEndTime)' >"
+ "<![CDATA["
+ " and publishDate <= #{form.statisticsEndTime} "
+ "]]>"
+ "</if>"
+ "</script>")
Integer selectPublishNum(@Param("form")QueryMemberForm form);
}
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论