| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152 |
- <?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="cn.reghao.tnb.content.app.vod.db.mapper.PostItemMapper">
- <insert id="save" useGeneratedKeys="true" keyProperty="id">
- insert into vod_post_item
- (`album_id`,`post_id`,`pos`,`channel_code`,`object_id`,`format`,`url`,`width`,`height`,`horizontal`)
- values
- (#{albumId},#{postId},#{pos},#{channelCode},#{objectId},#{format},#{url},#{width},#{height},#{horizontal})
- </insert>
- <insert id="saveAll" useGeneratedKeys="true" keyProperty="id">
- insert into vod_post_item
- (`album_id`,`post_id`,`pos`,`channel_code`,`object_id`,`format`,`url`,`width`,`height`,`horizontal`)
- values
- <foreach collection="list" item="item" index="index" separator=",">
- (#{item.albumId},#{item.postId},#{item.pos},#{item.channelCode},#{item.objectId},#{item.format},#{item.url},#{item.width},#{item.height},#{item.horizontal})
- </foreach>
- </insert>
- <delete id="deleteByAlbumIdAndPostId">
- delete from vod_post_item
- where album_id=#{albumId} and post_id=#{postId}
- </delete>
- <select id="countByAlbumId" resultType="java.lang.Integer">
- select count(*)
- from vod_post_item
- where album_id=#{albumId}
- </select>
- <select id="findByAlbumIdByPage" resultType="cn.reghao.tnb.content.app.vod.model.po.PostItem">
- select *
- from vod_post_item
- where album_id=#{albumId}
- </select>
- <select id="findByImagePost" resultType="cn.reghao.tnb.content.app.vod.model.po.PostItem">
- select *
- from vod_post_item
- where album_id in
- (
- select album_id
- from vod_post_album
- where post_type=1 and create_by=#{createBy}
- )
- and object_id=#{imageFileId}
- </select>
- <select id="findByUrl" resultType="cn.reghao.tnb.content.app.vod.model.po.PostItem">
- select *
- from vod_post_item
- where url=#{url}
- limit 1
- </select>
- </mapper>
|