Commit abb033b4 by 李辅翼

v14

parent 0d846999
......@@ -65,6 +65,24 @@
<artifactId>ojdbc6</artifactId>
<version>11.2.0.3</version>
</dependency>
<dependency>
<groupId>org.mybatis.spring.boot</groupId>
<artifactId>mybatis-spring-boot-starter</artifactId>
<exclusions>
<exclusion>
<artifactId>log4j-over-slf4j</artifactId>
<groupId>org.slf4j</groupId>
</exclusion>
</exclusions>
<version>1.3.2</version>
</dependency>
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>druid-spring-boot-starter</artifactId>
<version>1.1.0</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
......@@ -76,16 +94,12 @@
<version>1.16.0</version>
</dependency>
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>fastjson</artifactId>
<version>1.2.51</version>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
......@@ -104,8 +118,31 @@
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<!--必须加上下面的配置,在jar包运行的时候找不到oracle的驱动类-->
<configuration>
<includeSystemScope>
true
</includeSystemScope>
</configuration>
</plugin>
</plugins>
<!-- <plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<layout>ZIP</layout>
<executable>true</executable>
<includes>
<include>
<groupId>nothing</groupId>
<artifactId>nothing</artifactId>
</include>
</includes>
</configuration>
</plugin>
</plugins>-->
</build>
</project>
package com.hikcreate;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.scheduling.annotation.EnableScheduling;
@SpringBootApplication
@EnableScheduling
@MapperScan("com.hikcreate.dao")
public class FtpPicApplication {
public static void main(String[] args) {
......
......@@ -107,8 +107,10 @@ public class PicController {
* @param end
*/
@GetMapping("/increDrvPic")
public void increDrvPic(@RequestParam("start") String start, @RequestParam("end") String end) {
@ResponseBody
public ResponseEntity increDrvPic(@RequestParam("start") String start, @RequestParam("end") String end) {
drvPhoto.increDrvPic(start, end);
return new ResponseEntity("complete", HttpStatus.OK);
}
/**
......@@ -136,18 +138,6 @@ public class PicController {
}
@GetMapping("/drvPhotoHis")
public void getHisDrvPhoto(@RequestParam("time") String time, HttpServletResponse response) {
try {
boolean result = drvPhoto.getHisDrvPhoto(time);
JSONObject jsonObject = new JSONObject();
jsonObject.put("result", result);
response.setContentType("application/json;charset=UTF-8");
response.getWriter().write(jsonObject.toJSONString());
} catch (Exception e) {
e.printStackTrace();
}
}
/**
* app端通过此接口获取违法图片
......
package com.hikcreate.dao;
import com.hikcreate.entity.DriverPhoto;
import org.springframework.stereotype.Component;
import java.util.List;
@Component
public interface DriverPhotoMapper {
List<DriverPhoto> getIncrePhoto();
List<DriverPhoto> getIncrePhotoBySfzmhm(String sfzmhm);
List<DriverPhoto> getIncrePhotoStage(String start, String end);
}
......@@ -11,7 +11,6 @@ import org.springframework.stereotype.Service;
public interface DrvPhoto {
boolean getHisDrvPhoto(String time);
void getIncrementDrvPhoto();
......
......@@ -299,8 +299,6 @@ public class VehicleImpl implements Vehicle {
logger.info(xh+"***************************");
return null;
}
}
......
package com.hikcreate.entity;
import lombok.Data;
import java.io.Serializable;
@Data
public class DriverPhoto implements Serializable {
String sfzmhm;
oracle.sql.BLOB zp;
String gxsj;
String xzqh;
String flag;
String xh;
String rksj;
String fzjg;
}
package com.hikcreate.utils;
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.hbase.HBaseConfiguration;
import org.apache.hadoop.hbase.TableName;
import org.apache.hadoop.hbase.client.Connection;
import org.apache.hadoop.hbase.client.ConnectionFactory;
import org.apache.hadoop.hbase.client.Table;
import org.springframework.stereotype.Component;
import java.io.IOException;
@Component
public class HbaseUtils {
public Connection getHbseCon(String hbaseAddress, String hbaseZkQuorum) throws IOException {
Configuration hbaseConf = HBaseConfiguration.create();
hbaseConf.set("hbase.zookeeper.property.clientPort", hbaseAddress);
hbaseConf.set("hbase.zookeeper.quorum", hbaseZkQuorum);
return ConnectionFactory.createConnection(hbaseConf);
}
public Table getHbaseTable(Connection hbaseConn, String vehflowHbaseStr) throws IOException {
return hbaseConn.getTable(TableName.valueOf(vehflowHbaseStr));
}
public void closeHbaseTable(Table vehFlowTable) {
if (vehFlowTable != null) {
try {
vehFlowTable.close();
} catch (IOException e) {
e.printStackTrace();
}
}
}
public void clodeHbaseCon(Connection hbaseConn) {
if (hbaseConn != null) {
try {
hbaseConn.close();
} catch (IOException e) {
e.printStackTrace();
}
}
}
}
url=jdbc:oracle:thin:@172.16.17.82:1521:gyjg
username=gyjg_zckj
password=zckj2018
spring.datasource.url=jdbc:oracle:thin:@172.16.17.82:1521:gyjg
spring.datasource.username=gyjg_zckj
spring.datasource.password=zckj2018
spring.datasource.driver-class-name=oracle.jdbc.driver.OracleDriver
spring.datasource.type=com.alibaba.druid.pool.DruidDataSource
mybatis.mapper-locations=classpath:mapper/*.xml
mybatis.type-aliases-package=com.hikcreate.entity
logging.level.com.hikcreate.dao=debug
roundDay=-5
redis.cluster=172.16.25.23:7000,172.16.25.23:7001,172.16.25.23:7002,172.16.25.24:7003,172.16.25.24:7004,172.16.25.24:7005
redis.server=172.16.25.23:7000,172.16.25.23:7001,172.16.25.23:7002,172.16.25.24:7003,172.16.25.24:7004,172.16.25.24:7005
......
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.hikcreate.dao.DriverPhotoMapper">
<select id="getIncrePhoto" resultType="DriverPhoto">
select sfzmhm,zp,gxsj,xzqh,flag,xh,rksj,fzjg from GYJG.DRV_PHOTO where GXSJ between sysdate-3 and sysdate and ZP is not null and fzjg is not null and sfzmhm is not null;
</select>
<select id="getIncrePhotoBySfzmhm" resultType="DriverPhoto">
select sfzmhm,zp,gxsj,xzqh,flag,xh,rksj,fzjg from GYJG.DRV_PHOTO where ZP is not null and sfzmhm=#{sfzmhm} order by gxsj desc
</select>
<select id="getIncrePhotoStage" resultType="DriverPhoto">
select sfzmhm,zp,gxsj,xzqh,flag,xh,rksj,fzjg from GYJG.DRV_PHOTO ZP is not null and fzjg='贵A' and sfzmhm is not null and to_char(GXSJ,'yyyy-mm-dd')<![CDATA[ >= ]]>#{start}
and to_char(GXSJ,'yyyy-mm-dd')<![CDATA[ < ]]>#{end}
</select>
</mapper>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment