|
|
@ -6,20 +6,24 @@ import com.baomidou.mybatisplus.core.metadata.IPage; |
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
|
|
|
import com.kms.yxgh.base.sz.domain.AttWagaBaseSz; |
|
|
|
import com.kms.yxgh.business.sz.dto.*; |
|
|
|
import org.apache.ibatis.annotations.*; |
|
|
|
import org.apache.ibatis.annotations.Param; |
|
|
|
import org.apache.ibatis.annotations.Result; |
|
|
|
import org.apache.ibatis.annotations.Results; |
|
|
|
import org.apache.ibatis.annotations.Select; |
|
|
|
import org.springframework.stereotype.Repository; |
|
|
|
|
|
|
|
import java.util.Date; |
|
|
|
import java.util.List; |
|
|
|
|
|
|
|
@DS("share") |
|
|
|
@Repository |
|
|
|
public interface AttWagaBaseSzMapper extends BaseMapper<AttWagaBaseSz> { |
|
|
|
|
|
|
|
@Select("select adcd from rel_waga_ad where waga_code = #{wagaCode} ") |
|
|
|
String getAdcd(@Param("wagaCode") String wagaCode); |
|
|
|
|
|
|
|
@Select({ |
|
|
|
"<script>", |
|
|
|
"select df.waga_code waga_code, df.waga_name waga_name, df.waga_type, df.adcd, df.eng_scal, df.adm_dep engineering_management_unit ", |
|
|
|
"select df.*,lf.adcd ", |
|
|
|
"from att_waga_base df ", |
|
|
|
"left join rel_waga_ad lf on lf.waga_code = df.waga_code ", |
|
|
|
"where 1=1 ", |
|
|
|
"<if test='dto.wagaName != null and dto.wagaName != \"\"'>", |
|
|
|
"and waga_name like concat('%', #{dto.wagaName}, '%') ", |
|
|
@ -28,23 +32,22 @@ public interface AttWagaBaseSzMapper extends BaseMapper<AttWagaBaseSz> { |
|
|
|
"and waga_type = #{dto.wagaType} ", |
|
|
|
"</if>", |
|
|
|
"<if test='dto.adcdQx!= null and dto.adcdQx != \"\"'>", |
|
|
|
"and adcd like concat(#{dto.adcdQx}, '%') ", |
|
|
|
"and lf.adcd like concat(#{dto.adcdQx}, '%') ", |
|
|
|
"</if>", |
|
|
|
"</script>" |
|
|
|
}) |
|
|
|
@Results({ |
|
|
|
@Result(property = "wagaCode", column = "waga_code"), |
|
|
|
@Result(property = "wagaName", column = "waga_name"), |
|
|
|
@Result(property = "engineeringManagementUnit", column = "engineering_management_unit"), |
|
|
|
@Result(property = "lastTime", column = "waga_code", javaType = Date.class, one = @One(select = "com.kms.yxgh.business.sz.mapper.SzRecordMapper.getLastInsertTimeByWagaCodeAndPlanId")) |
|
|
|
}) |
|
|
|
IPage<SzProjectListDto> getSzProjectListWithPage(Page<SzProjectListDto> page, @Param("dto") AttWagaBaseSz bsSgcSzGcda); |
|
|
|
|
|
|
|
|
|
|
|
@Select({ |
|
|
|
"<script>", |
|
|
|
"select df.waga_code waga_code, df.waga_name waga_name, df.waga_type, df.adcd, df.eng_scal, df.adm_dep engineering_management_unit ", |
|
|
|
"select df.*,lf.adcd ", |
|
|
|
"from att_waga_base df ", |
|
|
|
"left join rel_waga_ad lf on lf.waga_code = df.waga_code ", |
|
|
|
"where 1=1 ", |
|
|
|
"<if test='sp.wagaCode != null and sp.wagaCode != \"\"'>", |
|
|
|
"and waga_code = #{sp.wagaCode} ", |
|
|
@ -52,22 +55,18 @@ public interface AttWagaBaseSzMapper extends BaseMapper<AttWagaBaseSz> { |
|
|
|
"<if test='sp.wagaName != null and sp.wagaName != \"\"'>", |
|
|
|
"and waga_name like concat('%', #{sp.wagaName}, '%') ", |
|
|
|
"</if>", |
|
|
|
"<if test='sp.engineeringManagementUnit!= null and sp.engineeringManagementUnit != \"\"'>", |
|
|
|
"and df.adm_dep like concat('%', #{sp.engineeringManagementUnit}, '%') ", |
|
|
|
"</if>", |
|
|
|
"</script>" |
|
|
|
}) |
|
|
|
@Results({ |
|
|
|
@Result(property = "wagaCode", column = "waga_code"), |
|
|
|
@Result(property = "wagaName", column = "waga_name"), |
|
|
|
@Result(property = "engineeringManagementUnit", column = "engineering_management_unit"), |
|
|
|
@Result(property = "lastTime", column = "waga_code", javaType = Date.class, one = @One(select = "com.kms.yxgh.business.sz.mapper.SzYhRecordMapper.getLastInsertTimeByWagaCode")) |
|
|
|
}) |
|
|
|
IPage<SzProjectListDto> getSzYhProjectListWithPage(Page<SzProjectListDto> page, @Param("sp") SzYhProjectQueDto sp); |
|
|
|
|
|
|
|
@Select("<script>" + |
|
|
|
"select df.waga_code waga_code, df.waga_name waga_name, df.waga_type, df.adcd, df.eng_scal, df.adm_dep engineering_management_unit " + |
|
|
|
"select df.*,lf.adcd " + |
|
|
|
"from att_waga_base df " + |
|
|
|
"left join rel_waga_ad lf on lf.waga_code = df.waga_code " + |
|
|
|
"WHERE 1=1 " + |
|
|
|
"<if test='szProject.wagaType != null and szProject.wagaType != \"\"'>" + |
|
|
|
"AND df.waga_type = #{szProject.wagaType} " + |
|
|
@ -79,19 +78,18 @@ public interface AttWagaBaseSzMapper extends BaseMapper<AttWagaBaseSz> { |
|
|
|
"AND df.waga_name like concat('%', #{szProject.wagaName}, '%') " + |
|
|
|
"</if>" + |
|
|
|
"<if test='szProject.adcd != null and szProject.adcd != \"\"'>" + |
|
|
|
"AND df.adcd like concat(#{szProject.adcd}, '%') " + |
|
|
|
"AND lf.adcd like concat(#{szProject.adcd}, '%') " + |
|
|
|
"</if>" + |
|
|
|
"</script>") |
|
|
|
IPage<SzYqProjectListDto> getSzYqProjectListWithPage(Page<SzYqProjectListDto> page, @Param("szProject") SzYqProjectQueDto szProject); |
|
|
|
|
|
|
|
@Select("<script>" + |
|
|
|
"SELECT waga_code , waga_name " + |
|
|
|
"FROM att_waga_base where expr_date is null " + |
|
|
|
"FROM att_waga_base sz " + |
|
|
|
"left join rel_waga_ad lf on lf.waga_code = sz.waga_code " + |
|
|
|
"WHERE 1=1 " + |
|
|
|
"<if test='szProject.adcd != null and szProject.adcd != \"\"'>" + |
|
|
|
"AND adcd like concat(#{szProject.adcd}, '%') " + |
|
|
|
"</if>" + |
|
|
|
"<if test='szProject.riverLocation != null and szProject.riverLocation != \"\"'>" + |
|
|
|
"AND river_location = #{szProject.riverLocation} " + |
|
|
|
"AND lf.adcd like concat(#{szProject.adcd}, '%') " + |
|
|
|
"</if>" + |
|
|
|
"<if test='szProject.wagaCodes != null and szProject.wagaCodes.size() > 0'>" + |
|
|
|
"AND waga_code in " + |
|
|
@ -103,8 +101,6 @@ public interface AttWagaBaseSzMapper extends BaseMapper<AttWagaBaseSz> { |
|
|
|
@Results({ |
|
|
|
@Result(property = "wagaCode", column = "waga_code"), |
|
|
|
@Result(property = "wagaName", column = "waga_name"), |
|
|
|
@Result(property = "rainfall", column = "waga_code", javaType = Double.class, one = @One(select = "com.kms.yxgh.business.sz.mapper.SzWaterRegimeMapper.getTodayRainfall")), |
|
|
|
@Result(property = "waterLevel", column = "waga_code", javaType = Double.class, one = @One(select = "com.kms.yxgh.business.sz.mapper.SzWaterRegimeMapper.getTodayWaterLevel")), |
|
|
|
}) |
|
|
|
IPage<SzYqStatisticsProjectListDto> getSzYqProjectStatisticsWithPage(Page<SzYqStatisticsProjectListDto> page, @Param("szProject") SzYqStatisticsProjectQueDto szProject); |
|
|
|
|
|
|
@ -112,8 +108,9 @@ public interface AttWagaBaseSzMapper extends BaseMapper<AttWagaBaseSz> { |
|
|
|
@Select({ |
|
|
|
"<script>", |
|
|
|
"SELECT ", |
|
|
|
"df.id waga_id, df.waga_code waga_code, df.waga_name waga_name, df.waga_type waga_type ", |
|
|
|
" df.waga_code waga_code, df.waga_name waga_name, df.waga_type waga_type ", |
|
|
|
"FROM att_waga_base df ", |
|
|
|
"left join rel_waga_ad lf on lf.waga_code = df.waga_code ", |
|
|
|
"where 1=1 ", |
|
|
|
"<if test='dto.wagaName != null and dto.wagaName != \"\"'>", |
|
|
|
"and df.waga_name like concat('%', #{dto.wagaName}, '%') ", |
|
|
@ -122,25 +119,12 @@ public interface AttWagaBaseSzMapper extends BaseMapper<AttWagaBaseSz> { |
|
|
|
"and df.waga_type = #{dto.wagaType} ", |
|
|
|
"</if>", |
|
|
|
"<if test='dto.adcd != null and dto.adcd != \"\"'>", |
|
|
|
"and df.adcd like concat(#{dto.adcd}, '%') ", |
|
|
|
"</if>", |
|
|
|
"and EXISTS (SELECT 1 FROM bs_sgc_sz_xslx line WHERE line.waga_code = df.waga_code ", |
|
|
|
"<if test='dto.lineName != null and dto.lineName != \"\"'>", |
|
|
|
"and line.name like concat('%', #{dto.lineName}, '%') ", |
|
|
|
"</if>", |
|
|
|
"<if test='dto.type != null and dto.type != \"\"'>", |
|
|
|
"and line.type = #{dto.type} ", |
|
|
|
"and lf.adcd like concat(#{dto.adcd}, '%') ", |
|
|
|
"</if>", |
|
|
|
"<if test='dto.dutyHolderType != null and dto.dutyHolderType != \"\"'>", |
|
|
|
"and line.duty_holder_type = #{dto.dutyHolderType} ", |
|
|
|
"</if> )", |
|
|
|
"</script>" |
|
|
|
}) |
|
|
|
@Results(value = { |
|
|
|
@Result(property = "wagaCode", column = "waga_code"), |
|
|
|
@Result(property = "dutyHolders", column = "waga_code", |
|
|
|
javaType = List.class, |
|
|
|
many = @Many(select = "com.kms.yg.sz.mapper.BsSgcSzFzrMapper.getByWagaCode")) |
|
|
|
}) |
|
|
|
IPage<SzCheckingLineProjectListDto> getSzCheckingLineProjectListWithPage(Page<SzProjectListDto> page, @Param("dto") SzCheckingLineSearchDto dto); |
|
|
|
|
|
|
|