2025-02-11 15:27:15 +08:00
|
|
|
<?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.ff.game.mapper.GameMapper">
|
|
|
|
|
|
|
|
<resultMap type="Game" id="GameResult">
|
|
|
|
<result property="id" column="id" />
|
|
|
|
<result property="sortNo" column="sort_no" />
|
|
|
|
<result property="gameCode" column="game_code" />
|
2025-03-12 17:55:57 +08:00
|
|
|
<result property="ingress" column="ingress" />
|
2025-02-11 15:27:15 +08:00
|
|
|
<result property="gameSourceType" column="game_source_type" />
|
|
|
|
<result property="gameName" column="game_name" />
|
2025-04-11 18:14:42 +08:00
|
|
|
<result property="nameInfo" column="name_info" typeHandler="com.ff.base.handler.JsonListHandler" javaType="java.util.List" />
|
2025-04-08 17:12:40 +08:00
|
|
|
<result property="gameId" column="game_id" />
|
|
|
|
<result property="platformCode" column="platform_code" />
|
|
|
|
<result property="platformType" column="platform_type" />
|
2025-02-11 15:27:15 +08:00
|
|
|
<result property="freespin" column="freespin" />
|
|
|
|
<result property="demoStatus" column="demo_status" />
|
|
|
|
<result property="stopStatus" column="stop_status" />
|
|
|
|
<result property="createBy" column="create_by" />
|
|
|
|
<result property="createTime" column="create_time" />
|
|
|
|
<result property="updateBy" column="update_by" />
|
|
|
|
<result property="updateTime" column="update_time" />
|
|
|
|
</resultMap>
|
|
|
|
|
|
|
|
<sql id="selectGameVo">
|
2025-04-08 17:12:40 +08:00
|
|
|
select id, sort_no, game_code,ingress, game_source_type, game_name, freespin, demo_status, stop_status, create_by, create_time, update_by, update_time, name_info, game_id, platform_code, platform_type from ff_game
|
2025-02-11 15:27:15 +08:00
|
|
|
</sql>
|
|
|
|
|
2025-03-12 17:55:57 +08:00
|
|
|
|
2025-03-14 13:31:17 +08:00
|
|
|
|
2025-03-12 17:55:57 +08:00
|
|
|
|
2025-02-11 15:27:15 +08:00
|
|
|
<select id="selectGameList" parameterType="Game" resultMap="GameResult">
|
|
|
|
<include refid="selectGameVo"/>
|
|
|
|
<where>
|
|
|
|
<if test="sortNo != null "> and sort_no = #{sortNo}</if>
|
|
|
|
<if test="gameCode != null "> and game_code = #{gameCode}</if>
|
2025-03-12 17:55:57 +08:00
|
|
|
<if test="ingress != null "> and ingress = #{ingress}</if>
|
2025-02-11 15:27:15 +08:00
|
|
|
<if test="gameSourceType != null "> and game_source_type = #{gameSourceType}</if>
|
|
|
|
<if test="gameName != null and gameName != ''"> and game_name like concat('%', #{gameName}, '%')</if>
|
|
|
|
<if test="freespin != null "> and freespin = #{freespin}</if>
|
|
|
|
<if test="demoStatus != null "> and demo_status = #{demoStatus}</if>
|
|
|
|
<if test="stopStatus != null "> and stop_status = #{stopStatus}</if>
|
2025-04-07 10:15:35 +08:00
|
|
|
<if test="platformCode != null "> and platform_code = #{platformCode}</if>
|
|
|
|
<if test="platformType != null "> and platform_type = #{platformType}</if>
|
|
|
|
|
2025-02-11 15:27:15 +08:00
|
|
|
</where>
|
|
|
|
</select>
|
2025-03-14 13:31:17 +08:00
|
|
|
|
|
|
|
<select id="selectGameDTOList" parameterType="com.ff.game.dto.GameDTO" resultMap="GameResult">
|
|
|
|
select g.id,
|
|
|
|
g.sort_no,
|
|
|
|
g.game_code,
|
|
|
|
g.ingress,
|
|
|
|
g.game_source_type,
|
|
|
|
g.game_name,
|
|
|
|
g.freespin,
|
|
|
|
g.demo_status,
|
|
|
|
g.stop_status,
|
|
|
|
g.create_by,
|
|
|
|
g.create_time,
|
|
|
|
g.update_by,
|
|
|
|
g.update_time
|
|
|
|
from ff_game g
|
|
|
|
|
|
|
|
|
|
|
|
<where>
|
|
|
|
<if test="sortNo != null "> and g.sort_no = #{sortNo}</if>
|
|
|
|
<if test="gameCode != null "> and g.game_code = #{gameCode}</if>
|
|
|
|
<if test="ingress != null "> and g.ingress = #{ingress}</if>
|
|
|
|
<if test="gameSourceType != null "> and g.game_source_type = #{gameSourceType}</if>
|
2025-04-08 17:12:40 +08:00
|
|
|
<if test="gameName != null and gameName != ''"> and name_info like concat('%', #{gameName}, '%')</if>
|
2025-03-14 13:31:17 +08:00
|
|
|
<if test="freespin != null "> and g.freespin = #{freespin}</if>
|
|
|
|
<if test="demoStatus != null "> and g.demo_status = #{demoStatus}</if>
|
|
|
|
<if test="stopStatus != null "> and g.stop_status = #{stopStatus}</if>
|
2025-04-08 17:12:40 +08:00
|
|
|
<if test="platformCode != null and platformCode != ''"> and g.platform_code = #{platformCode}</if>
|
2025-03-14 13:31:17 +08:00
|
|
|
</where>
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
|
|
|
2025-02-11 15:27:15 +08:00
|
|
|
|
|
|
|
<select id="selectGameById" parameterType="Long" resultMap="GameResult">
|
|
|
|
<include refid="selectGameVo"/>
|
|
|
|
where id = #{id}
|
|
|
|
</select>
|
|
|
|
|
2025-04-08 17:12:40 +08:00
|
|
|
<select id="selectGameByGameId" resultMap="GameResult">
|
|
|
|
<include refid="selectGameVo"/>
|
|
|
|
where game_id = #{gameId}
|
|
|
|
</select>
|
|
|
|
|
2025-02-11 15:27:15 +08:00
|
|
|
<insert id="insertGame" parameterType="Game" useGeneratedKeys="true" keyProperty="id">
|
|
|
|
insert into ff_game
|
2025-02-25 10:05:13 +08:00
|
|
|
<trim prefix="(" suffix=")" suffixOverrides=","><if test="id != null">id,</if>
|
2025-02-11 15:27:15 +08:00
|
|
|
<if test="sortNo != null">sort_no,</if>
|
|
|
|
<if test="gameCode != null">game_code,</if>
|
2025-03-12 17:55:57 +08:00
|
|
|
<if test="ingress != null">ingress,</if>
|
2025-02-11 15:27:15 +08:00
|
|
|
<if test="gameSourceType != null">game_source_type,</if>
|
|
|
|
<if test="gameName != null and gameName != ''">game_name,</if>
|
|
|
|
<if test="freespin != null">freespin,</if>
|
|
|
|
<if test="demoStatus != null">demo_status,</if>
|
|
|
|
<if test="stopStatus != null">stop_status,</if>
|
|
|
|
<if test="createBy != null">create_by,</if>
|
|
|
|
<if test="createTime != null">create_time,</if>
|
|
|
|
<if test="updateBy != null">update_by,</if>
|
|
|
|
<if test="updateTime != null">update_time,</if>
|
2025-04-08 17:12:40 +08:00
|
|
|
<if test="nameInfo != null ">name_info,</if>
|
|
|
|
<if test="gameId != null and gameId != ''">game_id,</if>
|
|
|
|
<if test="platformCode != null and platformCode != ''">platform_code,</if>
|
|
|
|
<if test="platformType != null and platformType != ''">platform_type,</if>
|
2025-02-11 15:27:15 +08:00
|
|
|
</trim>
|
2025-02-25 10:05:13 +08:00
|
|
|
<trim prefix="values (" suffix=")" suffixOverrides=","> <if test="id != null">#{id},</if>
|
2025-02-11 15:27:15 +08:00
|
|
|
<if test="sortNo != null">#{sortNo},</if>
|
|
|
|
<if test="gameCode != null">#{gameCode},</if>
|
2025-03-12 17:55:57 +08:00
|
|
|
<if test="ingress != null">#{ingress},</if>
|
2025-02-11 15:27:15 +08:00
|
|
|
<if test="gameSourceType != null">#{gameSourceType},</if>
|
|
|
|
<if test="gameName != null and gameName != ''">#{gameName},</if>
|
|
|
|
<if test="freespin != null">#{freespin},</if>
|
|
|
|
<if test="demoStatus != null">#{demoStatus},</if>
|
|
|
|
<if test="stopStatus != null">#{stopStatus},</if>
|
|
|
|
<if test="createBy != null">#{createBy},</if>
|
|
|
|
<if test="createTime != null">#{createTime},</if>
|
|
|
|
<if test="updateBy != null">#{updateBy},</if>
|
|
|
|
<if test="updateTime != null">#{updateTime},</if>
|
2025-04-08 17:12:40 +08:00
|
|
|
<if test="nameInfo != null">#{nameInfo, typeHandler=com.ff.base.handler.JsonListHandler,javaType=com.ff.game.domain.NameInfo},</if>
|
|
|
|
<if test="gameId != null and gameId != ''">#{gameId},</if>
|
|
|
|
<if test="platformCode != null and platformCode != ''">#{platformCode},</if>
|
|
|
|
<if test="platformType != null and platformType != ''">#{platformType},</if>
|
2025-02-11 15:27:15 +08:00
|
|
|
</trim>
|
|
|
|
</insert>
|
|
|
|
|
|
|
|
<update id="updateGame" parameterType="Game">
|
|
|
|
update ff_game
|
|
|
|
<trim prefix="SET" suffixOverrides=",">
|
|
|
|
<if test="sortNo != null">sort_no = #{sortNo},</if>
|
|
|
|
<if test="gameCode != null">game_code = #{gameCode},</if>
|
2025-03-12 17:55:57 +08:00
|
|
|
<if test="ingress != null">ingress = #{ingress},</if>
|
2025-02-11 15:27:15 +08:00
|
|
|
<if test="gameSourceType != null">game_source_type = #{gameSourceType},</if>
|
|
|
|
<if test="gameName != null and gameName != ''">game_name = #{gameName},</if>
|
|
|
|
<if test="freespin != null">freespin = #{freespin},</if>
|
|
|
|
<if test="demoStatus != null">demo_status = #{demoStatus},</if>
|
|
|
|
<if test="stopStatus != null">stop_status = #{stopStatus},</if>
|
|
|
|
<if test="createBy != null">create_by = #{createBy},</if>
|
|
|
|
<if test="createTime != null">create_time = #{createTime},</if>
|
|
|
|
<if test="updateBy != null">update_by = #{updateBy},</if>
|
|
|
|
<if test="updateTime != null">update_time = #{updateTime},</if>
|
2025-04-08 17:12:40 +08:00
|
|
|
<if test="nameInfo != null">name_info = #{nameInfo, typeHandler=com.ff.base.handler.JsonListHandler,javaType=com.ff.game.domain.NameInfo},</if>
|
|
|
|
<if test="gameId != null and gameId != ''">game_id = #{gameId},</if>
|
|
|
|
<if test="platformCode != null and platformCode != ''">platform_code = #{platformCode},</if>
|
|
|
|
<if test="platformType != null and platformType != ''">platform_type = #{platformType},</if>
|
2025-02-11 15:27:15 +08:00
|
|
|
</trim>
|
|
|
|
where id = #{id}
|
|
|
|
</update>
|
|
|
|
|
|
|
|
<delete id="deleteGameById" parameterType="Long">
|
|
|
|
delete from ff_game where id = #{id}
|
|
|
|
</delete>
|
|
|
|
|
|
|
|
<delete id="deleteGameByIds" parameterType="String">
|
|
|
|
delete from ff_game where id in
|
|
|
|
<foreach item="id" collection="array" open="(" separator="," close=")">
|
|
|
|
#{id}
|
|
|
|
</foreach>
|
|
|
|
</delete>
|
|
|
|
|
|
|
|
|
2025-04-08 17:12:40 +08:00
|
|
|
|
2025-02-11 15:27:15 +08:00
|
|
|
|
2025-04-07 10:15:35 +08:00
|
|
|
<select id="selectMaxSortNoBy" resultType="java.lang.Integer">
|
|
|
|
select ifnull(max(sort_no), 0)
|
|
|
|
from ff_game
|
|
|
|
where platform_type = #{platformType} and platform_code = #{platformCode}
|
|
|
|
</select>
|
2025-02-17 11:28:17 +08:00
|
|
|
<resultMap id="GameResponseResultMap" type="com.ff.api.response.GameResponse">
|
2025-04-08 17:12:40 +08:00
|
|
|
<result property="id" column="game_id"/>
|
2025-02-17 11:28:17 +08:00
|
|
|
<result property="gameName" column="game_name"/>
|
|
|
|
<result property="freeSpin" column="freespin"/>
|
|
|
|
<result property="demoStatus" column="demo_status"/>
|
|
|
|
<result property="platformType" column="platform_type"/>
|
2025-04-08 17:12:40 +08:00
|
|
|
<result property="platformCode" column="platform_code"/>
|
2025-03-12 17:55:57 +08:00
|
|
|
<result property="ingress" column="ingress"/>
|
2025-04-11 18:14:42 +08:00
|
|
|
<result property="nameInfo" column="name_info" typeHandler="com.ff.base.handler.JsonHandler" javaType="java.util.List" />
|
2025-03-12 17:55:57 +08:00
|
|
|
|
2025-02-17 11:28:17 +08:00
|
|
|
</resultMap>
|
|
|
|
|
|
|
|
|
|
|
|
<select id="selectGameResponseList" resultMap="GameResponseResultMap">
|
|
|
|
select
|
2025-04-08 17:12:40 +08:00
|
|
|
g.game_id,
|
2025-02-17 11:28:17 +08:00
|
|
|
g.game_name,
|
|
|
|
g.freespin,
|
|
|
|
g.demo_status,
|
2025-03-12 17:55:57 +08:00
|
|
|
g.ingress,
|
2025-04-08 17:12:40 +08:00
|
|
|
g.platform_type,
|
|
|
|
g.platform_code,
|
|
|
|
g.name_info
|
2025-02-17 11:28:17 +08:00
|
|
|
from ff_game g
|
2025-04-08 17:12:40 +08:00
|
|
|
where g.stop_status=1
|
2025-02-17 11:28:17 +08:00
|
|
|
</select>
|
|
|
|
|
2025-02-11 15:27:15 +08:00
|
|
|
|
|
|
|
|
2025-03-12 17:55:57 +08:00
|
|
|
|
|
|
|
|
2025-03-14 13:31:17 +08:00
|
|
|
|
2025-02-11 15:27:15 +08:00
|
|
|
<select id="selectGameUniqueList" parameterType="com.ff.game.api.request.GameUniqueDTO" resultMap="GameResult">
|
|
|
|
<include refid="selectGameVo"/>
|
|
|
|
<where>
|
|
|
|
<if test="sortNo != null "> and sort_no = #{sortNo}</if>
|
|
|
|
<if test="gameCode != null "> and game_code = #{gameCode}</if>
|
2025-03-12 17:55:57 +08:00
|
|
|
<if test="ingress != null "> and ingress = #{ingress}</if>
|
2025-02-11 15:27:15 +08:00
|
|
|
<if test="gameSourceType != null "> and game_source_type = #{gameSourceType}</if>
|
|
|
|
<if test="gameName != null and gameName != ''"> and game_name like concat('%', #{gameName}, '%')</if>
|
|
|
|
<if test="freespin != null "> and freespin = #{freespin}</if>
|
|
|
|
<if test="demoStatus != null "> and demo_status = #{demoStatus}</if>
|
|
|
|
<if test="stopStatus != null "> and stop_status = #{stopStatus}</if>
|
|
|
|
<if test="gameIds != null and gameIds.size() >0 ">
|
|
|
|
and id in
|
|
|
|
<foreach item="gameId" collection="gameIds" open="(" separator="," close=")">
|
|
|
|
#{gameId}
|
|
|
|
</foreach>
|
|
|
|
</if>
|
|
|
|
</where>
|
|
|
|
</select>
|
|
|
|
</mapper>
|