<?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.system.mapper.config.PopMapper">
|
|
<resultMap type="Pop" id="PopResult">
|
<result property="popId" column="pop_id" />
|
<result property="delFlag" column="del_flag" />
|
<result property="popSort" column="pop_sort" />
|
<result property="popUrl" column="pop_url" />
|
<result property="showStartTime" column="show_start_time" />
|
<result property="showEndTime" column="show_end_time" />
|
<result property="targetType" column="target_type" />
|
<result property="linkUrl" column="link_url" />
|
<result property="jumpId" column="jump_id" />
|
<result property="createTime" column="create_time" />
|
<result property="createUserId" column="create_user_id" />
|
</resultMap>
|
|
<sql id="selectPopVo">
|
select pop_id, del_flag, pop_sort, pop_url, show_start_time, show_end_time, target_type, link_url, jump_id, create_time, create_user_id from t_pop
|
</sql>
|
|
<select id="selectPopList" parameterType="Pop" resultMap="PopResult">
|
<include refid="selectPopVo"/>
|
<where>
|
<if test="popSort != null "> and pop_sort = #{popSort}</if>
|
<if test="popUrl != null and popUrl != ''"> and pop_url = #{popUrl}</if>
|
<if test="showStartTime != null "> and show_start_time = #{showStartTime}</if>
|
<if test="showEndTime != null "> and show_end_time = #{showEndTime}</if>
|
<if test="targetType != null "> and target_type = #{targetType}</if>
|
<if test="linkUrl != null and linkUrl != ''"> and link_url = #{linkUrl}</if>
|
<if test="jumpId != null and jumpId != ''"> and jump_id = #{jumpId}</if>
|
<if test="createUserId != null "> and create_user_id = #{createUserId}</if>
|
</where>
|
</select>
|
|
<select id="selectPopByPopId" parameterType="Long" resultMap="PopResult">
|
<include refid="selectPopVo"/>
|
where pop_id = #{popId}
|
</select>
|
|
<insert id="insertPop" parameterType="Pop" useGeneratedKeys="true" keyProperty="popId">
|
insert into t_pop
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
<if test="delFlag != null">del_flag,</if>
|
<if test="popSort != null">pop_sort,</if>
|
<if test="popUrl != null">pop_url,</if>
|
<if test="showStartTime != null">show_start_time,</if>
|
<if test="showEndTime != null">show_end_time,</if>
|
<if test="targetType != null">target_type,</if>
|
<if test="linkUrl != null">link_url,</if>
|
<if test="jumpId != null">jump_id,</if>
|
<if test="createTime != null">create_time,</if>
|
<if test="createUserId != null">create_user_id,</if>
|
</trim>
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
<if test="delFlag != null">#{delFlag},</if>
|
<if test="popSort != null">#{popSort},</if>
|
<if test="popUrl != null">#{popUrl},</if>
|
<if test="showStartTime != null">#{showStartTime},</if>
|
<if test="showEndTime != null">#{showEndTime},</if>
|
<if test="targetType != null">#{targetType},</if>
|
<if test="linkUrl != null">#{linkUrl},</if>
|
<if test="jumpId != null">#{jumpId},</if>
|
<if test="createTime != null">#{createTime},</if>
|
<if test="createUserId != null">#{createUserId},</if>
|
</trim>
|
</insert>
|
|
<update id="updatePop" parameterType="Pop">
|
update t_pop
|
<trim prefix="SET" suffixOverrides=",">
|
<if test="delFlag != null">del_flag = #{delFlag},</if>
|
<if test="popSort != null">pop_sort = #{popSort},</if>
|
<if test="popUrl != null">pop_url = #{popUrl},</if>
|
<if test="showStartTime != null">show_start_time = #{showStartTime},</if>
|
<if test="showEndTime != null">show_end_time = #{showEndTime},</if>
|
<if test="targetType != null">target_type = #{targetType},</if>
|
<if test="linkUrl != null">link_url = #{linkUrl},</if>
|
<if test="jumpId != null">jump_id = #{jumpId},</if>
|
<if test="createTime != null">create_time = #{createTime},</if>
|
<if test="createUserId != null">create_user_id = #{createUserId},</if>
|
</trim>
|
where pop_id = #{popId}
|
</update>
|
|
<delete id="deletePopByPopId" parameterType="Long">
|
delete from t_pop where pop_id = #{popId}
|
</delete>
|
|
<delete id="deletePopByPopIds" parameterType="String">
|
delete from t_pop where pop_id in
|
<foreach item="popId" collection="array" open="(" separator="," close=")">
|
#{popId}
|
</foreach>
|
</delete>
|
|
<select id="pageMgtPop" resultType="com.ruoyi.system.domain.vo.MgtPopPageVo">
|
SELECT
|
pop_id popId,
|
pop_url popUrl,
|
CASE target_type
|
WHEN 1 THEN "外链"
|
WHEN 2 THEN "内链"
|
ELSE "无"
|
END targetType,
|
show_start_time showStartTime,
|
show_end_time showEndTime,
|
create_time createTime
|
FROM t_pop
|
WHERE del_flag = 0
|
ORDER BY create_time DESC
|
</select>
|
|
<select id="getAppPop" resultType="com.ruoyi.system.domain.vo.AppPopVo">
|
SELECT
|
pop_id popId,
|
pop_url popUrl,
|
link_type linkType,
|
target_type targetType,
|
link_url linkUrl,
|
jump_type jumpType,
|
jump_id jumpId
|
FROM t_pop
|
WHERE del_flag = 0 AND CURDATE() BETWEEN show_start_time AND show_end_time
|
ORDER BY pop_sort,create_time DESC LIMIT 1
|
</select>
|
</mapper>
|