5 changed files with 85 additions and 2 deletions
@ -0,0 +1,17 @@ |
|||
package com.ccsens.mt.persist.dao; |
|||
|
|||
import com.ccsens.mt.bean.dto.TopicDto; |
|||
import com.ccsens.mt.bean.vo.TopicVo; |
|||
|
|||
/** |
|||
* 答题项目 |
|||
* @author whj |
|||
*/ |
|||
public interface GroupDao { |
|||
/** |
|||
* 查询抢答成功的组信息 |
|||
* @param topic 抢答条件 |
|||
* @return 组 |
|||
*/ |
|||
TopicVo.GroupInfo getResponder(TopicDto.Topic topic); |
|||
} |
@ -0,0 +1,18 @@ |
|||
package com.ccsens.mt.util; |
|||
|
|||
/** |
|||
* @description: |
|||
* @author: whj |
|||
* @time: 2020/8/13 17:14 |
|||
*/ |
|||
public class Constant { |
|||
public static class Redis{ |
|||
// 项目正在进行中的题目 项目ID_start_question
|
|||
public final static String START_QUESTION = "_start_question"; |
|||
// 有效期10分钟
|
|||
public final static long TIME_OUT = 10 * 60; |
|||
// 抢答成功的队伍 项目ID_responder_题目ID
|
|||
public final static String RESPONDER = "_responder_"; |
|||
|
|||
} |
|||
} |
@ -0,0 +1,23 @@ |
|||
<?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.ccsens.mt.persist.dao.GroupDao"> |
|||
|
|||
|
|||
<select id="getResponder" resultType="com.ccsens.mt.bean.vo.TopicVo$GroupInfo"> |
|||
SELECT |
|||
g.id as groupId, |
|||
g.NAME as groupName |
|||
FROM |
|||
t_mt_responder r, |
|||
t_mt_group g |
|||
WHERE |
|||
r.group_id = g.id |
|||
AND g.project_id = 1 |
|||
AND r.topic_id = 1 |
|||
AND r.rec_status = 0 |
|||
AND g.rec_status = 0 |
|||
ORDER BY |
|||
r.created_at DESC |
|||
LIMIT 1 |
|||
</select> |
|||
</mapper> |
Loading…
Reference in new issue