Commit ad41c11f authored by 周健威's avatar 周健威

Merge remote-tracking branch 'origin/dev' into dev

parents 217caee0 33c3cba7
...@@ -53,4 +53,16 @@ public class QuestionParamDto extends PageParam { ...@@ -53,4 +53,16 @@ public class QuestionParamDto extends PageParam {
* 是否删除 * 是否删除
*/ */
private Boolean isDel = false; private Boolean isDel = false;
private String username;
private Integer source;
private Long startTime;
private Long endTime;
private Integer commentCount;
private Integer praiseCount;
} }
\ No newline at end of file
...@@ -79,4 +79,9 @@ public class ImQuestion { ...@@ -79,4 +79,9 @@ public class ImQuestion {
private String picUrl; private String picUrl;
/**
* 来源 1、后台创建, 2、APP创建
*/
private Integer source;
} }
\ No newline at end of file
package com.xxfc.platform.im.biz; package com.xxfc.platform.im.biz;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.github.wxiaoqi.security.admin.entity.AppUserLogin;
import com.github.wxiaoqi.security.admin.feign.UserFeign;
import com.github.wxiaoqi.security.admin.feign.dto.AppUserDTO; import com.github.wxiaoqi.security.admin.feign.dto.AppUserDTO;
import com.github.wxiaoqi.security.common.biz.BaseBiz; import com.github.wxiaoqi.security.common.biz.BaseBiz;
import com.github.wxiaoqi.security.common.config.rabbit.RabbitConstant; import com.github.wxiaoqi.security.common.config.rabbit.RabbitConstant;
...@@ -15,6 +17,7 @@ import com.xxfc.platform.im.mapper.ImQuestionMapper; ...@@ -15,6 +17,7 @@ import com.xxfc.platform.im.mapper.ImQuestionMapper;
import com.xxfc.platform.im.vo.QuestionListVo; import com.xxfc.platform.im.vo.QuestionListVo;
import com.xxfc.platform.universal.feign.MQSenderFeign; import com.xxfc.platform.universal.feign.MQSenderFeign;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
...@@ -31,6 +34,9 @@ public class ImQuestionBiz extends BaseBiz<ImQuestionMapper, ImQuestion> { ...@@ -31,6 +34,9 @@ public class ImQuestionBiz extends BaseBiz<ImQuestionMapper, ImQuestion> {
@Autowired @Autowired
ImPraiseBiz imPraiseBiz; ImPraiseBiz imPraiseBiz;
@Autowired
UserFeign userFeign;
/** /**
* 获取列表 * 获取列表
* *
...@@ -38,6 +44,13 @@ public class ImQuestionBiz extends BaseBiz<ImQuestionMapper, ImQuestion> { ...@@ -38,6 +44,13 @@ public class ImQuestionBiz extends BaseBiz<ImQuestionMapper, ImQuestion> {
* @return * @return
*/ */
public ObjectRestResponse getList(QuestionParamDto questionParamDto) { public ObjectRestResponse getList(QuestionParamDto questionParamDto) {
if(StringUtils.isNotBlank(questionParamDto.getUsername())) {
AppUserLogin appUserLogin = userFeign.one(questionParamDto.getUsername());
if(appUserLogin != null) {
questionParamDto.setUserId(Long.parseLong(appUserLogin.getId() + ""));
}
}
Query query = new Query(questionParamDto); Query query = new Query(questionParamDto);
PageDataVO<QuestionListVo> pageDataVO = PageDataVO.pageInfo(query, () -> mapper.getQuestionList(query.getSuper())); PageDataVO<QuestionListVo> pageDataVO = PageDataVO.pageInfo(query, () -> mapper.getQuestionList(query.getSuper()));
AppUserDTO appUserDTO = userBiz.getUserInfo(); AppUserDTO appUserDTO = userBiz.getUserInfo();
...@@ -50,7 +63,6 @@ public class ImQuestionBiz extends BaseBiz<ImQuestionMapper, ImQuestion> { ...@@ -50,7 +63,6 @@ public class ImQuestionBiz extends BaseBiz<ImQuestionMapper, ImQuestion> {
public ObjectRestResponse one(Integer id) { public ObjectRestResponse one(Integer id) {
return ObjectRestResponse.succ(mapper.getOne(id)); return ObjectRestResponse.succ(mapper.getOne(id));
} }
......
...@@ -2,19 +2,6 @@ ...@@ -2,19 +2,6 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.xxfc.platform.im.mapper.ImQuestionMapper"> <mapper namespace="com.xxfc.platform.im.mapper.ImQuestionMapper">
<resultMap id="BaseResultMap" type="com.xxfc.platform.im.entity.ImQuestion">
<id column="id" jdbcType="BIGINT" property="id"/>
<result column="title" jdbcType="VARCHAR" property="title"/>
<result column="latitude" jdbcType="VARCHAR" property="latitude"/>
<result column="longitude" jdbcType="VARCHAR" property="longitude"/>
<result column="model" jdbcType="VARCHAR" property="model"/>
<result column="time" jdbcType="BIGINT" property="time"/>
<result column="user_id" jdbcType="BIGINT" property="userId"/>
<result column="visible" jdbcType="INTEGER" property="visible"/>
<result column="state" jdbcType="VARCHAR" property="state"/>
<result column="is_del" jdbcType="BIT" property="isDel"/>
<result column="content" jdbcType="LONGVARCHAR" property="content"/>
</resultMap>
<resultMap id="listResultMap" type="com.xxfc.platform.im.vo.QuestionListVo"> <resultMap id="listResultMap" type="com.xxfc.platform.im.vo.QuestionListVo">
<id column="id" jdbcType="BIGINT" property="id"/> <id column="id" jdbcType="BIGINT" property="id"/>
...@@ -33,15 +20,25 @@ ...@@ -33,15 +20,25 @@
<if test="userId != null"> <if test="userId != null">
and user_id = #{userId} and user_id = #{userId}
</if> </if>
<if test="source != null">
and source = #{source}
</if>
<if test="praiseCount != null">
and praise_count &gt;= #{source}
</if>
<if test="commentCount != null">
and comment_count &gt;= #{commentCount}
</if>
<if test="visible != null"> <if test="visible != null">
and visible = #{visible} and visible = #{visible}
</if> </if>
<if test="startTime != null">
and time &gt;= #{startTime} and time &lt;= #{endTime}
</if>
<if test="state != null"> <if test="state != null">
and state = #{state} and state = #{state}
</if> </if>
<if test="isDel != null"> and is_del = 0
and is_del = #{isDel}
</if>
</where> </where>
order by upd_time DESC order by upd_time DESC
</select> </select>
......
...@@ -537,6 +537,9 @@ ...@@ -537,6 +537,9 @@
<if test="flag == true and status == 2"> <if test="flag == true and status == 2">
and ( (v4.id IS NOT NULL and DATE_ADD(v1.book_end_date,INTERVAL '2' DAY) >= now()) OR (v4.id IS NULL AND v1.book_end_date &gt;= now())) and ( (v4.id IS NOT NULL and DATE_ADD(v1.book_end_date,INTERVAL '2' DAY) >= now()) OR (v4.id IS NULL AND v1.book_end_date &gt;= now()))
</if> </if>
<if test="flag == true">
and v1.book_user != -2
</if>
</where> </where>
group by v1.id group by v1.id
order by create_time DESC order by create_time DESC
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment