gunshi-project-ss/src/main/java/com/gunshi/project/xyt/mapper/ProjectEventsMapper.java

95 lines
4.0 KiB
Java
Raw Normal View History

2024-08-20 15:58:52 +08:00
package com.gunshi.project.xyt.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
2024-09-24 13:33:32 +08:00
import com.gunshi.project.xyt.entity.so.CommonDataPageSo;
import com.gunshi.project.xyt.entity.vo.ProjectEventsVo;
2024-08-20 15:58:52 +08:00
import com.gunshi.project.xyt.model.ProjectEvents;
import org.apache.ibatis.annotations.Mapper;
2024-09-24 13:33:32 +08:00
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import java.util.List;
2024-08-20 15:58:52 +08:00
@Mapper
public interface ProjectEventsMapper extends BaseMapper<ProjectEvents> {
2024-09-24 13:33:32 +08:00
@Select("""
<script>
select t.id,t.events_date,t.events_desc,1 as type from public.project_events t
<where>
<if test="obj.dateSo != null and obj.dateSo.start != null">
t.events_date <![CDATA[>=]]> #{obj.dateSo.start}
</if>
<if test="obj.dateSo != null and obj.dateSo.end != null">
and t.events_date <![CDATA[<=]]> #{obj.dateSo.end}
</if>
</where>
</script>
""")
List<ProjectEventsVo> eventList(@Param("obj") CommonDataPageSo page);
@Select("""
<script>
select t.id,t.report_time as eventsDate,t.maintain_content as eventsDesc,3 as type from public.maintain_service t
<where>
<if test="obj.dateSo != null and obj.dateSo.start != null">
t.report_time <![CDATA[>=]]> #{obj.dateSo.start}
</if>
<if test="obj.dateSo != null and obj.dateSo.end != null">
and t.report_time <![CDATA[<=]]> #{obj.dateSo.end}
</if>
</where>
</script>
""")
List<ProjectEventsVo> maintainList(@Param("obj") CommonDataPageSo page);
@Select("""
<script>
select t.id,t.identify_date as eventsDate,t.main_problem as eventsDesc,4 as type from public.safety_identify t
<where>
<if test="obj.dateSo != null and obj.dateSo.start != null">
t.identify_date <![CDATA[>=]]> #{obj.dateSo.start}
</if>
<if test="obj.dateSo != null and obj.dateSo.end != null">
and t.identify_date <![CDATA[<=]]> #{obj.dateSo.end}
</if>
</where>
</script>
""")
List<ProjectEventsVo> safetyList(@Param("obj") CommonDataPageSo page);
@Select("""
<script>
select t.id,t.start_date as eventsDate,t.construct_content as eventsDesc,5 as type from public.safety_reinforcement t
<where>
<if test="obj.dateSo != null and obj.dateSo.start != null">
t.start_date <![CDATA[>=]]> #{obj.dateSo.start}
</if>
<if test="obj.dateSo != null and obj.dateSo.end != null">
and t.start_date <![CDATA[<=]]> #{obj.dateSo.end}
</if>
</where>
</script>
""")
List<ProjectEventsVo> reinforceList(@Param("obj") CommonDataPageSo page);
@Select("""
<script>
select t.id,t.report_date as eventsDate,6 as type from public.termite_survey t
<where>
<if test="obj.dateSo != null and obj.dateSo.start != null">
and t.report_date <![CDATA[>=]]> #{obj.dateSo.start}
</if>
<if test="obj.dateSo != null and obj.dateSo.end != null">
and t.report_date <![CDATA[<=]]> #{obj.dateSo.end}
</if>
</where>
</script>
""")
List<ProjectEventsVo> termiteList(@Param("obj") CommonDataPageSo page);
2024-08-20 15:58:52 +08:00
}