insert:添加标准问答功能
This commit is contained in:
@@ -26,6 +26,7 @@ public class ConvertMqEO extends BaseEntity {
|
||||
private String mqCode;
|
||||
private String id;
|
||||
private String addOrUp;
|
||||
private String name;
|
||||
|
||||
//向文件表添加信息
|
||||
private String lawsId;
|
||||
@@ -220,4 +221,12 @@ public class ConvertMqEO extends BaseEntity {
|
||||
public void setLawsFileClassify(String lawsFileClassify) {
|
||||
this.lawsFileClassify = lawsFileClassify;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
}
|
||||
|
||||
+211
@@ -0,0 +1,211 @@
|
||||
package com.adc.da.slrs.StandardQA.controller;
|
||||
|
||||
import com.adc.da.base.web.BaseController;
|
||||
import com.adc.da.slrs.NewsFeed.entity.NewsFeed;
|
||||
import com.adc.da.slrs.StandardQA.dao.AskQuestionsDao;
|
||||
import com.adc.da.slrs.StandardQA.entity.AskQuestions;
|
||||
import com.adc.da.slrs.StandardQA.entity.AskUser;
|
||||
import com.adc.da.slrs.StandardQA.entity.Reply;
|
||||
import com.adc.da.slrs.StandardQA.entity.Subscription;
|
||||
import com.adc.da.slrs.StandardQA.service.Impl.AskQuestionsServiceImpl;
|
||||
import com.adc.da.slrs.StandardQA.service.Impl.AskUserServiceImpl;
|
||||
import com.adc.da.util.UUIDUtils;
|
||||
import com.adc.da.util.http.ResponseMessage;
|
||||
import com.adc.da.util.http.Result;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import io.swagger.annotations.Api;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Author: qk
|
||||
* @Date: 2022/5/31 0031 9:18
|
||||
* @Version 1.0
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/${restPath}/lawss/AskQuestions")
|
||||
@Api(description = "|AskQuestions|")
|
||||
public class AskQuestionsController extends BaseController<AskQuestions> {
|
||||
|
||||
@Autowired
|
||||
private AskQuestionsServiceImpl askQuestionsService;
|
||||
@Autowired
|
||||
private AskQuestionsDao askQuestionsDao;
|
||||
@Autowired
|
||||
private AskUserServiceImpl askUserService;
|
||||
|
||||
/**
|
||||
* 查询问题列表
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/getAskQuestions")
|
||||
public ResponseMessage getAskQuestions(){
|
||||
QueryWrapper<AskQuestions> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.orderByDesc("QUESTION_TIME");
|
||||
List<AskQuestions> askQuestionsList=askQuestionsService.list(queryWrapper);
|
||||
return Result.success(askQuestionsList);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查看我的问题详情
|
||||
* @param askQuestions
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/getAskQuestionsDetails")
|
||||
public ResponseMessage getAskQuestionsDetails(AskQuestions askQuestions){
|
||||
List<AskQuestions> askQuestionsList = askQuestionsService.getAskQuestions(askQuestions);
|
||||
return Result.success(askQuestionsList);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查看我回答的问题
|
||||
* @param askQuestions
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/getReplyDetails")
|
||||
public ResponseMessage getReplyDetails(AskQuestions askQuestions){
|
||||
List<AskQuestions> askQuestionsList = askQuestionsService.getReplyDetails(askQuestions);
|
||||
return Result.success(askQuestionsList);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据标准查询问题
|
||||
* @param askQuestions
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/getReplyDetailsByStandId")
|
||||
public ResponseMessage getReplyDetailsByStandId(AskQuestions askQuestions){
|
||||
List<AskQuestions> askQuestionsList = askQuestionsService.getReplyDetailsByStandId(askQuestions);
|
||||
return Result.success(askQuestionsList);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据标准编号查询我的回答
|
||||
* @param standardId
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/getAskQuestionsByStandardId")
|
||||
public ResponseMessage getAskQuestionsByStandardId(String standardId){
|
||||
List<AskQuestions> askQuestionsList = askQuestionsService.getAskQuestionsByStandardId(standardId);
|
||||
return Result.success(askQuestionsList);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据问题ID查询回答***
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/getAskQuestionsByakId")
|
||||
public ResponseMessage getAskQuestionsByakId(String id){
|
||||
List<Reply> askQuestionsList = askQuestionsService.getAskQuestionsByakId(id);
|
||||
return Result.success(askQuestionsList);
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加问题
|
||||
* @param askQuestions
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("/insertAskQuestions")
|
||||
public ResponseMessage insertAskQuestions(@RequestBody AskQuestions askQuestions){
|
||||
askQuestions.setId(UUIDUtils.randomUUID20());
|
||||
askQuestions.setAppendixId(askQuestions.getFileList().get(0).getAttId());
|
||||
askQuestions.setAppendixName(askQuestions.getFileList().get(0).getName());
|
||||
askQuestions.setQuestionTime(new Date());
|
||||
List<String> uId = askQuestionsDao.getUId();
|
||||
List<AskUser> askUserList = new ArrayList<>();
|
||||
for (String id:uId) {
|
||||
AskUser askUser = new AskUser();
|
||||
askUser.setAsdId(askQuestions.getId());
|
||||
askUser.setUsid(id);
|
||||
askUserList.add(askUser);
|
||||
}
|
||||
//添加问题分配人员
|
||||
askUserService.saveBatch(askUserList);
|
||||
if(askQuestionsService.save(askQuestions)){
|
||||
return Result.success("200","添加成功");
|
||||
}else {
|
||||
return Result.error("-1","添加失败");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 查询订阅问题
|
||||
* @param askQuestions
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/getAskQuestionsBySubscription")
|
||||
public ResponseMessage getAskQuestionsBySubscription(AskQuestions askQuestions){
|
||||
List<AskQuestions> askQuestionsList = askQuestionsService.getAskQuestionsBySubscription(askQuestions);
|
||||
return Result.success(askQuestionsList);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 根据标准id查询订阅
|
||||
* @param askQuestions
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/getSubscriptionByStandId")
|
||||
public ResponseMessage getSubscriptionByStandId(AskQuestions askQuestions){
|
||||
List<AskQuestions> askQuestionsList = askQuestionsService.getSubscriptionByStandId(askQuestions);
|
||||
return Result.success(askQuestionsList);
|
||||
}
|
||||
|
||||
/**
|
||||
* 相似查询
|
||||
* @param problemDescription
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/resemblance")
|
||||
public ResponseMessage resemblance(String problemDescription){
|
||||
List<String> askQuestions = Arrays.asList(problemDescription.split(""));
|
||||
List<AskQuestions> askQuestionsList = askQuestionsService.resemblance(askQuestions);
|
||||
return Result.success(askQuestionsList);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据分类查询问题
|
||||
* @param classification
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/getAskQuestionsReply")
|
||||
public ResponseMessage getAskQuestionsReply(String classification){
|
||||
QueryWrapper queryWrapper = new QueryWrapper();
|
||||
queryWrapper.select("DISTINCT STANDARD_ID");
|
||||
queryWrapper.select("STANDARD_NAME");
|
||||
queryWrapper.select("STANDARD_ENCDOING");
|
||||
queryWrapper.eq("CLASSIFICATION",classification);
|
||||
List<AskQuestions> askQuestionsList = askQuestionsService.list(queryWrapper);
|
||||
return Result.success(askQuestionsList);
|
||||
}
|
||||
|
||||
/**
|
||||
* 问答库的根据标准ID查询问题
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/getSubscription")
|
||||
public ResponseMessage getArchiveAskQuestions(String id){
|
||||
List<AskQuestions> askQuestionsList = askQuestionsService.getArchiveAskQuestions(id);
|
||||
return Result.success(askQuestionsList);
|
||||
}
|
||||
|
||||
@GetMapping("/retrieve")
|
||||
public ResponseMessage retrieve(AskQuestions askQuestions){
|
||||
List<AskQuestions> askQuestionsList = askQuestionsService.retrieve(askQuestions);
|
||||
return Result.success(askQuestionsList);
|
||||
}
|
||||
|
||||
}
|
||||
+37
@@ -0,0 +1,37 @@
|
||||
package com.adc.da.slrs.StandardQA.controller;
|
||||
|
||||
import com.adc.da.base.web.BaseController;
|
||||
import com.adc.da.slrs.StandardQA.entity.AskQuestions;
|
||||
import com.adc.da.slrs.StandardQA.entity.AskUser;
|
||||
import com.adc.da.slrs.StandardQA.service.Impl.AskQuestionsServiceImpl;
|
||||
import com.adc.da.slrs.StandardQA.service.Impl.AskUserServiceImpl;
|
||||
import com.adc.da.util.http.ResponseMessage;
|
||||
import com.adc.da.util.http.Result;
|
||||
import io.swagger.annotations.Api;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
/**
|
||||
* @Author: qk
|
||||
* @Date: 2022/6/2 0002 8:44
|
||||
* @Version 1.0
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/${restPath}/lawss/AskUser")
|
||||
@Api(description = "|AskUser|")
|
||||
public class AskUserController extends BaseController<AskUser> {
|
||||
@Autowired
|
||||
private AskUserServiceImpl askUserService;
|
||||
@PostMapping("/insertAskUser")
|
||||
public ResponseMessage insertAskUser(@RequestBody AskUser askUser){
|
||||
if(askUserService.save(askUser)){
|
||||
return Result.success("200","邀请成功");
|
||||
}else {
|
||||
return Result.error("-1","添加失败");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,61 @@
|
||||
package com.adc.da.slrs.StandardQA.controller;
|
||||
|
||||
import com.adc.da.base.web.BaseController;
|
||||
import com.adc.da.slrs.StandardQA.entity.AskQuestions;
|
||||
import com.adc.da.slrs.StandardQA.entity.Reply;
|
||||
import com.adc.da.slrs.StandardQA.service.Impl.ReplyServiceImpl;
|
||||
import com.adc.da.util.UUIDUtils;
|
||||
import com.adc.da.util.http.ResponseMessage;
|
||||
import com.adc.da.util.http.Result;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
||||
import io.swagger.annotations.Api;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.PutMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Author: qk
|
||||
* @Date: 2022/5/31 0031 10:55
|
||||
* @Version 1.0
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/${restPath}/lawss/Reply")
|
||||
@Api(description = "| Reply|")
|
||||
public class ReplyController extends BaseController<Reply> {
|
||||
|
||||
@Autowired
|
||||
private ReplyServiceImpl replyService;
|
||||
|
||||
@PostMapping("/insertReply")
|
||||
public ResponseMessage insertReply(@RequestBody Reply reply){
|
||||
reply.setAppendixId(reply.getFileList().get(0).getAttId());
|
||||
reply.setAppendixName(reply.getFileList().get(0).getName());
|
||||
reply.setReplyTime(new Date());
|
||||
reply.setId(UUIDUtils.randomUUID20());
|
||||
if(replyService.save(reply)){
|
||||
return Result.success("200","添加成功");
|
||||
}else {
|
||||
return Result.error("200","添加失败");
|
||||
}
|
||||
}
|
||||
@PostMapping("/updateReply")
|
||||
public ResponseMessage updateReply(String id){
|
||||
List<String> list = Arrays.asList(id.split(","));
|
||||
for (String s: list) {
|
||||
UpdateWrapper updateWrapper = new UpdateWrapper();
|
||||
updateWrapper.set("STATE","yes");
|
||||
updateWrapper.eq("ID",s);
|
||||
replyService.update(updateWrapper);
|
||||
}
|
||||
return Result.success("200","归档成功");
|
||||
}
|
||||
}
|
||||
+44
@@ -0,0 +1,44 @@
|
||||
package com.adc.da.slrs.StandardQA.controller;
|
||||
|
||||
|
||||
import com.adc.da.base.web.BaseController;
|
||||
import com.adc.da.slrs.StandardQA.entity.Subscription;
|
||||
import com.adc.da.slrs.StandardQA.service.Impl.SubscriptionServiceImpl;
|
||||
import com.adc.da.util.http.ResponseMessage;
|
||||
import com.adc.da.util.http.Result;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import io.swagger.annotations.Api;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
/**
|
||||
* @Author: qk
|
||||
* @Date: 2022/6/7 0007 11:18
|
||||
* @Version 1.0
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/${restPath}/lawss/Subscription")
|
||||
@Api(description = "|Subscription|")
|
||||
public class SubscriptionController extends BaseController<Subscription> {
|
||||
@Autowired
|
||||
private SubscriptionServiceImpl subscriptionService;
|
||||
|
||||
@PostMapping("/insertSubscription")
|
||||
public ResponseMessage updateReply(@RequestBody Subscription subscription){
|
||||
QueryWrapper queryWrapper = new QueryWrapper();
|
||||
queryWrapper.eq("ASK_ID",subscription.getAskId());
|
||||
queryWrapper.eq("USID",subscription.getUsId());
|
||||
int number = subscriptionService.count(queryWrapper);
|
||||
if(number>0){
|
||||
return Result.success("200","此问题已订阅");
|
||||
}
|
||||
if(subscriptionService.save(subscription)){
|
||||
return Result.success("200","订阅成功");
|
||||
}else {
|
||||
return Result.success("-1","订阅失败");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
package com.adc.da.slrs.StandardQA.dao;
|
||||
|
||||
import com.adc.da.slrs.StandardQA.entity.AskQuestions;
|
||||
import com.adc.da.slrs.StandardQA.entity.Reply;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Author: qk
|
||||
* @Date: 2022/5/31 0031 9:26
|
||||
* @Version 1.0
|
||||
*/
|
||||
@Repository
|
||||
public interface AskQuestionsDao extends BaseMapper<AskQuestions> {
|
||||
|
||||
List<AskQuestions> getAskQuestions (@Param("askQuestions") AskQuestions askQuestions);
|
||||
|
||||
List<AskQuestions> getReplyDetails (@Param("askQuestions") AskQuestions askQuestions);
|
||||
|
||||
List<AskQuestions> getReplyDetailsByStandId (@Param("askQuestions") AskQuestions askQuestions);
|
||||
|
||||
List<AskQuestions> getAskQuestionsBySubscription (@Param("askQuestions") AskQuestions askQuestions);
|
||||
|
||||
List<AskQuestions> retrieve (@Param("askQuestions") AskQuestions askQuestions);
|
||||
|
||||
List<AskQuestions> getSubscriptionByStandId (@Param("askQuestions") AskQuestions askQuestions);
|
||||
|
||||
List<AskQuestions> resemblance (@Param("chars") List<String> askQuestions);
|
||||
|
||||
List<AskQuestions> getAskQuestionsByStandardId (String standardId);
|
||||
|
||||
List<AskQuestions> getArchiveAskQuestions (String id);
|
||||
|
||||
List<Reply> getAskQuestionsByakId (String id);
|
||||
|
||||
List<String> getUId();
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
package com.adc.da.slrs.StandardQA.dao;
|
||||
|
||||
import com.adc.da.slrs.StandardQA.entity.AskQuestions;
|
||||
import com.adc.da.slrs.StandardQA.entity.AskUser;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
/**
|
||||
* @Author: qk
|
||||
* @Date: 2022/6/2 0002 8:47
|
||||
* @Version 1.0
|
||||
*/
|
||||
@Repository
|
||||
public interface AskUserDao extends BaseMapper<AskUser> {
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
package com.adc.da.slrs.StandardQA.dao;
|
||||
|
||||
import com.adc.da.slrs.StandardQA.entity.AskQuestions;
|
||||
import com.adc.da.slrs.StandardQA.entity.Reply;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
/**
|
||||
* @Author: qk
|
||||
* @Date: 2022/5/31 0031 11:02
|
||||
* @Version 1.0
|
||||
*/
|
||||
@Repository
|
||||
public interface ReplyDao extends BaseMapper<Reply> {
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
package com.adc.da.slrs.StandardQA.dao;
|
||||
|
||||
import com.adc.da.slrs.StandardQA.entity.Reply;
|
||||
import com.adc.da.slrs.StandardQA.entity.Subscription;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
/**
|
||||
* @Author: qk
|
||||
* @Date: 2022/6/7 0007 11:19
|
||||
* @Version 1.0
|
||||
*/
|
||||
@Repository
|
||||
public interface SubscriptionDao extends BaseMapper<Subscription> {
|
||||
}
|
||||
@@ -0,0 +1,104 @@
|
||||
package com.adc.da.slrs.StandardQA.entity;
|
||||
|
||||
import com.adc.da.base.entity.BaseEntity;
|
||||
import com.adc.da.common.ConvertMqEO;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Author: qk
|
||||
* @Date: 2022/5/31 0031 9:19
|
||||
* @Version 1.0
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Accessors(chain = true)
|
||||
@ApiModel(value="AskQuestions对象", description="")
|
||||
public class AskQuestions extends BaseEntity {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@TableId
|
||||
@ApiModelProperty(value = "主键")
|
||||
private String id;
|
||||
|
||||
@TableField("CLASSIFICATION")
|
||||
@ApiModelProperty(value = "分类")
|
||||
private String classification;
|
||||
|
||||
@TableField("PROBLEM_DESCRIPTION")
|
||||
@ApiModelProperty(value = "问题描述")
|
||||
private String problemDescription;
|
||||
|
||||
@TableField("QUESTIONER")
|
||||
@ApiModelProperty(value = "提问人")
|
||||
private String questioner;
|
||||
|
||||
@TableField("QUESTION_TIME")
|
||||
@ApiModelProperty(value = "提问时间")
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date questionTime;
|
||||
|
||||
@TableField("STANDARD_ENCDOING")
|
||||
@ApiModelProperty(value = "标准编号")
|
||||
private String standardEncdoing;
|
||||
|
||||
@TableField("STANDARD_NAME")
|
||||
@ApiModelProperty(value = "标准名称")
|
||||
private String standardName;
|
||||
|
||||
@TableField("STANDARD_ID")
|
||||
@ApiModelProperty(value = "标准ID")
|
||||
private String standardId;
|
||||
|
||||
@TableField("APPENDIX_ID")
|
||||
@ApiModelProperty(value = "标准ID")
|
||||
private String appendixId;
|
||||
|
||||
@TableField("APPENDIX_NAME")
|
||||
@ApiModelProperty(value = "标准ID")
|
||||
private String appendixName;
|
||||
|
||||
/**
|
||||
* 回答人
|
||||
*/
|
||||
@TableField(exist = false)
|
||||
private String answerer;
|
||||
/**
|
||||
* 回答
|
||||
*/
|
||||
@TableField(exist = false)
|
||||
private String reply;
|
||||
/**
|
||||
* 回答时间
|
||||
*/
|
||||
@TableField(exist = false)
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date replyTime;
|
||||
|
||||
/**
|
||||
*附件路径
|
||||
*/
|
||||
@TableField(exist = false)
|
||||
private String appendix;
|
||||
|
||||
@TableField(exist = false)
|
||||
private List<ConvertMqEO> fileList;
|
||||
|
||||
@TableField(exist = false)
|
||||
private String type;
|
||||
|
||||
@TableField(exist = false)
|
||||
private String subscription;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
package com.adc.da.slrs.StandardQA.entity;
|
||||
|
||||
import com.adc.da.base.entity.BaseEntity;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
/**
|
||||
* @Author: qk
|
||||
* @Date: 2022/6/2 0002 8:44
|
||||
* @Version 1.0
|
||||
*/
|
||||
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Accessors(chain = true)
|
||||
@ApiModel(value="AskUser对象", description="")
|
||||
public class AskUser extends BaseEntity {
|
||||
|
||||
|
||||
@TableField("ASK_ID")
|
||||
@ApiModelProperty(value = "问题ID")
|
||||
private String asdId;
|
||||
|
||||
|
||||
@TableField("USID")
|
||||
@ApiModelProperty(value = "用户ID")
|
||||
private String usid;
|
||||
}
|
||||
@@ -0,0 +1,71 @@
|
||||
package com.adc.da.slrs.StandardQA.entity;
|
||||
|
||||
import com.adc.da.base.entity.BaseEntity;
|
||||
import com.adc.da.common.ConvertMqEO;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Author: qk
|
||||
* @Date: 2022/5/31 0031 9:20
|
||||
* @Version 1.0
|
||||
*/
|
||||
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Accessors(chain = true)
|
||||
@ApiModel(value="Reply对象", description="")
|
||||
public class Reply extends BaseEntity {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@TableId
|
||||
@ApiModelProperty(value = "主键")
|
||||
private String id;
|
||||
|
||||
@TableField("REPLY")
|
||||
@ApiModelProperty(value = "回答")
|
||||
private String reply;
|
||||
|
||||
@TableField("STATE")
|
||||
@ApiModelProperty(value = "状态(0:显示,1:不显示)")
|
||||
private String state;
|
||||
|
||||
@TableField("REPLY_TIME")
|
||||
@ApiModelProperty(value = "回答时间")
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date replyTime;
|
||||
|
||||
@TableField("APPENDIX")
|
||||
@ApiModelProperty(value = "附件")
|
||||
private String appendix;
|
||||
|
||||
@TableField("ANSWERER")
|
||||
@ApiModelProperty(value = "回答人")
|
||||
private String answerer;
|
||||
|
||||
@TableField("ASK_ID")
|
||||
@ApiModelProperty(value = "问题ID")
|
||||
private String askId;
|
||||
|
||||
@TableField("APPENDIX_ID")
|
||||
@ApiModelProperty(value = "附件ID")
|
||||
private String appendixId;
|
||||
|
||||
@TableField("APPENDIX_NAME")
|
||||
@ApiModelProperty(value = "附件名称")
|
||||
private String appendixName;
|
||||
|
||||
@TableField(exist = false)
|
||||
private List<ConvertMqEO> fileList;
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
package com.adc.da.slrs.StandardQA.entity;
|
||||
|
||||
import com.adc.da.base.entity.BaseEntity;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
/**
|
||||
* @Author: qk
|
||||
* @Date: 2022/6/7 0007 11:16
|
||||
* @Version 1.0
|
||||
*/
|
||||
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Accessors(chain = true)
|
||||
@ApiModel(value="Subscription对象", description="")
|
||||
public class Subscription extends BaseEntity {
|
||||
|
||||
|
||||
@TableField("ASK_ID")
|
||||
@ApiModelProperty(value = "问题ID")
|
||||
private String askId;
|
||||
|
||||
@TableField("USID")
|
||||
@ApiModelProperty(value = "用户ID")
|
||||
private String usId;
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
package com.adc.da.slrs.StandardQA.service;
|
||||
|
||||
import com.adc.da.slrs.NewsFeed.entity.NewsFeed;
|
||||
import com.adc.da.slrs.StandardQA.entity.AskQuestions;
|
||||
import com.adc.da.slrs.StandardQA.entity.Reply;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Author: qk
|
||||
* @Date: 2022/5/31 0031 9:22
|
||||
* @Version 1.0
|
||||
*/
|
||||
public interface AskQuestionsService extends IService<AskQuestions> {
|
||||
|
||||
List<AskQuestions> getAskQuestions(AskQuestions askQuestions);
|
||||
|
||||
List<AskQuestions> getReplyDetails(AskQuestions askQuestions);
|
||||
List<AskQuestions> getReplyDetailsByStandId(AskQuestions askQuestions);
|
||||
List<AskQuestions> getAskQuestionsBySubscription(AskQuestions askQuestions);
|
||||
List<AskQuestions> retrieve(AskQuestions askQuestions);
|
||||
List<AskQuestions> getSubscriptionByStandId(AskQuestions askQuestions);
|
||||
List<AskQuestions> resemblance(List<String> askQuestions);
|
||||
|
||||
List<AskQuestions> getAskQuestionsByStandardId(String standardId);
|
||||
List<AskQuestions> getArchiveAskQuestions(String id);
|
||||
List<Reply> getAskQuestionsByakId(String id);
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
package com.adc.da.slrs.StandardQA.service;
|
||||
|
||||
import com.adc.da.slrs.StandardQA.entity.AskQuestions;
|
||||
import com.adc.da.slrs.StandardQA.entity.AskUser;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
/**
|
||||
* @Author: qk
|
||||
* @Date: 2022/6/2 0002 8:47
|
||||
* @Version 1.0
|
||||
*/
|
||||
public interface AskUserService extends IService<AskUser> {
|
||||
}
|
||||
+79
@@ -0,0 +1,79 @@
|
||||
package com.adc.da.slrs.StandardQA.service.Impl;
|
||||
|
||||
|
||||
import com.adc.da.slrs.StandardQA.dao.AskQuestionsDao;
|
||||
import com.adc.da.slrs.StandardQA.entity.AskQuestions;
|
||||
import com.adc.da.slrs.StandardQA.entity.Reply;
|
||||
import com.adc.da.slrs.StandardQA.service.AskQuestionsService;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Propagation;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Author: qk
|
||||
* @Date: 2022/5/31 0031 9:23
|
||||
* @Version 1.0
|
||||
*/
|
||||
@Service
|
||||
@Transactional(value = "transactionManager", readOnly = false, propagation = Propagation.REQUIRED, rollbackFor = Throwable.class)
|
||||
public class AskQuestionsServiceImpl extends ServiceImpl<AskQuestionsDao, AskQuestions> implements AskQuestionsService {
|
||||
|
||||
@Autowired
|
||||
private AskQuestionsDao askQuestionsDao;
|
||||
|
||||
@Override
|
||||
public List<AskQuestions> getAskQuestions(AskQuestions askQuestions) {
|
||||
return askQuestionsDao.getAskQuestions(askQuestions);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<AskQuestions> getReplyDetails(AskQuestions askQuestions) {
|
||||
return askQuestionsDao.getReplyDetails(askQuestions);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<AskQuestions> getReplyDetailsByStandId(AskQuestions askQuestions) {
|
||||
return askQuestionsDao.getReplyDetailsByStandId(askQuestions);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<AskQuestions> getAskQuestionsBySubscription(AskQuestions askQuestions) {
|
||||
return askQuestionsDao.getAskQuestionsBySubscription(askQuestions);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<AskQuestions> retrieve(AskQuestions askQuestions) {
|
||||
return askQuestionsDao.retrieve(askQuestions);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<AskQuestions> getSubscriptionByStandId(AskQuestions askQuestions) {
|
||||
return askQuestionsDao.getSubscriptionByStandId(askQuestions);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<AskQuestions> resemblance(List<String> askQuestions) {
|
||||
return askQuestionsDao.resemblance(askQuestions);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<AskQuestions> getAskQuestionsByStandardId(String standardId) {
|
||||
return askQuestionsDao.getAskQuestionsByStandardId(standardId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<AskQuestions> getArchiveAskQuestions(String id) {
|
||||
return askQuestionsDao.getArchiveAskQuestions(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Reply> getAskQuestionsByakId(String id) {
|
||||
return askQuestionsDao.getAskQuestionsByakId(id);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
+22
@@ -0,0 +1,22 @@
|
||||
package com.adc.da.slrs.StandardQA.service.Impl;
|
||||
|
||||
|
||||
import com.adc.da.slrs.StandardQA.dao.AskUserDao;
|
||||
import com.adc.da.slrs.StandardQA.entity.AskUser;
|
||||
import com.adc.da.slrs.StandardQA.service.AskUserService;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Propagation;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
/**
|
||||
* @Author: qk
|
||||
* @Date: 2022/6/2 0002 8:47
|
||||
* @Version 1.0
|
||||
*/
|
||||
|
||||
@Service
|
||||
@Transactional(value = "transactionManager", readOnly = false, propagation = Propagation.REQUIRED, rollbackFor = Throwable.class)
|
||||
public class AskUserServiceImpl extends ServiceImpl<AskUserDao, AskUser> implements AskUserService {
|
||||
|
||||
}
|
||||
+19
@@ -0,0 +1,19 @@
|
||||
package com.adc.da.slrs.StandardQA.service.Impl;
|
||||
|
||||
import com.adc.da.slrs.StandardQA.dao.ReplyDao;
|
||||
import com.adc.da.slrs.StandardQA.entity.Reply;
|
||||
import com.adc.da.slrs.StandardQA.service.ReplyService;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Propagation;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
/**
|
||||
* @Author: qk
|
||||
* @Date: 2022/5/31 0031 11:03
|
||||
* @Version 1.0
|
||||
*/
|
||||
@Service
|
||||
@Transactional(value = "transactionManager", readOnly = false, propagation = Propagation.REQUIRED, rollbackFor = Throwable.class)
|
||||
public class ReplyServiceImpl extends ServiceImpl<ReplyDao, Reply> implements ReplyService {
|
||||
}
|
||||
+20
@@ -0,0 +1,20 @@
|
||||
package com.adc.da.slrs.StandardQA.service.Impl;
|
||||
|
||||
|
||||
import com.adc.da.slrs.StandardQA.dao.SubscriptionDao;
|
||||
import com.adc.da.slrs.StandardQA.entity.Subscription;
|
||||
import com.adc.da.slrs.StandardQA.service.SubscriptionService;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Propagation;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
/**
|
||||
* @Author: qk
|
||||
* @Date: 2022/6/7 0007 11:20
|
||||
* @Version 1.0
|
||||
*/
|
||||
@Service
|
||||
@Transactional(value = "transactionManager", readOnly = false, propagation = Propagation.REQUIRED, rollbackFor = Throwable.class)
|
||||
public class SubscriptionServiceImpl extends ServiceImpl<SubscriptionDao, Subscription> implements SubscriptionService {
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
package com.adc.da.slrs.StandardQA.service;
|
||||
|
||||
import com.adc.da.slrs.StandardQA.entity.AskQuestions;
|
||||
import com.adc.da.slrs.StandardQA.entity.Reply;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
/**
|
||||
* @Author: qk
|
||||
* @Date: 2022/5/31 0031 11:02
|
||||
* @Version 1.0
|
||||
*/
|
||||
public interface ReplyService extends IService<Reply> {
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
package com.adc.da.slrs.StandardQA.service;
|
||||
|
||||
import com.adc.da.slrs.StandardQA.entity.Reply;
|
||||
import com.adc.da.slrs.StandardQA.entity.Subscription;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
/**
|
||||
* @Author: qk
|
||||
* @Date: 2022/6/7 0007 11:20
|
||||
* @Version 1.0
|
||||
*/
|
||||
public interface SubscriptionService extends IService<Subscription> {
|
||||
}
|
||||
@@ -0,0 +1,219 @@
|
||||
<?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.adc.da.slrs.StandardQA.dao.AskQuestionsDao">
|
||||
|
||||
<select id="getAskQuestions" resultType="com.adc.da.slrs.StandardQA.entity.AskQuestions">
|
||||
SELECT
|
||||
DISTINCT
|
||||
aq.STANDARD_ID,aq.CLASSIFICATION,aq.STANDARD_ENCDOING,
|
||||
aq.STANDARD_NAME
|
||||
FROM ask_questions aq
|
||||
LEFT JOIN reply ON aq.ID = reply.ASK_ID
|
||||
LEFT JOIN ts_user t1 ON t1.USID = aq.QUESTIONER
|
||||
LEFT JOIN ts_user t2 ON t2.USID = reply.ANSWERER
|
||||
<where>
|
||||
<if test="askQuestions.questioner != null and askQuestions.questioner != ''">
|
||||
AND aq.QUESTIONER =#{askQuestions.questioner}
|
||||
</if>
|
||||
<if test="askQuestions.id != null and askQuestions.id != ''">
|
||||
AND aq.ID = #{askQuestions.id}
|
||||
</if>
|
||||
<if test="askQuestions.standardId !=null and askQuestions.standardId !=''">
|
||||
AND aq.STANDARD_ID = #{askQuestions.standardId}
|
||||
</if>
|
||||
<if test="askQuestions.classification != null and askQuestions.classification != ''">
|
||||
AND aq.CLASSIFICATION = #{askQuestions.classification}
|
||||
</if>
|
||||
<if test="askQuestions.standardEncdoing != null and askQuestions.standardEncdoing != ''">
|
||||
AND aq.STANDARD_ENCDOING LIKE concat(concat('%',#{askQuestions.standardEncdoing}),'%')
|
||||
</if>
|
||||
<if test="askQuestions.standardName != null and askQuestions.standardName !=''">
|
||||
AND aq.STANDARD_NAME LIKE concat(concat('%',#{askQuestions.standardName}),'%')
|
||||
</if>
|
||||
<if test="askQuestions.problemDescription != null and askQuestions.problemDescription != ''">
|
||||
AND aq.PROBLEM_DESCRIPTION LIKE concat(concat('%',#{askQuestions.problemDescription}),'%')
|
||||
</if>
|
||||
<if test="askQuestions.answerer !=null and askQuestions.answerer !=''">
|
||||
AND reply.ANSWERER = #{askQuestions.answerer}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="getAskQuestionsByStandardId" resultType="com.adc.da.slrs.StandardQA.entity.AskQuestions">
|
||||
SELECT aq.ID,aq.CLASSIFICATION,aq.PROBLEM_DESCRIPTION,t1.UNAME QUESTIONER,aq.QUESTION_TIME,aq.STANDARD_ENCDOING,
|
||||
aq.STANDARD_NAME,aq.STANDARD_ID
|
||||
FROM ask_questions aq
|
||||
LEFT JOIN ts_user t1 ON t1.USID = aq.QUESTIONER
|
||||
<where>
|
||||
<if test="standardId !=null and standardId !=''">
|
||||
AND aq.STANDARD_ID = #{standardId}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="getArchiveAskQuestions" resultType="com.adc.da.slrs.StandardQA.entity.AskQuestions">
|
||||
SELECT reply.REPLY,reply.REPLY_TIME,t2.UNAME ANSWERER,
|
||||
reply.APPENDIX,reply.APPENDIX_ID,reply.APPENDIX_NAME
|
||||
FROM reply
|
||||
LEFT JOIN ts_user t2 ON t2.USID = reply.ANSWERER
|
||||
<where>
|
||||
reply.STATE = 'yes'
|
||||
<if test="id != nll and id !=''">
|
||||
AND reply.ASK_ID = #{id}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="getAskQuestionsByakId" resultType="com.adc.da.slrs.StandardQA.entity.Reply">
|
||||
SELECT reply.ID, reply.REPLY,reply.REPLY_TIME,t2.UNAME ANSWERER,reply.APPENDIX_ID,APPENDIX_NAME
|
||||
FROM reply
|
||||
LEFT JOIN ts_user t2 ON t2.USID = reply.ANSWERER
|
||||
<where>
|
||||
<if test="id !=null and id !=''">
|
||||
AND reply.ASK_ID = #{id}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="getReplyDetails" resultType="com.adc.da.slrs.StandardQA.entity.AskQuestions">
|
||||
SELECT aq.ID,aq.CLASSIFICATION,aq.PROBLEM_DESCRIPTION,t1.UNAME QUESTIONER,aq.QUESTION_TIME,aq.STANDARD_ENCDOING,
|
||||
aq.STANDARD_NAME,aq.STANDARD_ID,reply.REPLY,reply.REPLY_TIME,t2.UNAME ANSWERER,
|
||||
reply.APPENDIX,reply.APPENDIX_ID,reply.APPENDIX_NAME
|
||||
FROM ask_questions aq
|
||||
LEFT JOIN reply ON aq.ID = reply.ASK_ID AND reply.STATE = '0'
|
||||
LEFT JOIN ts_user t1 ON t1.USID = aq.QUESTIONER
|
||||
LEFT JOIN ts_user t2 ON t2.USID = reply.ANSWERER
|
||||
LEFT JOIN ask_user au ON au.ASK_ID = aq.ID
|
||||
<where>
|
||||
<if test="askQuestions.answerer != null and askQuestions.answerer != ''">
|
||||
AND au.USID = #{askQuestions.answerer}
|
||||
</if>
|
||||
<if test="askQuestions.classification !=null and askQuestions.classification !=''">
|
||||
AND aq.CLASSIFICATION = #{askQuestions.classification}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="getReplyDetailsByStandId" resultType="com.adc.da.slrs.StandardQA.entity.AskQuestions">
|
||||
SELECT aq.ID,aq.CLASSIFICATION,aq.PROBLEM_DESCRIPTION,t1.UNAME QUESTIONER,aq.QUESTION_TIME,aq.STANDARD_ENCDOING,
|
||||
aq.STANDARD_NAME,aq.STANDARD_ID,reply.REPLY,reply.REPLY_TIME,t2.UNAME ANSWERER,
|
||||
reply.APPENDIX,reply.APPENDIX_ID,reply.APPENDIX_NAME
|
||||
FROM ask_questions aq
|
||||
LEFT JOIN reply ON aq.ID = reply.ASK_ID AND reply.STATE = '0'
|
||||
LEFT JOIN ts_user t1 ON t1.USID = aq.QUESTIONER
|
||||
LEFT JOIN ts_user t2 ON t2.USID = reply.ANSWERER
|
||||
LEFT JOIN ask_user au ON au.ASK_ID = aq.ID
|
||||
<where>
|
||||
<if test="askQuestions.standardId !=null and askQuestions.standardId !=''">
|
||||
AND aq.STANDARD_ID = #{askQuestions.standardId}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="getAskQuestionsBySubscription" resultType="com.adc.da.slrs.StandardQA.entity.AskQuestions">
|
||||
SELECT
|
||||
DISTINCT
|
||||
aq.STANDARD_ID,aq.CLASSIFICATION,aq.STANDARD_ENCDOING,aq.STANDARD_NAME
|
||||
FROM ask_questions aq
|
||||
LEFT JOIN reply ON aq.ID = reply.ASK_ID
|
||||
LEFT JOIN ts_user t1 ON t1.USID = aq.QUESTIONER
|
||||
LEFT JOIN ts_user t2 ON t2.USID = reply.ANSWERER
|
||||
LEFT JOIN subscription su ON su.ASK_ID = aq.ID
|
||||
<where>
|
||||
<if test="askQuestions.answerer !=null and askQuestions.answerer !=''">
|
||||
AND su.USID = #{askQuestions.answerer}
|
||||
</if>
|
||||
<if test="askQuestions.classification !=null and askQuestions.classification !=''">
|
||||
AND aq.CLASSIFICATION = #{askQuestions.classification}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="retrieve" resultType="com.adc.da.slrs.StandardQA.entity.AskQuestions">
|
||||
SELECT
|
||||
DISTINCT
|
||||
aq.STANDARD_ID,aq.CLASSIFICATION,aq.STANDARD_ENCDOING,aq.STANDARD_NAME
|
||||
FROM ask_questions aq
|
||||
LEFT JOIN reply ON aq.ID = reply.ASK_ID
|
||||
LEFT JOIN ts_user t1 ON t1.USID = aq.QUESTIONER
|
||||
LEFT JOIN ts_user t2 ON t2.USID = reply.ANSWERER
|
||||
<if test="askQuestions.type == 'myAns'">
|
||||
LEFT JOIN ask_user au ON au.ASK_ID = aq.ID
|
||||
</if>
|
||||
<if test="askQuestions.type == 'mySub'">
|
||||
LEFT JOIN subscription su ON su.ASK_ID = aq.ID
|
||||
</if>
|
||||
<where>
|
||||
<if test="askQuestions.questioner != null and askQuestions.questioner != ''">
|
||||
AND aq.QUESTIONER =#{askQuestions.questioner}
|
||||
</if>
|
||||
<if test="askQuestions.id != null and askQuestions.id != ''">
|
||||
AND aq.ID = #{askQuestions.id}
|
||||
</if>
|
||||
<if test="askQuestions.standardId !=null and askQuestions.standardId !=''">
|
||||
AND aq.STANDARD_ID = #{askQuestions.standardId}
|
||||
</if>
|
||||
<if test="askQuestions.classification != null and askQuestions.classification != ''">
|
||||
AND aq.CLASSIFICATION = #{askQuestions.classification}
|
||||
</if>
|
||||
<if test="askQuestions.standardEncdoing != null and askQuestions.standardEncdoing != ''">
|
||||
AND aq.STANDARD_ENCDOING LIKE concat(concat('%',#{askQuestions.standardEncdoing}),'%')
|
||||
</if>
|
||||
<if test="askQuestions.standardName != null and askQuestions.standardName !=''">
|
||||
AND aq.STANDARD_NAME LIKE concat(concat('%',#{askQuestions.standardName}),'%')
|
||||
</if>
|
||||
<if test="askQuestions.subscription !=null and askQuestions.subscription !=''">
|
||||
AND su.USID = #{askQuestions.subscription}
|
||||
</if>
|
||||
<if test="askQuestions.answerer != null and askQuestions.answerer != ''">
|
||||
AND au.USID = #{askQuestions.answerer}
|
||||
</if>
|
||||
<if test="askQuestions.problemDescription != null and askQuestions.problemDescription != ''">
|
||||
AND aq.PROBLEM_DESCRIPTION LIKE concat(concat('%',#{askQuestions.problemDescription}),'%')
|
||||
</if>
|
||||
<if test="askQuestions.answerer !=null and askQuestions.answerer !=''">
|
||||
AND reply.ANSWERER = #{askQuestions.answerer}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="getSubscriptionByStandId" resultType="com.adc.da.slrs.StandardQA.entity.AskQuestions">
|
||||
SELECT aq.ID,aq.CLASSIFICATION,aq.PROBLEM_DESCRIPTION,t1.UNAME QUESTIONER,aq.QUESTION_TIME,aq.STANDARD_ENCDOING,
|
||||
aq.STANDARD_NAME,aq.STANDARD_ID,reply.REPLY,reply.REPLY_TIME,t2.UNAME ANSWERER,
|
||||
reply.APPENDIX,reply.APPENDIX_ID,reply.APPENDIX_NAME
|
||||
FROM ask_questions aq
|
||||
LEFT JOIN reply ON aq.ID = reply.ASK_ID AND reply.STATE = '0'
|
||||
LEFT JOIN ts_user t1 ON t1.USID = aq.QUESTIONER
|
||||
LEFT JOIN ts_user t2 ON t2.USID = reply.ANSWERER
|
||||
LEFT JOIN subscription su ON su.ASK_ID = aq.ID
|
||||
<where>
|
||||
<if test="askQuestions.answerer !=null and askQuestions.answerer !=''">
|
||||
AND su.USID = #{askQuestions.answerer}
|
||||
</if>
|
||||
<if test="askQuestions.classification !=null and askQuestions.classification !=''">
|
||||
AND aq.CLASSIFICATION = #{askQuestions.classification}
|
||||
</if>
|
||||
<if test="askQuestions.standardId !=null and askQuestions.standardId !=''">
|
||||
AND aq.STANDARD_ID = #{askQuestions.standardId}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="resemblance" resultType="com.adc.da.slrs.StandardQA.entity.AskQuestions">
|
||||
SELECT *,
|
||||
<foreach item="item" collection="chars" separator="+" open="(" close=")" index="">
|
||||
(case when PROBLEM_DESCRIPTION like CONCAT('%',#{item},'%') then 1 else 0 end)
|
||||
</foreach>
|
||||
as num from ask_questions having num >1 order by num DESC
|
||||
</select>
|
||||
|
||||
<select id="getUId" resultType="java.lang.String">
|
||||
SELECT tu.USID
|
||||
FROM ts_user tu
|
||||
LEFT JOIN ts_institution ti ON ti.id = tu.INSTITUTION_ID
|
||||
WHERE
|
||||
ti.`name`='标准法规部'
|
||||
</select>
|
||||
|
||||
|
||||
</mapper>
|
||||
Reference in New Issue
Block a user