package com.panzhihua.service_community.dao;
|
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
import com.panzhihua.common.model.vos.vaccines.VaccinesUserInoculationByAppVO;
|
import com.panzhihua.service_community.model.dos.ComMngVaccinesInoculationRecordDO;
|
import org.apache.ibatis.annotations.Mapper;
|
import org.apache.ibatis.annotations.Param;
|
import org.apache.ibatis.annotations.Select;
|
|
import java.util.List;
|
|
/**
|
* @auther lyq
|
* @create 2021-05-19 14:17:59
|
* @describe 疫苗接种记录表mapper类
|
*/
|
@Mapper
|
public interface ComMngVaccinesInoculationRecordDAO extends BaseMapper<ComMngVaccinesInoculationRecordDO> {
|
|
@Select("<script> " +
|
"select id,vaccines,name,inoculation_at,vaccines_code,medical_institution,dosage from com_mng_vaccines_inoculation_record " +
|
" where 1=1 and " +
|
"<if test='ids != null and ids.size>0'>" +
|
"(user_type = 2 and user_id in "+
|
"<foreach item=\"item\" collection=\"ids\" separator=\",\" open=\"(\" close=\")\" index=\"\"> " +
|
"#{item} " +
|
"</foreach>" +
|
" ) or " +
|
" </if> " +
|
|
" (user_type = 1 and user_id = #{userId}) " +
|
" order by inoculation_at desc " +
|
" </script>")
|
List<VaccinesUserInoculationByAppVO> getUserInoculationListByApp(@Param("ids") List<Long> ids, @Param("userId") Long userId);
|
|
}
|