VideoInfoInfantryMapper.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.VideoInfoInfantryMapper">
  6. <select id="getVideoInfoInfantryList" resultType="top.lvzhiqiang.entity.VideoInfo">
  7. select vi.id,vi.name,vi.identification_code,vi.issue_date,vi.modify_time,vi.img_url,vi.video_url,concat_ws('||', vi.cast, vi.genres) main_who,IFNULL(vio.score, 0) AS score, IFNULL(vio.comment, '暂无评论') AS comment
  8. from video_info_infantry 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 vi.main_who = #{genres}
  16. </if>
  17. <if test="cast != null and cast != ''">
  18. and vi.cast like concat('%',#{cast},'%')
  19. </if>
  20. </select>
  21. </mapper>