| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153 |
- <?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.ytpm.dao.RiskManageMapper">
- <insert id="addDeblockingRecord">
- insert into yt_platform_deblocking
- (
- deblocking_id,
- banned_id,
- user_id,
- app_id,
- channel_id,
- deblocking_time,
- deblocking_reason,
- operator,
- operator_name
- )
- values
- (
- #{deblockingId},
- #{bannedId},
- #{userId},
- #{appId},
- #{channelId},
- #{deblockingTime},
- #{deblockingReason},
- #{operator},
- #{operatorName}
- )
- </insert>
- <insert id="relativeApps" parameterType="com.ytpm.risk.param.RiskRelativeAppParam">
- insert into yt_cofig_app
- (
- template_id,
- app_id,
- app_name,
- operator,
- operator_name,
- operator_time
- )
- values
- <foreach collection="appList" separator="," index="index" item="item">
- (
- #{templateId},
- #{item.appId},
- #{item.appName},
- #{operator},
- #{operatorName},
- now()
- )
- </foreach>
- </insert>
- <delete id="deleteRelatives">
- delete from yt_cofig_app where template_id = #{templateId}
- </delete>
- <select id="getDeblockingList" resultType="com.ytpm.risk.view.RiskDeblockingListView">
- SELECT
- pd.deblocking_id,
- pd.banned_id,
- pd.user_id,
- pd.channel_id,
- pd.deblocking_time,
- pd.deblocking_reason,
- pd.operator,
- pd.operator_name,
- a.app_id,
- a.app_name
- FROM
- yt_platform_deblocking pd
- JOIN yt_app a ON pd.app_id = a.app_id
- WHERE
- pd.channel_id = #{channelId}
- <if test="appId != null and appId != ''">
- and a.app_id = #{appId}
- </if>
- <if test="deblockingReason != null and deblockingReason != ''">
- and pd.deblocking_reason like concat('%',#{deblockingReason},'%')
- </if>
- <if test="deblockingTimeBegin != null">
- and DATE_FORMAT(pd.deblocking_time,'%Y-%m-%d') <![CDATA[>=]]> DATE_FORMAT(#{deblockingTimeBegin}, '%Y-%m-%d')
- </if>
- <if test="deblockingTimeEnd != null">
- and DATE_FORMAT(pd.deblocking_time,'%Y-%m-%d') <![CDATA[<=]]> DATE_FORMAT(#{deblockingTimeEnd}, '%Y-%m-%d')
- </if>
- ORDER BY pd.deblocking_time DESC
- </select>
- <select id="getBannedList" resultType="com.ytpm.risk.view.RiskBannedListView">
- SELECT
- pb.banned_id,
- # au.platform_id,
- # au.channel_id,
- # au.user_id,
- # au.nick_name,
- # au.registry_time,
- # au.last_login_ip,
- # au.last_login_time,
- # au.user_status,
- pb.banned_time,
- pb.banned_reason,
- # au.channel_type,
- # au.channel_origin,
- pb.banned_type,
- pb.banned_limit,
- pb.operator,
- pb.operator_name,
- pb.user_id,
- a.app_id,
- a.app_name
- FROM
- yt_platform_banned pb
- JOIN yt_app a ON pb.app_id = a.app_id
- WHERE
- pb.channel_id = #{channelId}
- <if test="appId != null and appId != ''">
- and a.app_id = #{appId}
- </if>
- <if test="bannedReason != null and bannedReason != ''">
- and pb.banned_reason like concat('%',#{bannedReason},'%')
- </if>
- <if test="bannedTimeBegin != null">
- and DATE_FORMAT(pb.banned_time,'%Y-%m-%d') <![CDATA[>=]]> DATE_FORMAT(#{bannedTimeBegin}, '%Y-%m-%d')
- </if>
- <if test="bannedTimeEnd != null">
- and DATE_FORMAT(pb.banned_time,'%Y-%m-%d') <![CDATA[<=]]> DATE_FORMAT(#{bannedTimeEnd}, '%Y-%m-%d')
- </if>
- ORDER BY pb.banned_time DESC
- </select>
- <select id="getLastBanned" resultType="com.ytpm.agent.model.YtPlatformBanned">
- select
- banned_id, user_id, channel_id, banned_time, banned_reason, banned_type, banned_limit, operator, operator_name
- from yt_platform_banned
- where user_id = #{userId}
- order by banned_time desc
- limit 1
- </select>
- <select id="queryBannedRecord" resultType="com.ytpm.agent.model.YtPlatformBanned">
- select
- banned_id, user_id, channel_id, banned_time, banned_reason, banned_type, banned_limit, operator, operator_name
- from yt_platform_banned
- <where>
- <if test="startTime != null">
- AND banned_time >= #{startTime}
- </if>
- <if test="endTime != null">
- AND banned_time <= #{endTime}
- </if>
- </where>
- </select>
- </mapper>
|