VideoInfoMapper.xml 1.2 KB

1234567891011121314151617181920212223
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
  3. "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
  4. <!-- 当Mapper接口和XML文件关联的时候,namespace的值就需要配置成接口的全限定名称 -->
  5. <mapper namespace="top.lvzhiqiang.mapper.VideoInfoMapper">
  6. <select id="getVideoInfoList" resultType="top.lvzhiqiang.entity.VideoInfo">
  7. select vi.*, IFNULL(vio.score, 0) AS score
  8. from video_info vi
  9. left join video_info_other vio on vi.identification_code = vio.identification_code and vio.delete_flag = 1
  10. where vi.delete_flag = 1
  11. <if test="keyword != null and keyword != ''">
  12. and (vi.name like #{keyword} or vi.identification_code like #{keyword})
  13. </if>
  14. <if test="genres != null and genres != ''">
  15. and exists(select 1 from video_info_genres vig where vig.name = #{genres} and vig.identification_code = vi.identification_code)
  16. </if>
  17. <if test="cast != null and cast != ''">
  18. and exists(select 1 from video_info_cast vic where vic.name = #{cast} and vic.identification_code = vi.identification_code)
  19. </if>
  20. </select>
  21. </mapper>