ruoyi
This commit is contained in:
67
src/main/resources/mybatis/hit/CardGameMapper.xml
Normal file
67
src/main/resources/mybatis/hit/CardGameMapper.xml
Normal file
@ -0,0 +1,67 @@
|
||||
<?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.CardGameMapper">
|
||||
|
||||
<resultMap id="BaseResultMap" type="com.ruoyi.project.hit.domain.CardGame">
|
||||
<id property="id" column="id" jdbcType="INTEGER"/>
|
||||
<result property="title" column="title" jdbcType="VARCHAR"/>
|
||||
<result property="pic" column="pic" jdbcType="VARCHAR"/>
|
||||
<result property="content" column="content" jdbcType="VARCHAR"/>
|
||||
<result property="startTime" column="start_time" jdbcType="TIMESTAMP"/>
|
||||
<result property="endTime" column="end_time" jdbcType="TIMESTAMP"/>
|
||||
<result property="type" column="type" jdbcType="SMALLINT"/>
|
||||
<result property="status" column="status" jdbcType="SMALLINT"/>
|
||||
<result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
|
||||
<result property="updateTime" column="update_time" jdbcType="TIMESTAMP"/>
|
||||
</resultMap>
|
||||
|
||||
<sql id="Base_Column_List">
|
||||
id,title,pic,
|
||||
content,start_time,end_time,
|
||||
type,status,create_time,
|
||||
update_time
|
||||
</sql>
|
||||
<select id="selectCardGameList" resultType="java.util.HashMap">
|
||||
SELECT
|
||||
system_dict.dict_value dictValue,
|
||||
card_game.end_time endTime,
|
||||
card_game.start_time startTime,
|
||||
card_game.title,
|
||||
card_game.id
|
||||
FROM
|
||||
card_game
|
||||
INNER JOIN
|
||||
system_dict
|
||||
ON
|
||||
card_game.type = system_dict.dict_key and system_dict.dict_type='gametype'
|
||||
<where>
|
||||
<if test="title!=null and title!=''">
|
||||
card_game.title like concat('%',#{title},'%')
|
||||
</if>
|
||||
<if test="startTime!=null and endTime!=null">
|
||||
and card_game.start_time>=#{startTime} and card_game.end_time <=#{endTime}
|
||||
</if>
|
||||
<if test="type!=null">
|
||||
and type=#{type}
|
||||
</if>
|
||||
|
||||
</where>
|
||||
</select>
|
||||
<select id="getCardGameByGameId" resultType="java.util.HashMap">
|
||||
SELECT
|
||||
system_dict.dict_value `dictValue`,
|
||||
card_game.id,
|
||||
card_game.title,
|
||||
card_game.pic,
|
||||
card_game.content,
|
||||
card_game.start_time AS startTime,
|
||||
card_game.end_time AS endTime
|
||||
FROM
|
||||
card_game
|
||||
INNER JOIN system_dict ON card_game.type = system_dict.dict_key and system_dict.dict_type='gametype'
|
||||
where card_game.id=#{id}
|
||||
</select>
|
||||
|
||||
</mapper>
|
31
src/main/resources/mybatis/hit/CardGameProductMapper.xml
Normal file
31
src/main/resources/mybatis/hit/CardGameProductMapper.xml
Normal file
@ -0,0 +1,31 @@
|
||||
<?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.CardGameProductMapper">
|
||||
|
||||
<resultMap id="BaseResultMap" type="com.ruoyi.project.hit.domain.CardGameProduct">
|
||||
<id property="id" column="id" jdbcType="INTEGER"/>
|
||||
<result property="gameid" column="gameid" jdbcType="INTEGER"/>
|
||||
<result property="productid" column="productid" jdbcType="INTEGER"/>
|
||||
<result property="amount" column="amount" jdbcType="INTEGER"/>
|
||||
</resultMap>
|
||||
|
||||
<sql id="Base_Column_List">
|
||||
id,gameid,productid,
|
||||
amount
|
||||
</sql>
|
||||
<select id="getGameProductByGameId" resultType="java.util.HashMap">
|
||||
SELECT
|
||||
card_product.id,
|
||||
card_product.pname,
|
||||
card_game_product.amount
|
||||
FROM
|
||||
card_game_product
|
||||
INNER JOIN card_product ON card_game_product.productid = card_product.id
|
||||
where card_game_product.gameid=#{id}
|
||||
</select>
|
||||
<select id="getSumAmountByGameId" resultType="java.lang.Integer">
|
||||
SELECT IFNULL(SUM(amount),0) FROM `card_game_product` WHERE gameid=#{gameid}
|
||||
</select>
|
||||
</mapper>
|
33
src/main/resources/mybatis/hit/CardGameRuleMapper.xml
Normal file
33
src/main/resources/mybatis/hit/CardGameRuleMapper.xml
Normal file
@ -0,0 +1,33 @@
|
||||
<?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.CardGameRuleMapper">
|
||||
|
||||
<resultMap id="BaseResultMap" type="com.ruoyi.project.hit.domain.CardGameRule">
|
||||
<id property="id" column="id" jdbcType="INTEGER"/>
|
||||
<result property="gameid" column="gameid" jdbcType="INTEGER"/>
|
||||
<result property="levelid" column="levelid" jdbcType="INTEGER"/>
|
||||
<result property="enterCount" column="enter_count" jdbcType="INTEGER"/>
|
||||
<result property="hitCount" column="hit_count" jdbcType="INTEGER"/>
|
||||
</resultMap>
|
||||
|
||||
<sql id="Base_Column_List">
|
||||
id,gameid,levelid,
|
||||
enter_count,hit_count
|
||||
</sql>
|
||||
<select id="getGameRuleListByGameId" resultType="java.util.HashMap">
|
||||
SELECT
|
||||
card_game_rule.enter_count enterCount,
|
||||
card_game_rule.hit_count hitCount,
|
||||
card_game_rule.id,
|
||||
system_dict.dict_value dictValue
|
||||
FROM
|
||||
card_game_rule
|
||||
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>
|
||||
</mapper>
|
20
src/main/resources/mybatis/hit/CardProductMapper.xml
Normal file
20
src/main/resources/mybatis/hit/CardProductMapper.xml
Normal file
@ -0,0 +1,20 @@
|
||||
<?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.CardProductMapper">
|
||||
|
||||
<resultMap id="BaseResultMap" type="com.ruoyi.project.hit.domain.CardProduct">
|
||||
<id property="id" column="id" jdbcType="INTEGER"/>
|
||||
<result property="pname" column="pname" jdbcType="VARCHAR"/>
|
||||
<result property="pic" column="pic" jdbcType="VARCHAR"/>
|
||||
<result property="content" column="content" jdbcType="VARCHAR"/>
|
||||
<result property="price" column="price" jdbcType="DECIMAL"/>
|
||||
<result property="delState" column="del_state" jdbcType="SMALLINT"/>
|
||||
</resultMap>
|
||||
|
||||
<sql id="Base_Column_List">
|
||||
id,pname,pic,
|
||||
content,price,del_state
|
||||
</sql>
|
||||
</mapper>
|
100
src/main/resources/mybatis/hit/CardUserHitMapper.xml
Normal file
100
src/main/resources/mybatis/hit/CardUserHitMapper.xml
Normal file
@ -0,0 +1,100 @@
|
||||
<?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.CardUserHitMapper">
|
||||
|
||||
<resultMap id="BaseResultMap" type="com.ruoyi.project.hit.domain.CardUserHit">
|
||||
<id property="id" column="id" jdbcType="INTEGER"/>
|
||||
<result property="gameid" column="gameid" jdbcType="INTEGER"/>
|
||||
<result property="userid" column="userid" jdbcType="INTEGER"/>
|
||||
<result property="productid" column="productid" jdbcType="INTEGER"/>
|
||||
<result property="hittime" column="hittime" jdbcType="TIMESTAMP"/>
|
||||
</resultMap>
|
||||
|
||||
<sql id="Base_Column_List">
|
||||
id,gameid,userid,
|
||||
productid,hittime
|
||||
</sql>
|
||||
|
||||
<select id="selectCardUserHitInfo" resultType="java.util.HashMap">
|
||||
SELECT cg.id,cg.title,cg.start_time startTime,cg.end_time endTime,sd.dict_value dictValue,IFNULL(t1.sumCount,0) sumCount,IFNULL(t2.hitCount,0) hitCount
|
||||
from card_game cg
|
||||
INNER JOIN system_dict sd
|
||||
on cg.type=sd.dict_key and sd.dict_type='gametype'
|
||||
LEFT JOIN (SELECT cgp.gameid,SUM(cgp.amount) sumCount
|
||||
from card_game_product cgp
|
||||
GROUP BY cgp.gameid) t1
|
||||
on cg.id=t1.gameid
|
||||
LEFT JOIN (SELECT cuh.gameid,COUNT(*) hitCount
|
||||
from card_user_hit cuh
|
||||
GROUP BY cuh.gameid) t2
|
||||
on cg.id=t2.gameid
|
||||
<where>
|
||||
<if test="title!=null and title!=''">
|
||||
cg.title LIKE CONCAT('%',#{title},'%')
|
||||
</if>
|
||||
<if test="startTime!=null and endTime!=null">
|
||||
and cg.start_time>=#{startTime} and cg.end_time <=#{endTime}
|
||||
</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
|
||||
INNER JOIN card_product cp on cgp.productid=cp.id
|
||||
LEFT JOIN (select cuh.productid,count(*) cn
|
||||
from card_user_hit cuh
|
||||
WHERE cuh.gameid=#{gameid}
|
||||
GROUP BY cuh.productid) t1 on cp.id=t1.productid
|
||||
where cgp.gameid=#{gameid}
|
||||
|
||||
</select>
|
||||
|
||||
<select id="selectCardUserHitList" resultType="java.util.HashMap">
|
||||
SELECT
|
||||
card_game.title,
|
||||
card_product.pname,
|
||||
card_product.price,
|
||||
d1.dict_value `level`,
|
||||
card_user.user_name userName,
|
||||
card_user.realname,
|
||||
d2.dict_value types,
|
||||
card_user.phone,
|
||||
card_user.id_card idCard,
|
||||
card_user_hit.hittime
|
||||
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
|
||||
INNER JOIN system_dict d2 ON card_game.type = d2.dict_key
|
||||
AND d2.dict_type = 'gametype'
|
||||
INNER JOIN card_user ON card_user_hit.userid = card_user.id
|
||||
INNER JOIN system_dict d1 ON card_user.`level` = d1.dict_key
|
||||
AND d1.dict_type = 'userlevel'
|
||||
<where>
|
||||
<if test="title!=null and title!=''">
|
||||
and card_game.title LIKE CONCAT('%',#{title},'%')
|
||||
</if>
|
||||
<if test="username!=null and username!=''">
|
||||
and card_user.user_name LIKE CONCAT('%',#{username},'%')
|
||||
</if>
|
||||
<if test="phone!=null and phone!=''">
|
||||
and card_user.phone LIKE CONCAT('%',#{phone},'%')
|
||||
</if>
|
||||
<if test="pname!=null and pname!=''">
|
||||
and card_product.pname LIKE CONCAT('%',#{pname},'%')
|
||||
</if>
|
||||
<if test="startTime!=null and endTime!=null">
|
||||
and card_user_hit.hittime between #{startTime} and #{endTime}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
</mapper>
|
54
src/main/resources/mybatis/hit/CardUserMapper.xml
Normal file
54
src/main/resources/mybatis/hit/CardUserMapper.xml
Normal file
@ -0,0 +1,54 @@
|
||||
<?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.CardUserMapper">
|
||||
|
||||
<resultMap id="BaseResultMap" type="com.ruoyi.project.hit.domain.CardUser">
|
||||
<id property="id" column="id" jdbcType="INTEGER"/>
|
||||
<result property="userName" column="user_name" jdbcType="VARCHAR"/>
|
||||
<result property="userPass" column="user_pass" jdbcType="VARCHAR"/>
|
||||
<result property="pic" column="pic" jdbcType="VARCHAR"/>
|
||||
<result property="realname" column="realname" jdbcType="VARCHAR"/>
|
||||
<result property="idCard" column="id_card" jdbcType="VARCHAR"/>
|
||||
<result property="phone" column="phone" jdbcType="VARCHAR"/>
|
||||
<result property="level" column="level" jdbcType="SMALLINT"/>
|
||||
<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"/>
|
||||
</resultMap>
|
||||
|
||||
<sql id="Base_Column_List">
|
||||
id
|
||||
,user_name,user_pass,
|
||||
pic,realname,id_card,
|
||||
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
|
||||
where u.`level`=d.`dict_key` and d.dict_type='userlevel'
|
||||
<if test="userName!=null and userName!=''">
|
||||
and u.user_name like CONCAT('%',#{userName},'%')
|
||||
</if>
|
||||
<if test="realname!=null and realname!=''">
|
||||
and u.realname like CONCAT('%',#{realname},'%')
|
||||
</if>
|
||||
<if test="idCard!=null and idCard!=''">
|
||||
and u.id_card like CONCAT('%',#{idCard},'%')
|
||||
</if>
|
||||
<if test="phone!=null and phone!=''">
|
||||
and u.phone like CONCAT('%',#{phone},'%')
|
||||
</if>
|
||||
<if test="level!=null and level!=''">
|
||||
and u.`level`=#{level}
|
||||
</if>
|
||||
<if test="startTime!=null and endTime!=null">
|
||||
AND u.create_time BETWEEN #{startTime} and #{endTime}
|
||||
</if>
|
||||
|
||||
|
||||
</select>
|
||||
</mapper>
|
22
src/main/resources/mybatis/hit/SystemDictMapper.xml
Normal file
22
src/main/resources/mybatis/hit/SystemDictMapper.xml
Normal file
@ -0,0 +1,22 @@
|
||||
<?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.SystemDictMapper">
|
||||
|
||||
<resultMap id="BaseResultMap" type="com.ruoyi.project.hit.domain.SystemDict">
|
||||
<id property="id" column="id" jdbcType="INTEGER"/>
|
||||
<result property="dictType" column="dict_type" jdbcType="VARCHAR"/>
|
||||
<result property="dictKey" column="dict_key" jdbcType="VARCHAR"/>
|
||||
<result property="dictValue" column="dict_value" jdbcType="VARCHAR"/>
|
||||
<result property="delState" column="del_state" jdbcType="SMALLINT"/>
|
||||
<result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
|
||||
<result property="updateTime" column="update_time" jdbcType="TIMESTAMP"/>
|
||||
</resultMap>
|
||||
|
||||
<sql id="Base_Column_List">
|
||||
id,dict_type,dict_key,
|
||||
dict_value,del_state,create_time,
|
||||
update_time
|
||||
</sql>
|
||||
</mapper>
|
Reference in New Issue
Block a user