小程序端接口实现
This commit is contained in:
@ -78,6 +78,11 @@ spring:
|
||||
max-active: 8
|
||||
# #连接池最大阻塞等待时间(使用负值表示没有限制)
|
||||
max-wait: -1ms
|
||||
rabbitmq:
|
||||
host: 192.168.157.129
|
||||
password: guest
|
||||
username: guest
|
||||
port: 5672
|
||||
|
||||
# token配置
|
||||
token:
|
||||
@ -85,8 +90,8 @@ token:
|
||||
header: Authorization
|
||||
# 令牌密钥
|
||||
secret: abcdefghijklmnopqrstuvwxyz
|
||||
# 令牌有效期(默认30分钟)
|
||||
expireTime: 30
|
||||
# 令牌有效期(默认1200分钟)
|
||||
expireTime: 1200
|
||||
|
||||
# MyBatis配置
|
||||
#mybatis:
|
||||
|
@ -63,5 +63,32 @@
|
||||
INNER JOIN system_dict ON card_game.type = system_dict.dict_key and system_dict.dict_type='gametype'
|
||||
where card_game.id=#{id}
|
||||
</select>
|
||||
<select id="showAllCardGame" resultType="java.util.HashMap">
|
||||
SELECT
|
||||
id,
|
||||
title,
|
||||
start_time,
|
||||
end_time,
|
||||
CASE
|
||||
WHEN NOW() <`start_time` THEN '未开始'
|
||||
WHEN NOW() BETWEEN `start_time` AND `end_time` THEN '进行中'
|
||||
ELSE '已结束'
|
||||
END AS status
|
||||
FROM
|
||||
`card_game`;
|
||||
</select>
|
||||
<select id="getCardByDate" resultType="com.ruoyi.project.hit.domain.CardGame">
|
||||
SELECT * FROM card_game
|
||||
WHERE status = 0
|
||||
AND start_time > #{now}
|
||||
AND start_time <DATE_ADD(#{now}, INTERVAL 5 MINUTE)
|
||||
</select>
|
||||
<select id="getCardGameBygameid" resultType="java.util.HashMap">
|
||||
SELECT cg.id,cg.title,cg.pic,cg.content,cg.start_time startTime,cg.end_time endTime,sd.dict_value dictValue
|
||||
from card_game cg
|
||||
INNER JOIN system_dict sd
|
||||
on cg.type=sd.dict_key
|
||||
where cg.id=#{gameid} and sd.dict_type='gametype'
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
|
@ -28,4 +28,22 @@
|
||||
<select id="getSumAmountByGameId" resultType="java.lang.Integer">
|
||||
SELECT IFNULL(SUM(amount),0) FROM `card_game_product` WHERE gameid=#{gameid}
|
||||
</select>
|
||||
<select id="getGameProductList" resultType="com.ruoyi.project.uniapp.controller.vo.CardProductVo">
|
||||
SELECT
|
||||
card_game_product.amount,
|
||||
card_product.id,
|
||||
card_product.pname,
|
||||
card_product.pic,
|
||||
card_product.content,
|
||||
card_product.price,
|
||||
card_product.del_state AS delState
|
||||
FROM
|
||||
card_game_product
|
||||
INNER JOIN
|
||||
card_product
|
||||
ON
|
||||
card_game_product.productid = card_product.id
|
||||
WHERE card_game_product.gameid=#{id}
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
|
@ -27,6 +27,7 @@
|
||||
INNER JOIN system_dict ON card_game_rule.levelid = system_dict.dict_key AND system_dict.dict_type='userlevel'
|
||||
WHERE card_game_rule.gameid=#{id}
|
||||
</select>
|
||||
|
||||
<select id="getHitCountSumByGameId" resultType="java.lang.Integer">
|
||||
SELECT IFNULL(SUM(hit_count),0) FROM `card_game_rule` WHERE gameid=#{gameid}
|
||||
</select>
|
||||
|
18
src/main/resources/mybatis/hit/CardGameUserMapper.xml
Normal file
18
src/main/resources/mybatis/hit/CardGameUserMapper.xml
Normal file
@ -0,0 +1,18 @@
|
||||
<?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.ruoyi.project.hit.mapper.CardGameUserMapper">
|
||||
|
||||
<resultMap id="BaseResultMap" type="com.ruoyi.project.hit.domain.CardGameUser">
|
||||
<id property="id" column="id" jdbcType="INTEGER"/>
|
||||
<result property="userid" column="userid" jdbcType="INTEGER"/>
|
||||
<result property="gameid" column="gameid" jdbcType="INTEGER"/>
|
||||
<result property="createtime" column="createtime" jdbcType="TIMESTAMP"/>
|
||||
</resultMap>
|
||||
|
||||
<sql id="Base_Column_List">
|
||||
id,userid,gameid,
|
||||
createtime
|
||||
</sql>
|
||||
</mapper>
|
@ -39,13 +39,7 @@
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
<select id="getCardGameBygameid" resultType="java.util.Map">
|
||||
SELECT cg.id,cg.title,cg.pic,cg.content,cg.start_time startTime,cg.end_time endTime,sd.dict_value dictValue
|
||||
from card_game cg
|
||||
INNER JOIN system_dict sd
|
||||
on cg.type=sd.dict_key
|
||||
where cg.id=#{gameid} and sd.dict_type='gametype'
|
||||
</select>
|
||||
|
||||
<select id="getProductsBygameid" resultType="java.util.HashMap">
|
||||
SELECT cp.id,cp.pname,cgp.amount,IFNULL(cn,0) hitCount
|
||||
FROM card_game_product cgp
|
||||
@ -97,4 +91,22 @@
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
<select id="winnerRecord" resultType="java.util.HashMap">
|
||||
SELECT
|
||||
card_product.pname,
|
||||
card_user_hit.hittime,
|
||||
card_game.title
|
||||
FROM
|
||||
card_user_hit
|
||||
INNER JOIN
|
||||
card_game
|
||||
ON
|
||||
card_user_hit.gameid = card_game.id
|
||||
INNER JOIN
|
||||
card_product
|
||||
ON
|
||||
card_user_hit.productid = card_product.id
|
||||
WHERE
|
||||
card_user_hit.userid = #{userId}
|
||||
</select>
|
||||
</mapper>
|
||||
|
@ -16,7 +16,7 @@
|
||||
<result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
|
||||
<result property="updateTime" column="update_time" jdbcType="TIMESTAMP"/>
|
||||
<result property="delState" column="del_state" jdbcType="INTEGER"/>
|
||||
<result property="remark" column="remark" jdbcType="VARCHAR"/>
|
||||
<!-- <result property="remark" column="remark" jdbcType="VARCHAR"/>-->
|
||||
</resultMap>
|
||||
|
||||
<sql id="Base_Column_List">
|
||||
@ -26,6 +26,7 @@
|
||||
phone,level,create_time,
|
||||
update_time,del_state,remark
|
||||
</sql>
|
||||
|
||||
<select id="selectCardUserList" resultType="java.util.HashMap">
|
||||
SELECT u.id,u.user_name userName,u.pic,u.realname,u.id_card idCard,u.phone,u.create_time createTime,u.update_time updateTime,d.dict_value dictValue
|
||||
FROM `card_user` u,`system_dict` d
|
||||
|
Reference in New Issue
Block a user