You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
76 lines
3.4 KiB
76 lines
3.4 KiB
<?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.BVideoAllowMapper"> |
|
|
|
<resultMap type="BVideoAllow" id="BVideoAllowResult"> |
|
<result property="id" column="id" /> |
|
<result property="allowId" column="allow_id" /> |
|
<result property="wxOpenid" column="wx_openid" /> |
|
<result property="wxNickname" column="wx_nickname" /> |
|
<result property="gmtCreate" column="gmt_create" /> |
|
<result property="videoId" column="video_id" /> |
|
</resultMap> |
|
|
|
<sql id="selectBVideoAllowVo"> |
|
select id, allow_id, wx_openid, wx_nickname, gmt_create, video_id from b_video_allow |
|
</sql> |
|
|
|
<select id="selectBVideoAllowList" parameterType="BVideoAllow" resultMap="BVideoAllowResult"> |
|
<include refid="selectBVideoAllowVo"/> |
|
<where> |
|
<if test="allowId != null and allowId != ''"> and allow_id = #{allowId}</if> |
|
<if test="wxOpenid != null and wxOpenid != ''"> and wx_openid = #{wxOpenid}</if> |
|
<if test="wxNickname != null and wxNickname != ''"> and wx_nickname like concat('%', #{wxNickname}, '%')</if> |
|
<if test="gmtCreate != null "> and gmt_create = #{gmtCreate}</if> |
|
<if test="videoId != null "> and video_id = #{videoId}</if> |
|
</where> |
|
</select> |
|
|
|
<select id="selectBVideoAllowById" parameterType="Long" resultMap="BVideoAllowResult"> |
|
<include refid="selectBVideoAllowVo"/> |
|
where id = #{id} |
|
</select> |
|
|
|
<insert id="insertBVideoAllow" parameterType="BVideoAllow" useGeneratedKeys="true" keyProperty="id"> |
|
insert into b_video_allow |
|
<trim prefix="(" suffix=")" suffixOverrides=","> |
|
<if test="allowId != null">allow_id,</if> |
|
<if test="wxOpenid != null">wx_openid,</if> |
|
<if test="wxNickname != null">wx_nickname,</if> |
|
<if test="gmtCreate != null">gmt_create,</if> |
|
<if test="videoId != null">video_id,</if> |
|
</trim> |
|
<trim prefix="values (" suffix=")" suffixOverrides=","> |
|
<if test="allowId != null">#{allowId},</if> |
|
<if test="wxOpenid != null">#{wxOpenid},</if> |
|
<if test="wxNickname != null">#{wxNickname},</if> |
|
<if test="gmtCreate != null">#{gmtCreate},</if> |
|
<if test="videoId != null">#{videoId},</if> |
|
</trim> |
|
</insert> |
|
|
|
<update id="updateBVideoAllow" parameterType="BVideoAllow"> |
|
update b_video_allow |
|
<trim prefix="SET" suffixOverrides=","> |
|
<if test="allowId != null">allow_id = #{allowId},</if> |
|
<if test="wxOpenid != null">wx_openid = #{wxOpenid},</if> |
|
<if test="wxNickname != null">wx_nickname = #{wxNickname},</if> |
|
<if test="gmtCreate != null">gmt_create = #{gmtCreate},</if> |
|
<if test="videoId != null">video_id = #{videoId},</if> |
|
</trim> |
|
where id = #{id} |
|
</update> |
|
|
|
<delete id="deleteBVideoAllowById" parameterType="Long"> |
|
delete from b_video_allow where id = #{id} |
|
</delete> |
|
|
|
<delete id="deleteBVideoAllowByIds" parameterType="String"> |
|
delete from b_video_allow where id in |
|
<foreach item="id" collection="array" open="(" separator="," close=")"> |
|
#{id} |
|
</foreach> |
|
</delete> |
|
</mapper> |