Commit 6f1cb575 authored by hanbing's avatar hanbing

添加启动类、依赖

parent baaf4d42
...@@ -5,9 +5,10 @@ ...@@ -5,9 +5,10 @@
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<groupId>net.wanji</groupId> <groupId>com.wanji</groupId>
<artifactId>traffic-signal-platform</artifactId> <artifactId>traffic-signal-platform</artifactId>
<version>1.0-SNAPSHOT</version> <version>1.1.0</version>
<packaging>pom</packaging>
<name>traffic-signal-platform</name> <name>traffic-signal-platform</name>
...@@ -15,6 +16,13 @@ ...@@ -15,6 +16,13 @@
traffic-signal-platform traffic-signal-platform
</description> </description>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.6.3</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<modules> <modules>
<module>identity-client-starter</module> <module>identity-client-starter</module>
<module>signal-utc-service</module> <module>signal-utc-service</module>
...@@ -25,4 +33,59 @@ ...@@ -25,4 +33,59 @@
<module>wj-portal</module> <module>wj-portal</module>
</modules> </modules>
<!-- 依赖版本 -->
<properties>
<spring-cloud.version>2021.0.0</spring-cloud.version>
<spring-cloud-alibaba.version>0.2.1.RELEASE</spring-cloud-alibaba.version>
<mybatis.version>2.2.2</mybatis.version>
<mapper.springboot.version>2.1.5</mapper.springboot.version>
<mybatis.typehandlers.version>1.0.2</mybatis.typehandlers.version>
<druid.version>1.1.5</druid.version>
</properties>
<!-- 依赖声明 -->
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-dependencies</artifactId>
<version>${spring-cloud.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-alibaba-dependencies</artifactId>
<version>${spring-cloud-alibaba.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<!-- Mybatis 依赖 -->
<dependency>
<groupId>org.mybatis.spring.boot</groupId>
<artifactId>mybatis-spring-boot-starter</artifactId>
<version>${mybatis.version}</version>
</dependency>
<dependency>
<groupId>org.mybatis</groupId>
<artifactId>mybatis-typehandlers-jsr310</artifactId>
<version>${mybatis.typehandlers.version}</version>
</dependency>
<!-- TK MyBatis -->
<dependency>
<groupId>tk.mybatis</groupId>
<artifactId>mapper-spring-boot-starter</artifactId>
<version>${mapper.springboot.version}</version>
</dependency>
<!-- MySQL -->
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>druid</artifactId>
<version>${druid.version}</version>
</dependency>
</dependencies>
</dependencyManagement>
</project> </project>
\ No newline at end of file
...@@ -5,9 +5,15 @@ ...@@ -5,9 +5,15 @@
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<parent>
<groupId>com.wanji</groupId>
<artifactId>traffic-signal-platform</artifactId>
<version>1.1.0</version>
</parent>
<groupId>net.wanji</groupId> <groupId>net.wanji</groupId>
<artifactId>signal-utc-service</artifactId> <artifactId>signal-utc-service</artifactId>
<version>1.0-SNAPSHOT</version> <version>1.1.0</version>
<name>signal-utc-service</name> <name>signal-utc-service</name>
...@@ -15,4 +21,48 @@ ...@@ -15,4 +21,48 @@
signal-utc-service signal-utc-service
</description> </description>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-aop</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-cache</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<!-- Mybatis 依赖 -->
<dependency>
<groupId>org.mybatis.spring.boot</groupId>
<artifactId>mybatis-spring-boot-starter</artifactId>
</dependency>
<dependency>
<groupId>org.mybatis</groupId>
<artifactId>mybatis-typehandlers-jsr310</artifactId>
</dependency>
<!-- TK MyBatis -->
<dependency>
<groupId>tk.mybatis</groupId>
<artifactId>mapper-spring-boot-starter</artifactId>
</dependency>
<!-- MySQL -->
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>druid</artifactId>
</dependency>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<scope>runtime</scope>
</dependency>
</dependencies>
</project> </project>
\ No newline at end of file
package com.wanji.utc;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.scheduling.annotation.EnableAsync;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.transaction.annotation.EnableTransactionManagement;
/**
* @date 2022/11/15 8:31
*/
@SpringBootApplication(scanBasePackages = "com.wanji")
@EnableTransactionManagement
@MapperScan(basePackages = "com.wanji.utc.dao.mapper")
@EnableScheduling
@EnableAsync
public class UtcApplication {
public static void main(String[] args) {
SpringApplication.run(UtcApplication.class, args);
}
}
package com.wanji.utc.dao.mapper;
import com.wanji.utc.dao.MyBaseMapper;
import com.wanji.utc.dao.model.CrossInfo;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;
/**
* @Description: [路口信息持久层实现]</p>
* @author hfx
* @version 1.0
* Created on 2019年05月06日
*/
@Repository
public interface CrossInfoMapper extends MyBaseMapper<CrossInfo> {
/**
* @description: 根据路口id删除基础信息
* @param crossId 路口id
* @return
* @author hfx
* @date 2020/3/19 16:10
*/
void deleteByCrossId(@Param("crossId") String crossId);
/**
* @description: 根据条件获取路口基础信息列表
* @param crossName 路口名称
* @return
* @author hfx
* @date 2020/3/19 16:10
*/
void listCrossInfo(@Param("crossName") String crossName);
}
\ No newline at end of file
server: server:
port: 30000 port: 30001
servlet: servlet:
display-name: Wanji display-name: Wanji
context-path: /utc context-path: /utc
......
...@@ -18,12 +18,6 @@ mybatis: ...@@ -18,12 +18,6 @@ mybatis:
configuration: configuration:
log-impl: org.apache.ibatis.logging.stdout.StdOutImpl log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
mapper:
mappers:
- com.wanji.utc.dao.MyBaseMapper
not-empty: false
identity: MYSQL
pagehelper: pagehelper:
helper-dialect: mysql helper-dialect: mysql
reasonable: false reasonable: false
......
<?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.wanji.utc.dao.mapper.CrossInfoMapper">
<!-- 通用查询映射结果 -->
<resultMap id="BaseResultMap" type="com.wanji.utc.dao.model.CrossInfo">
<id column="id" property="id"/>
<result column="code" property="code"/>
<result column="name" property="name"/>
<result column="location" property="location"/>
<result column="gmt_create" property="gmtCreate"/>
<result column="gmt_modified" property="gmtModified"/>
</resultMap>
<!--基本字段列表-->
<sql id="Base_Column_List">
id,
name,
gmt_create,
gmt_modified
</sql>
<delete id="deleteByCrossId">
delete from t_cross_info where 1=1
<if test="id != null and id !='' ">
and id = #{id}
</if>
</delete>
<select id="listCrossInfo" resultMap="BaseResultMap">
SELECT
id,
id,
name,
location
FROM
t_cross_info
WHERE 1=1
<if test="crossName != null and crossName != ''">
AND name = #{crossName}
</if>
GROUP BY name
</select>
</mapper>
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