| | |
| | | package com.mzl.flower.mapper.film; |
| | | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.mzl.flower.dto.request.film.FilmLocationQueryDTO; |
| | | import com.mzl.flower.dto.response.film.FilmLocationNameDTO; |
| | | import com.mzl.flower.dto.response.film.FilmLocationVO; |
| | | import com.mzl.flower.entity.film.FilmLocation; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import org.apache.ibatis.annotations.MapKey; |
| | | import org.apache.ibatis.annotations.Param; |
| | | import org.apache.ibatis.annotations.Select; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | */ |
| | | public interface FilmLocationMapper extends BaseMapper<FilmLocation> { |
| | | |
| | | List<FilmLocationVO> queryPage(@Param("dto") FilmLocationQueryDTO dto, Page page); |
| | | |
| | | |
| | | @Select("select * from film_location where id = #{id} ") |
| | | FilmLocationVO selectByIdInfo(Long id); |
| | | |
| | | @Select("select * from film_location where location_name = #{locationName} and deleted = '0' limit 1") |
| | | FilmLocation selectByLocationName(@Param("locationName") String locationName ); |
| | | |
| | | @Select("<script>" + |
| | | "SELECT id, location_name AS name FROM film_location " + |
| | | "WHERE id IN " + |
| | | "<foreach item='id' collection='list' open='(' separator=',' close=')'>" + |
| | | "#{id}" + |
| | | "</foreach>" + |
| | | "</script>") |
| | | @MapKey("id") |
| | | Map<Long, FilmLocationNameDTO> getLocationNamesByIds(@Param("list") List<Long> ids); |
| | | |
| | | |
| | | @Select("select * from film_location where is_enabled = '1' and deleted = '0' order by location_weight desc limit 3") |
| | | List<FilmLocationVO> getFilmLocationListTop3(); |
| | | } |