| | |
| | | <version>0.0.1-SNAPSHOT</version> |
| | | <name>monitor</name> |
| | | <packaging>war</packaging> |
| | | <description>monitor managet</description> |
| | | <description>monitor manage</description> |
| | | |
| | | <properties> |
| | | <java.version>1.8</java.version> |
| | |
| | | import org.mybatis.spring.SqlSessionTemplate |
| | | import org.mybatis.spring.annotation.MapperScan |
| | | import org.springframework.beans.factory.annotation.Qualifier |
| | | import org.springframework.boot.context.properties.ConfigurationProperties |
| | | import org.springframework.context.annotation.Bean |
| | | import org.springframework.context.annotation.Configuration |
| | | import org.springframework.context.annotation.Primary |
| | |
| | | * @see DataSourceConfig |
| | | */ |
| | | @Configuration |
| | | @MapperScan(basePackages = ["com.flightfeather.monitor.domain.ds1.mapper"], |
| | | sqlSessionTemplateRef = "ds1SqlSessionTemplate") |
| | | @MapperScan(basePackages = ["com.flightfeather.monitor.domain.ds1.mapper", "com.flightfeather.monitor.mapper"], |
| | | sqlSessionTemplateRef = "ds1SqlSessionTemplate", sqlSessionFactoryRef = "ds1SqlSessionFactory") |
| | | class MybatisConfig4ds1 { |
| | | |
| | | //主数据源 ds1数据源 |
| | | @Primary |
| | | @Bean("ds1SqlSessionFactory") |
| | | @Throws(Exception::class) |
| | | fun ds1SqlSessionFactory(@Qualifier("ds1DataSource") dataSource: DataSource?): SqlSessionFactory? { |
| | | fun ds1SqlSessionFactory( |
| | | @Qualifier("ds1DataSource") dataSource: DataSource?, |
| | | @Qualifier("ds1MybatisConfiguration") configuration: org.apache.ibatis.session.Configuration, |
| | | ): SqlSessionFactory? { |
| | | val sqlSessionFactory = SqlSessionFactoryBean() |
| | | sqlSessionFactory.setDataSource(dataSource) |
| | | sqlSessionFactory.setMapperLocations(*PathMatchingResourcePatternResolver().getResources("classpath*:mapper/ds1/*.xml")) |
| | | sqlSessionFactory.setMapperLocations(*PathMatchingResourcePatternResolver().getResources |
| | | ("classpath*:mapper/**/*.xml")) |
| | | sqlSessionFactory.setConfiguration(configuration) |
| | | return sqlSessionFactory.getObject() |
| | | } |
| | | |
| | |
| | | fun ds1SqlSessionTemplate(@Qualifier("ds1SqlSessionFactory") sqlSessionFactory: SqlSessionFactory?): SqlSessionTemplate? { |
| | | return SqlSessionTemplate(sqlSessionFactory) |
| | | } |
| | | |
| | | @Bean(name = ["ds1MybatisConfiguration"]) |
| | | @ConfigurationProperties(prefix = "mybatis.configuration") |
| | | fun ds1MybatisConfiguration(): org.apache.ibatis.session.Configuration { |
| | | return org.apache.ibatis.session.Configuration() |
| | | } |
| | | |
| | | } |
| | |
| | | @Select("select * from analysis_data") |
| | | List<AnalysisData> findAllData(); |
| | | |
| | | List<AnalysisData> findByDevId(String devId,String begin,String end); |
| | | List<AnalysisData> findByDevId(String devId, String begin, String end); |
| | | |
| | | |
| | | List<AnalysisData> find(String shopname,String value,String begin, String end); |
| | | List<AnalysisData> find(String shopname, String value, String begin, String end); |
| | | |
| | | @Insert("insert into fm_web_analysis_data values(#{fumeDevId},#{fumeDate},#{fumeDayMin},#{fumeDayMax},#{fumeDayAverage},#{purifierOpenRate},#{fumeMinuteExceedingNum},#{fumeOverStandardRate},#{fumeDataEfficiency},#{dailyOnlineRate},#{noonOnlineRate},#{nightOnlineRate},#{keyOnlineRate},#{noonValidRate},#{nightValidRate},#{keyValidRate},#{noonOpeningCount},#{nightOpeningCount},#{keyOpeningRate},#{noonExceedingNum},#{nightExceedingNum},#{keyExceedingRate})") |
| | | void write(AnalysisData analysisData); |
| | | |
| | | List<AnalysisData> search(String shopname,String value, String begin, String end); |
| | | List<AnalysisData> search(String shopname, String value, String begin, String end); |
| | | |
| | | } |
| | |
| | | import java.util.List; |
| | | |
| | | @Mapper |
| | | public interface FugitiveDustMapper { |
| | | public interface FugitiveDustMapper{ |
| | | |
| | | List<DustSiteData> conditonQueryDustHistoryData(String siteName, String mnCode,String beginTime, String endTime,@Param("scenarioType") String[] scenarioType) ; |
| | | |
| | |
| | | # username: root |
| | | # password: 123456 |
| | | |
| | | # url: jdbc:mysql://114.215.109.124:3306/fume |
| | | # username: fumeRemote |
| | | # password: feiyu2023 |
| | | |
| | | mybatis: |
| | | configuration: |
| | | log-impl: org.apache.ibatis.logging.stdout.StdOutImpl |
| | | map-underscore-to-camel-case: true |
| | | type-aliases-package: com.flightfeather.monitor.domain.ds1.entity |
| | | mapper-locations: classpath*:mapper/**/*.xml |
| | | |
| | | # 通用 Mapper 配置 |
| | | # mappers 多个接口时逗号隔开 |
| | | mapper: |
| | | mappers: com.flightfeather.monitor.domain.util.MyMapper |
| | | not-empty: false |
| | | identity: MYSQL |
| | | |
| | | server: |
| | | port: 8081 |