ClassScheduleMapper.java 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. package com.template.mapper;
  2. import com.baomidou.mybatisplus.core.mapper.BaseMapper;
  3. import com.template.model.pojo.ClassSchedule;
  4. import org.apache.ibatis.annotations.Delete;
  5. import org.apache.ibatis.annotations.Mapper;
  6. import org.apache.ibatis.annotations.Param;
  7. import org.apache.ibatis.annotations.Select;
  8. import org.springframework.stereotype.Component;
  9. import java.time.LocalDate;
  10. import java.util.List;
  11. /**
  12. * <p>
  13. * Mapper 接口
  14. * </p>
  15. *
  16. * @author ceshi
  17. * @since 2023-11-06
  18. */
  19. @Mapper
  20. @Component
  21. public interface ClassScheduleMapper extends BaseMapper<ClassSchedule> {
  22. String remarks(@Param("localDate") LocalDate localDate,@Param("teacherName") String teacherName,@Param("jsgh")String jsgh);
  23. @Delete("delete from class_schedule where remark =#{remark} ")
  24. int removeByRemark(String remark);
  25. @Select({"<script>"+
  26. "select cs.*,o.name as orginizationName from class_schedule cs " +
  27. " left join users u on cs.jsgh=u.card_number and u.deleted=0" +
  28. " left join organization o on o.id=u.organ_id " +
  29. "where"+
  30. " cs.deleted=0" +
  31. " and cs.date_time = #{dateTime}\n" +
  32. " <if test=\"teacherName != null and teacherName != ''\">" +
  33. " and cs.jsxm like '%' #{teacherName} '%'" +
  34. " </if>" +
  35. " <if test=\"jsgh != null and jsgh != ''\">" +
  36. " and cs.jsgh = #{jsgh}\n" +
  37. " </if>"+
  38. "</script>"
  39. })
  40. List<ClassSchedule> listVo(String teacherName, String jsgh, LocalDate dateTime);
  41. }