lxw
2022-09-09 48999eb445c9a8b2667c811d92da3ebf5463e146
台站管理
1个文件已添加
4个文件已修改
30 ■■■■ 已修改文件
src/main/java/com/whyc/dto/Station/FileName.java 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/whyc/dto/Station/StationName3.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/whyc/mapper/StationMapper.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/whyc/service/StationService.java 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/StationMapper.xml 10 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/whyc/dto/Station/FileName.java
New file
@@ -0,0 +1,11 @@
package com.whyc.dto.Station;
import lombok.Data;
import java.io.Serializable;
@Data
public class FileName implements Serializable {
    private String fileId;
    private String fileName;
}
src/main/java/com/whyc/dto/Station/StationName3.java
@@ -1,12 +1,16 @@
package com.whyc.dto.Station;
import com.whyc.pojo.FileInfo;
import lombok.Data;
import java.io.Serializable;
import java.util.List;
@Data
public class StationName3 implements Serializable {
    private String station1;
    private String station2;
    private String station3;
    private String stationId;
    private List<FileName> fileNames;
}
src/main/java/com/whyc/mapper/StationMapper.java
@@ -6,5 +6,5 @@
public interface StationMapper extends CustomMapper<StationName1>{
    //查询台站列表
    List getStation();
    List<StationName1> getStation();
}
src/main/java/com/whyc/service/StationService.java
@@ -1,6 +1,7 @@
package com.whyc.service;
import com.whyc.dto.Response;
import com.whyc.dto.Station.StationName1;
import com.whyc.mapper.StationMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@@ -14,7 +15,7 @@
    //查询台站列表
    public Response getStation() {
        List list=mapper.getStation();
        List<StationName1> list=mapper.getStation();
        return new Response().setII(1,list.size()>0,list,"台站列表");
    }
}
src/main/resources/mapper/StationMapper.xml
@@ -18,7 +18,7 @@
    </resultMap>
    <select id="selectSName2" resultMap="name2List">
        SELECT distinct #{station1} as station1,station_name2 from db_res_meter.tb_station_info
        where station_name1=#{station1} and station_name2!="-"
        where station_name1=#{station1}
    </select>
    <resultMap id="name3List" type="StationName3">
@@ -26,10 +26,16 @@
        <result property="station2" column="station2" ></result>
        <result property="station3" column="station_name3" ></result>
        <result property="stationId" column="station_id" ></result>
        <collection property="fileNames" javaType="java.util.ArrayList" ofType="com.whyc.dto.Station.FileName" column="{stationId=station_id}" select="selectFileName">
        </collection>
    </resultMap>
    <select id="selectSName3" resultMap="name3List">
        SELECT distinct #{station1} as station1, #{station2} as station2,station_name3,station_id from db_res_meter.tb_station_info
        where station_name1=#{station1} and station_name2=#{station2}
        and station_name3!="-"
    </select>
    <select id="selectFileName" resultType="fileName">
        SELECT distinct file_id,file_name from db_res_meter.tb_file_info
        where station_id=#{stationId}
    </select>
</mapper>