| 1234567891011121314151617181920212223 |
- <?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接口和XML文件关联的时候,namespace的值就需要配置成接口的全限定名称 -->
- <mapper namespace="top.lvzhiqiang.mapper.VideoInfoMapper">
- <select id="getVideoInfoList" resultType="top.lvzhiqiang.entity.VideoInfo">
- select vi.*, IFNULL(vio.score, 0) AS score
- from video_info vi
- left join video_info_other vio on vi.identification_code = vio.identification_code and vio.delete_flag = 1
- where vi.delete_flag = 1
- <if test="keyword != null and keyword != ''">
- and (vi.name like #{keyword} or vi.identification_code like #{keyword})
- </if>
- <if test="genres != null and genres != ''">
- and exists(select 1 from video_info_genres vig where vig.name = #{genres} and vig.identification_code = vi.identification_code)
- </if>
- <if test="cast != null and cast != ''">
- and exists(select 1 from video_info_cast vic where vic.name = #{cast} and vic.identification_code = vi.identification_code)
- </if>
- </select>
- </mapper>
|