@@ -0,0 +1,93 @@ | |||
spring: | |||
# 注册中心consul地址 | |||
cloud: | |||
consul: | |||
host: 192.168.11.13 # consul 所在服务地址 | |||
port: 8500 # consul 服务端口 | |||
discovery: | |||
## consul ip地址 | |||
hostname: 192.168.11.13 | |||
# 注册到consul的服务名称 | |||
service-name: ${spring.application.name} # 服务提供者名称 | |||
instance-id: ${spring.application.name}:${spring.cloud.client.ip-address}:${server.port} #实例ID | |||
heartbeat: | |||
enabled: true | |||
prefer-ip-address: true | |||
health-check-path: /actuator/health #健康检查 | |||
health-check-interval: 10s | |||
# 配置数据源 | |||
datasource: | |||
# 使用阿里的Druid连接池 | |||
type: com.alibaba.druid.pool.DruidDataSource | |||
driver-class-name: com.mysql.cj.jdbc.Driver | |||
# 填写你数据库的url、登录名、密码和数据库名 | |||
url: jdbc:mysql://192.168.11.13:3306/tuoheng_oidc?useUnicode=true&characterEncoding=UTF-8&serverTimezone=GMT%2b8&useSSL=true&tinyInt1isBit=false | |||
username: root | |||
password: idontcare | |||
druid: | |||
# 连接池的配置信息 | |||
# 初始连接数 | |||
initialSize: 5 | |||
# 最小连接池数量 | |||
minIdle: 5 | |||
# 最大连接池数量 | |||
maxActive: 20 | |||
# 配置获取连接等待超时的时间 | |||
maxWait: 60000 | |||
# 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒 | |||
timeBetweenEvictionRunsMillis: 60000 | |||
# 配置一个连接在池中最小生存的时间,单位是毫秒 | |||
minEvictableIdleTimeMillis: 300000 | |||
# 配置一个连接在池中最大生存的时间,单位是毫秒 | |||
maxEvictableIdleTimeMillis: 900000 | |||
# 配置检测连接是否有效 | |||
validationQuery: SELECT 1 FROM DUAL | |||
testWhileIdle: true | |||
testOnBorrow: false | |||
testOnReturn: false | |||
# Redis数据源 | |||
redis: | |||
# 缓存库默认索引0 | |||
database: 0 | |||
# Redis服务器地址 | |||
host: 192.168.11.13 | |||
# Redis服务器连接端口 | |||
port: 6379 | |||
# Redis服务器连接密码(默认为空) | |||
password: | |||
# 连接超时时间(毫秒) | |||
timeout: 6000 | |||
# 默认的数据过期时间,主要用于shiro权限管理 | |||
expire: 2592000 | |||
jedis: | |||
pool: | |||
max-active: 1000 # 连接池最大连接数(使用负值表示没有限制) | |||
max-wait: -1 # 连接池最大阻塞等待时间(使用负值表示没有限制) | |||
max-idle: 10 # 连接池中的最大空闲连接 | |||
min-idle: 1 # 连接池中的最小空闲连接 | |||
# 自定义配置 | |||
tuoheng: | |||
#airport配置地址 | |||
airport-url: https://airport-test.t-aaron.com | |||
#dsp配置地址 | |||
dsp-url: http://192.168.11.11:7011/api/web/dsp | |||
# 高德Key | |||
gaodeKey: 5a1f63e7563cba471a9d0773e218144a | |||
# 图片域名 | |||
image-url: https://image.t-aaron.com/ | |||
xxl: | |||
enable: true | |||
job: | |||
admin: | |||
addresses: http://192.168.11.11:8110/xxl-job-admin | |||
accessToken: tuoheng | |||
executor: | |||
appname: xxl-job-executor-oidc | |||
address: | |||
ip: | |||
# 多个后台,端口号不能相同 | |||
port: 9987 | |||
logpath: /data/java/logs/xxl-job/jobhandler | |||
logretentiondays: 15 |
@@ -0,0 +1,72 @@ | |||
spring: | |||
# 注册中心consul地址 | |||
cloud: | |||
consul: | |||
host: 127.0.0.1 # consul 所在服务地址 | |||
port: 8500 # consul 服务端口 | |||
discovery: | |||
## consul ip地址 | |||
hostname: 127.0.0.1 | |||
# 注册到consul的服务名称 | |||
service-name: ${spring.application.name} # 服务提供者名称 | |||
instance-id: ${spring.application.name}:${spring.cloud.client.ip-address}:${server.port} #实例ID | |||
heartbeat: | |||
enabled: true | |||
prefer-ip-address: true | |||
health-check-path: /actuator/health #健康检查 | |||
health-check-interval: 10s | |||
# 配置数据源 | |||
datasource: | |||
# 使用阿里的Druid连接池 | |||
type: com.alibaba.druid.pool.DruidDataSource | |||
driver-class-name: com.mysql.cj.jdbc.Driver | |||
# 填写你数据库的url、登录名、密码和数据库名 | |||
url: jdbc:mysql://192.168.11.13:3306/tuoheng_oidc?useUnicode=true&characterEncoding=UTF-8&serverTimezone=GMT%2b8&useSSL=true&tinyInt1isBit=false | |||
username: root | |||
password: idontcare | |||
druid: | |||
# 连接池的配置信息 | |||
# 初始连接数 | |||
initialSize: 5 | |||
# 最小连接池数量 | |||
minIdle: 5 | |||
# 最大连接池数量 | |||
maxActive: 20 | |||
# 配置获取连接等待超时的时间 | |||
maxWait: 60000 | |||
# 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒 | |||
timeBetweenEvictionRunsMillis: 60000 | |||
# 配置一个连接在池中最小生存的时间,单位是毫秒 | |||
minEvictableIdleTimeMillis: 300000 | |||
# 配置一个连接在池中最大生存的时间,单位是毫秒 | |||
maxEvictableIdleTimeMillis: 900000 | |||
# 配置检测连接是否有效 | |||
validationQuery: SELECT 1 FROM DUAL | |||
testWhileIdle: true | |||
testOnBorrow: false | |||
testOnReturn: false | |||
# Redis数据源 | |||
redis: | |||
# 缓存库默认索引0 | |||
database: 0 | |||
# Redis服务器地址 | |||
host: 192.168.11.13 | |||
# Redis服务器连接端口 | |||
port: 6379 | |||
# Redis服务器连接密码(默认为空) | |||
password: | |||
# 连接超时时间(毫秒) | |||
timeout: 6000 | |||
# 默认的数据过期时间,主要用于shiro权限管理 | |||
expire: 2592000 | |||
jedis: | |||
pool: | |||
max-active: 1000 # 连接池最大连接数(使用负值表示没有限制) | |||
max-wait: -1 # 连接池最大阻塞等待时间(使用负值表示没有限制) | |||
max-idle: 10 # 连接池中的最大空闲连接 | |||
min-idle: 1 # 连接池中的最小空闲连接 | |||
# 自定义配置 | |||
tuoheng: | |||
#airport配置地址 | |||
airport-url: http://192.168.11.22:8060 |
@@ -0,0 +1,91 @@ | |||
spring: | |||
# 注册中心consul地址 | |||
cloud: | |||
consul: | |||
host: 172.16.5.12 # consul 所在服务地址 | |||
port: 8500 # consul 服务端口 | |||
discovery: | |||
## consul ip地址 | |||
hostname: 172.16.5.12 | |||
# 注册到consul的服务名称 | |||
service-name: ${spring.application.name} # 服务提供者名称 | |||
instance-id: ${spring.application.name}:${spring.cloud.client.ip-address}:${server.port} #实例ID | |||
heartbeat: | |||
enabled: true | |||
prefer-ip-address: true | |||
health-check-path: /actuator/health #健康检查 | |||
health-check-interval: 10s | |||
# 配置数据源 | |||
datasource: | |||
# 使用阿里的Druid连接池 | |||
type: com.alibaba.druid.pool.DruidDataSource | |||
driver-class-name: com.mysql.cj.jdbc.Driver | |||
# 填写你数据库的url、登录名、密码和数据库名 | |||
url: jdbc:mysql://rm-uf6x76i111rb1eo48.mysql.rds.aliyuncs.com:3306/tuoheng_oidc?useUnicode=true&characterEncoding=UTF-8&serverTimezone=GMT%2b8&useSSL=true&tinyInt1isBit=false | |||
username: root | |||
password: TH22#2022 | |||
druid: | |||
# 连接池的配置信息 | |||
# 初始连接数 | |||
initialSize: 5 | |||
# 最小连接池数量 | |||
minIdle: 5 | |||
# 最大连接池数量 | |||
maxActive: 20 | |||
# 配置获取连接等待超时的时间 | |||
maxWait: 60000 | |||
# 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒 | |||
timeBetweenEvictionRunsMillis: 60000 | |||
# 配置一个连接在池中最小生存的时间,单位是毫秒 | |||
minEvictableIdleTimeMillis: 300000 | |||
# 配置一个连接在池中最大生存的时间,单位是毫秒 | |||
maxEvictableIdleTimeMillis: 900000 | |||
# 配置检测连接是否有效 | |||
validationQuery: SELECT 1 FROM DUAL | |||
testWhileIdle: true | |||
testOnBorrow: false | |||
testOnReturn: false | |||
# Redis数据源 | |||
redis: | |||
# 缓存库默认索引0 | |||
database: 0 | |||
# Redis服务器地址 | |||
host: r-uf6r5lm7c7sfdv3ehb.redis.rds.aliyuncs.com | |||
# Redis服务器连接端口 | |||
port: 6379 | |||
# Redis服务器连接密码(默认为空) | |||
password: | |||
# 连接超时时间(毫秒) | |||
timeout: 6000 | |||
# 默认的数据过期时间,主要用于shiro权限管理 | |||
expire: 2592000 | |||
jedis: | |||
pool: | |||
max-active: 1000 # 连接池最大连接数(使用负值表示没有限制) | |||
max-wait: -1 # 连接池最大阻塞等待时间(使用负值表示没有限制) | |||
max-idle: 10 # 连接池中的最大空闲连接 | |||
min-idle: 1 # 连接池中的最小空闲连接 | |||
# 自定义配置 | |||
tuoheng: | |||
#airport配置地址 | |||
airport-url: https://airport.t-aaron.com | |||
#dsp配置地址 | |||
dsp-url: https://dsp-portal.t-aaron.com/api/web/dsp | |||
# 高德Key | |||
gaodeKey: 5a1f63e7563cba471a9d0773e218144a | |||
# 图片域名 | |||
image-url: https://image.t-aaron.com/ | |||
xxl: | |||
enable: true | |||
job: | |||
admin: | |||
addresses: https://xxl-job.t-aaron.com/xxl-job-admin/ | |||
accessToken: tuoheng | |||
executor: | |||
appname: xxl-job-executor-oidc | |||
address: | |||
ip: | |||
# 多个后台,端口号不能相同 | |||
port: 9987 | |||
logpath: /data/java/logs/xxl-job/jobhandler | |||
logretentiondays: 15 |
@@ -0,0 +1,91 @@ | |||
spring: | |||
# 注册中心consul地址 | |||
cloud: | |||
consul: | |||
host: 172.15.1.11 # consul 所在服务地址 | |||
port: 8500 # consul 服务端口 | |||
discovery: | |||
## consul ip地址 | |||
hostname: 172.15.1.11 | |||
# 注册到consul的服务名称 | |||
service-name: ${spring.application.name} # 服务提供者名称 | |||
instance-id: ${spring.application.name}:${spring.cloud.client.ip-address}:${server.port} #实例ID | |||
heartbeat: | |||
enabled: true | |||
prefer-ip-address: true | |||
health-check-path: /actuator/health #健康检查 | |||
health-check-interval: 10s | |||
# 配置数据源 | |||
datasource: | |||
# 使用阿里的Druid连接池 | |||
type: com.alibaba.druid.pool.DruidDataSource | |||
driver-class-name: com.mysql.cj.jdbc.Driver | |||
# 填写你数据库的url、登录名、密码和数据库名 | |||
url: jdbc:mysql://rm-uf6z740323e8053pj.mysql.rds.aliyuncs.com:3306/tuoheng_oidc?useUnicode=true&characterEncoding=UTF-8&serverTimezone=GMT%2b8&useSSL=true&tinyInt1isBit=false | |||
username: root | |||
password: TH22#2022 | |||
druid: | |||
# 连接池的配置信息 | |||
# 初始连接数 | |||
initialSize: 5 | |||
# 最小连接池数量 | |||
minIdle: 5 | |||
# 最大连接池数量 | |||
maxActive: 20 | |||
# 配置获取连接等待超时的时间 | |||
maxWait: 60000 | |||
# 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒 | |||
timeBetweenEvictionRunsMillis: 60000 | |||
# 配置一个连接在池中最小生存的时间,单位是毫秒 | |||
minEvictableIdleTimeMillis: 300000 | |||
# 配置一个连接在池中最大生存的时间,单位是毫秒 | |||
maxEvictableIdleTimeMillis: 900000 | |||
# 配置检测连接是否有效 | |||
validationQuery: SELECT 1 FROM DUAL | |||
testWhileIdle: true | |||
testOnBorrow: false | |||
testOnReturn: false | |||
# Redis数据源 | |||
redis: | |||
# 缓存库默认索引0 | |||
database: 0 | |||
# Redis服务器地址 | |||
host: r-uf6cdzjifj20jszykr.redis.rds.aliyuncs.com | |||
# Redis服务器连接端口 | |||
port: 6379 | |||
# Redis服务器连接密码(默认为空) | |||
password: | |||
# 连接超时时间(毫秒) | |||
timeout: 6000 | |||
# 默认的数据过期时间,主要用于shiro权限管理 | |||
expire: 2592000 | |||
jedis: | |||
pool: | |||
max-active: 1000 # 连接池最大连接数(使用负值表示没有限制) | |||
max-wait: -1 # 连接池最大阻塞等待时间(使用负值表示没有限制) | |||
max-idle: 10 # 连接池中的最大空闲连接 | |||
min-idle: 1 # 连接池中的最小空闲连接 | |||
# 自定义配置 | |||
tuoheng: | |||
#airport配置地址 | |||
airport-url: https://airport-test.t-aaron.com | |||
#dsp配置地址 | |||
dsp-url: http://106.15.64.139:7011/api/web/dsp | |||
# 高德Key | |||
gaodeKey: 5a1f63e7563cba471a9d0773e218144a | |||
# 图片域名 | |||
image-url: https://image.t-aaron.com/ | |||
xxl: | |||
enable: true | |||
job: | |||
admin: | |||
addresses: http://172.15.1.11:8110/xxl-job-admin | |||
accessToken: tuoheng | |||
executor: | |||
appname: xxl-job-executor-oidc | |||
address: | |||
ip: | |||
# 多个后台,端口号不能相同 | |||
port: 9987 | |||
logpath: /data/java/logs/xxl-job/jobhandler | |||
logretentiondays: 15 |
@@ -0,0 +1,13 @@ | |||
server: | |||
port: 8091 | |||
spring: | |||
profiles: | |||
active: @package.environment@ | |||
application: | |||
name: tuoheng-oidc-admin | |||
main: | |||
allow-bean-definition-overriding: true | |||
mybatis: | |||
mapper-locations: classpath*:mapper/*Mapper.xml |
@@ -0,0 +1,69 @@ | |||
<?xml version="1.0" encoding="UTF-8"?> | |||
<!-- 日志级别从低到高分为TRACE < DEBUG < INFO < WARN < ERROR < FATAL,如果设置为WARN,则低于WARN的信息都不会输出 --> | |||
<!-- scan:当此属性设置为true时,配置文档如果发生改变,将会被重新加载,默认值为true --> | |||
<!-- scanPeriod:设置监测配置文档是否有修改的时间间隔,如果没有给出时间单位,默认单位是毫秒。 | |||
当scan为true时,此属性生效。默认的时间间隔为1分钟。 --> | |||
<!-- debug:当此属性设置为true时,将打印出logback内部日志信息,实时查看logback运行状态。默认值为false。 --> | |||
<configuration scan="true" scanPeriod="60 seconds" debug="false"> | |||
<!-- | |||
contextName说明: | |||
每个logger都关联到logger上下文,默认上下文名称为“default”。但可以使用设置成其他名字, | |||
用于区分不同应用程序的记录。一旦设置,不能修改,可以通过%contextName来打印日志上下文名称。 | |||
--> | |||
<contextName>tuoheng_oidc_admin</contextName> | |||
<!--定义日志变量--> | |||
<!--<property name="logging.path" value="D:\\idealogs\\tuoheng_oidc"/>--> | |||
<property name="logging.path" value="/data/java/logs/tuoheng_oidc"/> | |||
<!--日志格式: [时间] [级别] [线程] [行号] [logger信息] - [日志信息]--> | |||
<property name="logging.pattern" value="%d{yyyy-MM-dd HH:mm:ss.SSS} [%level][%thread][%L] %logger - %msg%n"/> | |||
<property name="logging.charset" value="UTF-8"/> | |||
<property name="logging.maxHistory" value="15"/> | |||
<property name="logging.totalSizeCap" value="5GB"/> | |||
<property name="logging.maxFileSize" value="40MB"/> | |||
<appender name="console" class="ch.qos.logback.core.ConsoleAppender"> | |||
<encoder> | |||
<pattern>${logging.pattern}</pattern> | |||
<charset>${logging.charset}</charset> | |||
</encoder> | |||
</appender> | |||
<appender name="LOG_FILE" class="ch.qos.logback.core.rolling.RollingFileAppender"> | |||
<File>${logging.path}/admin/tuoheng_oidc_admin.log</File> | |||
<append>true</append> | |||
<rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy"> | |||
<fileNamePattern>${logging.path}/admin/tuoheng_oidc_admin-%d-%i.log</fileNamePattern> | |||
<!-- 最大保存天数--> | |||
<maxHistory>${logging.maxHistory}</maxHistory> | |||
<totalSizeCap>${logging.totalSizeCap}</totalSizeCap> | |||
<maxFileSize>${logging.maxFileSize}</maxFileSize> | |||
</rollingPolicy> | |||
<!--编码器--> | |||
<encoder> | |||
<pattern>${logging.pattern}</pattern> | |||
<charset>${logging.charset}</charset> | |||
</encoder> | |||
</appender> | |||
<appender name="file.async" class="ch.qos.logback.classic.AsyncAppender"> | |||
<discardingThreshold>0</discardingThreshold> | |||
<queueSize>512</queueSize> | |||
<includeCallerData>true</includeCallerData> | |||
<appender-ref ref="LOG_FILE" /> | |||
</appender> | |||
<logger name="com.tuoheng" level="DEBUG" additivity="false"> | |||
<appender-ref ref="console" /> | |||
<appender-ref ref="file.async" /> | |||
</logger> | |||
<!--log4jdbc --> | |||
<logger name="jdbc.sqltiming" level="DEBUG" additivity="false"> | |||
<appender-ref ref="file.async" /> | |||
</logger> | |||
<root level="INFO"> | |||
<appender-ref ref="console" /> | |||
<appender-ref ref="file.async" /> | |||
</root> | |||
</configuration> |
@@ -0,0 +1,25 @@ | |||
<?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.tuoheng.mapper.AreaMapper"> | |||
<resultMap id="BaseResultMap" type="com.tuoheng.model.entity.Area"> | |||
<id property="id" column="id" jdbcType="BIGINT"/> | |||
<result property="createTime" column="create_time" jdbcType="TIMESTAMP"/> | |||
<result property="updateTime" column="update_time" jdbcType="TIMESTAMP"/> | |||
<result property="createUser" column="create_user" jdbcType="BIGINT"/> | |||
<result property="updateUser" column="update_user" jdbcType="BIGINT"/> | |||
<result property="name" column="name" jdbcType="VARCHAR"/> | |||
<result property="cityCode" column="city_code" jdbcType="VARCHAR"/> | |||
<result property="cityName" column="city_name" jdbcType="VARCHAR"/> | |||
<result property="mark" column="mark" jdbcType="TINYINT"/> | |||
<result property="editorName" column="editor_name" jdbcType="VARCHAR"/> | |||
</resultMap> | |||
<sql id="Base_Column_List"> | |||
id,create_time,update_time, | |||
create_user,update_user,name, | |||
city_code,city_name,mark,editor_name | |||
</sql> | |||
</mapper> |
@@ -0,0 +1,50 @@ | |||
<?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.tuoheng.mapper.AuthoritiesMapper"> | |||
<insert id="batchInsert" parameterType="java.util.List"> | |||
insert into authorities (user_id, username, authority, create_user) | |||
VALUES | |||
<foreach collection="list" item="it" separator=","> | |||
(#{it.userId}, #{it.username}, #{it.authority}, #{it.createUser}) | |||
</foreach> | |||
</insert> | |||
<delete id="deleteByUserIdAndClient"> | |||
delete | |||
from authorities | |||
where user_id = #{userId} | |||
and authority = #{clientId} | |||
</delete> | |||
<select id="selectByUserId" resultType="com.tuoheng.model.po.AuthoritiesPo"> | |||
SELECT id, user_id, username, authority | |||
FROM authorities | |||
WHERE user_id = #{userId} | |||
</select> | |||
<select id="selectListByUserIdAndClientId" resultType="com.tuoheng.model.po.AuthoritiesPo"> | |||
SELECT id, user_id, username, authority | |||
FROM authorities | |||
WHERE user_id = #{userId} | |||
<if test="query.clientId != null and query.clientId != ''"> | |||
and authority LIKE concat('%',#{query.clientId},'%') | |||
</if> | |||
</select> | |||
<select id="selectByUserIds" resultType="com.tuoheng.model.po.AuthoritiesPo"> | |||
SELECT id, user_id, username, authority | |||
FROM authorities | |||
where user_id IN | |||
<foreach item="item" index="index" collection="list" open="(" separator="," close=")"> | |||
#{item} | |||
</foreach> | |||
</select> | |||
<select id="selectByUserIdsAndClient" resultType="com.tuoheng.model.po.AuthoritiesPo"> | |||
SELECT id, user_id, username, authority | |||
FROM authorities | |||
WHERE authority LIKE concat('%', #{clientId}, '%') | |||
and | |||
user_id IN | |||
<foreach item="item" index="index" collection="list" open="(" separator="," close=")"> | |||
#{item} | |||
</foreach> | |||
</select> | |||
</mapper> |
@@ -0,0 +1,32 @@ | |||
<?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.tuoheng.mapper.CityMapper"> | |||
<resultMap id="BaseResultMap" type="com.tuoheng.model.dto.City"> | |||
<id property="id" column="id" jdbcType="INTEGER"/> | |||
<result property="pid" column="pid" jdbcType="INTEGER"/> | |||
<result property="level" column="level" jdbcType="TINYINT"/> | |||
<result property="name" column="name" jdbcType="VARCHAR"/> | |||
<result property="citycode" column="citycode" jdbcType="VARCHAR"/> | |||
<result property="pAdcode" column="p_adcode" jdbcType="VARCHAR"/> | |||
<result property="adcode" column="adcode" jdbcType="VARCHAR"/> | |||
<result property="lng" column="lng" jdbcType="INTEGER"/> | |||
<result property="lat" column="lat" jdbcType="INTEGER"/> | |||
<result property="sort" column="sort" jdbcType="TINYINT"/> | |||
<result property="createUser" column="create_user" jdbcType="INTEGER"/> | |||
<result property="createTime" column="create_time" jdbcType="TIMESTAMP"/> | |||
<result property="updateUser" column="update_user" jdbcType="INTEGER"/> | |||
<result property="updateTime" column="update_time" jdbcType="TIMESTAMP"/> | |||
<result property="mark" column="mark" jdbcType="TINYINT"/> | |||
</resultMap> | |||
<sql id="Base_Column_List"> | |||
id,pid,level, | |||
name,citycode,p_adcode, | |||
adcode,lng,lat, | |||
sort,create_user,create_time, | |||
update_user,update_time,mark | |||
</sql> | |||
</mapper> |
@@ -0,0 +1,9 @@ | |||
<?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.tuoheng.mapper.ClientMapper"> | |||
<select id="getAllClient" resultType="com.tuoheng.model.dto.ClientDto"> | |||
select client_id as clientId, client_name as clientName from oauth2_registered_client | |||
</select> | |||
</mapper> |
@@ -0,0 +1,101 @@ | |||
<?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.tuoheng.mapper.ClientUserMapper"> | |||
<insert id="insertClientUser" parameterType="com.tuoheng.model.po.UserPo" keyProperty="id" useGeneratedKeys="true"> | |||
insert into users (username, password, create_user, tenant_id, is_tenant, role_id) | |||
values (#{username}, #{password}, #{createUser}, #{tenantId}, #{isTenant}, #{roleId}) | |||
</insert> | |||
<select id="judgeCreateByUserName" parameterType="java.lang.String" resultType="int"> | |||
select count(1) | |||
from users | |||
where username = #{username} | |||
and enabled = 1 | |||
</select> | |||
<select id="getUserByUserName" parameterType="java.lang.String" resultType="com.tuoheng.model.po.UserPo"> | |||
select * | |||
from users | |||
where username = #{username} | |||
and enabled = 1 | |||
</select> | |||
<select id="getUserRoleIdByUserName" parameterType="java.lang.String" resultType="int"> | |||
select role_id | |||
from users | |||
where username = #{username} | |||
and enabled = 1 | |||
</select> | |||
<select id="selectByUserId" resultType="com.tuoheng.model.po.UserPo"> | |||
SELECT id, | |||
username, | |||
`password`, | |||
enabled, | |||
tenant_id, | |||
is_tenant, | |||
role_id, | |||
is_expire, | |||
is_able | |||
FROM users | |||
WHERE id = #{userId} | |||
</select> | |||
<select id="selectByTenantId" resultType="com.tuoheng.model.po.UserPo"> | |||
SELECT * | |||
FROM users | |||
WHERE tenant_id = #{tenantId} | |||
# 用户没有被删除 | |||
and enabled = 1 | |||
</select> | |||
<select id="selectByTenantIdAndPage" resultType="com.tuoheng.model.vo.UserVo"> | |||
SELECT | |||
u.username, | |||
u.create_time, | |||
u.update_time, | |||
a.authority platformCode | |||
FROM | |||
users u, | |||
authorities a | |||
WHERE | |||
u.tenant_id = #{query.tenantId} | |||
<if test="query.username != null and query.username != ''"> | |||
and u.username LIKE concat('%',#{query.username},'%') | |||
</if> | |||
<if test="query.platformCode != null and query.platformCode != ''"> | |||
and a.authority LIKE concat('%',#{query.platformCode},'%') | |||
</if> | |||
AND a.user_id = u.id | |||
AND u.enabled = 1 | |||
GROUP BY u.username | |||
</select> | |||
<select id="getUserByRoleId" resultType="com.tuoheng.model.po.UserPo"> | |||
SELECT * | |||
FROM users | |||
WHERE role_id = #{roleId} | |||
# 用户没有被删除 | |||
and enabled = 1 | |||
</select> | |||
<update id="updatePass" parameterType="com.tuoheng.model.po.UserPo"> | |||
update users | |||
<set> | |||
<if test="password != null and password != ''"> | |||
password = #{password}, | |||
</if> | |||
<if test="updateUser != null"> | |||
update_user = #{updateUser}, | |||
</if> | |||
<if test="enabled != null"> | |||
enabled = #{enabled}, | |||
</if> | |||
<if test="isAble != null"> | |||
is_able = #{isAble}, | |||
</if> | |||
<if test="isExpire != null"> | |||
is_expire = #{isExpire}, | |||
</if> | |||
</set> | |||
where username = #{username,jdbcType=VARCHAR} | |||
</update> | |||
</mapper> |
@@ -0,0 +1,42 @@ | |||
<?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.tuoheng.mapper.ClientUserRoleMapper"> | |||
<insert id="batchInsert" parameterType="java.util.List"> | |||
insert into t_client_user_role (user_id, client_id, role_id, create_user,role_name) | |||
VALUES | |||
<foreach collection="list" item="it" separator=","> | |||
(#{it.userId}, #{it.clientId}, #{it.roleId}, #{it.createUser},#{it.roleName}) | |||
</foreach> | |||
</insert> | |||
<insert id="insert" parameterType="com.tuoheng.model.po.ClientUserRolePo"> | |||
insert into t_client_user_role (user_id, client_id, role_id, create_user, role_name) | |||
VALUES (#{userId}, #{clientId}, #{roleId}, #{createUser}, #{roleName}) | |||
</insert> | |||
<update id="updateUserClientRole" parameterType="com.tuoheng.model.po.ClientUserRolePo"> | |||
update t_client_user_role | |||
<set> | |||
<if test="roleId != null"> | |||
role_id = #{roleId}, | |||
</if> | |||
<if test="updateUser != null"> | |||
update_user = #{updateUser}, | |||
</if> | |||
</set> | |||
where user_id = #{userId} and client_id = #{clientId} | |||
</update> | |||
<delete id="deleteByUserIdAndClient"> | |||
delete | |||
from t_client_user_role | |||
where user_id = #{userId} | |||
and client_id = #{clientId} | |||
</delete> | |||
<select id="selectListByUserId" resultType="com.tuoheng.model.po.ClientUserRolePo"> | |||
SELECT * | |||
FROM t_client_user_role | |||
WHERE user_id = #{userId} | |||
</select> | |||
</mapper> |
@@ -0,0 +1,31 @@ | |||
<?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.tuoheng.mapper.DictDataMapper"> | |||
<resultMap id="BaseResultMap" type="com.tuoheng.model.entity.DictData"> | |||
<id property="id" column="id" jdbcType="BIGINT"/> | |||
<result property="dictName" column="dict_name" jdbcType="VARCHAR"/> | |||
<result property="dictType" column="dict_type" jdbcType="VARCHAR"/> | |||
<result property="value" column="value" jdbcType="VARCHAR"/> | |||
<result property="code" column="code" jdbcType="VARCHAR"/> | |||
<result property="status" column="status" jdbcType="TINYINT"/> | |||
<result property="createUser" column="create_user" jdbcType="VARCHAR"/> | |||
<result property="createTime" column="create_time" jdbcType="TIMESTAMP"/> | |||
<result property="updateUser" column="update_user" jdbcType="VARCHAR"/> | |||
<result property="updateTime" column="update_time" jdbcType="TIMESTAMP"/> | |||
<result property="remark" column="remark" jdbcType="VARCHAR"/> | |||
<result property="tenantId" column="tenant_id" jdbcType="VARCHAR"/> | |||
<result property="mark" column="mark" jdbcType="TINYINT"/> | |||
<result property="sort" column="sort" jdbcType="INTEGER"/> | |||
</resultMap> | |||
<sql id="Base_Column_List"> | |||
id,dict_name,dict_type, | |||
value,code,status, | |||
create_user,create_time,update_user, | |||
update_time,remark,tenant_id, | |||
mark,sort | |||
</sql> | |||
</mapper> |
@@ -0,0 +1,26 @@ | |||
<?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.tuoheng.mapper.DictMapper"> | |||
<resultMap id="BaseResultMap" type="com.tuoheng.model.entity.Dict"> | |||
<id property="id" column="id" jdbcType="BIGINT"/> | |||
<result property="dictName" column="dict_name" jdbcType="VARCHAR"/> | |||
<result property="type" column="type" jdbcType="VARCHAR"/> | |||
<result property="status" column="status" jdbcType="TINYINT"/> | |||
<result property="createUser" column="create_user" jdbcType="VARCHAR"/> | |||
<result property="createTime" column="create_time" jdbcType="TIMESTAMP"/> | |||
<result property="updateUser" column="update_user" jdbcType="VARCHAR"/> | |||
<result property="updateTime" column="update_time" jdbcType="TIMESTAMP"/> | |||
<result property="remark" column="remark" jdbcType="VARCHAR"/> | |||
<result property="mark" column="mark" jdbcType="TINYINT"/> | |||
</resultMap> | |||
<sql id="Base_Column_List"> | |||
id,dict_name,type, | |||
status,create_user,create_time, | |||
update_user,update_time,remark, | |||
mark | |||
</sql> | |||
</mapper> |
@@ -0,0 +1,41 @@ | |||
<?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.tuoheng.mapper.information.InspectionFileMapper"> | |||
<resultMap id="BaseResultMap" type="com.tuoheng.model.entity.InspectionFile"> | |||
<id property="id" column="id" jdbcType="OTHER"/> | |||
<result property="fileCode" column="file_code" jdbcType="VARCHAR"/> | |||
<result property="inspectionName" column="inspection_name" jdbcType="VARCHAR"/> | |||
<result property="fileName" column="file_name" jdbcType="VARCHAR"/> | |||
<result property="fileThumbnail" column="file_thumbnail" jdbcType="VARCHAR"/> | |||
<result property="fileOriginal" column="file_original" jdbcType="VARCHAR"/> | |||
<result property="fileImage" column="file_image" jdbcType="VARCHAR"/> | |||
<result property="latitude" column="latitude" jdbcType="VARCHAR"/> | |||
<result property="longitude" column="longitude" jdbcType="VARCHAR"/> | |||
<result property="dealStatus" column="deal_status" jdbcType="TINYINT"/> | |||
<result property="status" column="status" jdbcType="TINYINT"/> | |||
<result property="tenantUsername" column="tenant_username" jdbcType="VARCHAR"/> | |||
<result property="clientId" column="client_id" jdbcType="VARCHAR"/> | |||
<result property="industry" column="industry" jdbcType="VARCHAR"/> | |||
<result property="createUser" column="create_user" jdbcType="INTEGER"/> | |||
<result property="createTime" column="create_time" jdbcType="TIMESTAMP"/> | |||
<result property="updateUser" column="update_user" jdbcType="INTEGER"/> | |||
<result property="updateTime" column="update_time" jdbcType="TIMESTAMP"/> | |||
<result property="mark" column="mark" jdbcType="TINYINT"/> | |||
<result property="questionName" column="question_name" jdbcType="VARCHAR"/> | |||
<result property="questionId" column="question_id" jdbcType="VARCHAR"/> | |||
</resultMap> | |||
<sql id="Base_Column_List"> | |||
id,file_code,inspection_name, | |||
file_name,file_thumbnail,file_original, | |||
file_image,latitude,longitude, | |||
deal_status,status,tenant_username, | |||
client_id,industry,create_user, | |||
create_time,update_user,update_time, | |||
mark,question_name,question_id | |||
</sql> | |||
</mapper> |
@@ -0,0 +1,39 @@ | |||
<?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.tuoheng.mapper.information.InspectionMapper"> | |||
<resultMap id="BaseResultMap" type="com.tuoheng.model.entity.Inspection"> | |||
<id property="id" column="id" jdbcType="INTEGER"/> | |||
<result property="code" column="code" jdbcType="VARCHAR"/> | |||
<result property="name" column="name" jdbcType="VARCHAR"/> | |||
<result property="inspectionWay" column="inspection_way" jdbcType="VARCHAR"/> | |||
<result property="airport" column="airport" jdbcType="VARCHAR"/> | |||
<result property="inspectionTime" column="inspection_time" jdbcType="TIMESTAMP"/> | |||
<result property="duration" column="duration" jdbcType="VARCHAR"/> | |||
<result property="status" column="status" jdbcType="TINYINT"/> | |||
<result property="clientId" column="client_id" jdbcType="VARCHAR"/> | |||
<result property="industry" column="industry" jdbcType="VARCHAR"/> | |||
<result property="tenantUsername" column="tenant_username" jdbcType="VARCHAR"/> | |||
<result property="srtUrl" column="srt_url" jdbcType="VARCHAR"/> | |||
<result property="videoUrl" column="video_url" jdbcType="VARCHAR"/> | |||
<result property="createTime" column="create_time" jdbcType="TIMESTAMP"/> | |||
<result property="updateTime" column="update_time" jdbcType="TIMESTAMP"/> | |||
<result property="createUser" column="create_user" jdbcType="INTEGER"/> | |||
<result property="updateUser" column="update_user" jdbcType="INTEGER"/> | |||
<result property="mark" column="mark" jdbcType="TINYINT"/> | |||
<result property="inspectionType" column="inspection_type" jdbcType="INTEGER"/> | |||
<result property="flightMileage" column="flight_Mileage" jdbcType="VARCHAR"/> | |||
</resultMap> | |||
<sql id="Base_Column_List"> | |||
id,code,name, | |||
inspection_way,airport,inspection_time, | |||
duration,status,client_id, | |||
industry,tenant_username,srt_url, | |||
video_url,create_time,update_time, | |||
create_user,update_user,mark, | |||
inspection_type,flight_Mileage | |||
</sql> | |||
</mapper> |
@@ -0,0 +1,25 @@ | |||
<?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.tuoheng.mapper.MarkerMapper"> | |||
<resultMap id="BaseResultMap" type="com.tuoheng.model.entity.Marker"> | |||
<id property="id" column="id" jdbcType="BIGINT"/> | |||
<result property="createTime" column="create_time" jdbcType="TIMESTAMP"/> | |||
<result property="updateTime" column="update_time" jdbcType="TIMESTAMP"/> | |||
<result property="createUser" column="create_user" jdbcType="BIGINT"/> | |||
<result property="updateUser" column="update_user" jdbcType="BIGINT"/> | |||
<result property="name" column="name" jdbcType="VARCHAR"/> | |||
<result property="areaId" column="area_id" jdbcType="BIGINT"/> | |||
<result property="phone" column="phone" jdbcType="VARCHAR"/> | |||
<result property="mark" column="mark" jdbcType="TINYINT"/> | |||
<result property="editorName" column="editor_name" jdbcType="VARCHAR"/> | |||
</resultMap> | |||
<sql id="Base_Column_List"> | |||
id,create_time,update_time, | |||
create_user,update_user,name, | |||
area_id,phone,mark,editor_name | |||
</sql> | |||
</mapper> |
@@ -0,0 +1,53 @@ | |||
<?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.tuoheng.mapper.op.MenusMapper"> | |||
<resultMap id="BaseResultMap" type="com.tuoheng.model.entity.Menu"> | |||
<id property="id" column="id" jdbcType="INTEGER"/> | |||
<result property="createTime" column="create_time" jdbcType="TIMESTAMP"/> | |||
<result property="updateTime" column="update_time" jdbcType="TIMESTAMP"/> | |||
<result property="createUser" column="create_user" jdbcType="INTEGER"/> | |||
<result property="updateUser" column="update_user" jdbcType="INTEGER"/> | |||
<result property="mark" column="mark" jdbcType="TINYINT"/> | |||
<result property="parentId" column="parent_id" jdbcType="INTEGER"/> | |||
<result property="name" column="name" jdbcType="VARCHAR"/> | |||
<result property="clientId" column="client_id" jdbcType="VARCHAR"/> | |||
<result property="menuIcon" column="menu_icon" jdbcType="VARCHAR"/> | |||
<result property="path" column="path" jdbcType="VARCHAR"/> | |||
<result property="component" column="component" jdbcType="VARCHAR"/> | |||
<result property="target" column="target" jdbcType="VARCHAR"/> | |||
<result property="isHidden" column="is_hidden" jdbcType="INTEGER"/> | |||
<result property="sort" column="sort" jdbcType="INTEGER"/> | |||
<result property="status" column="status" jdbcType="INTEGER"/> | |||
</resultMap> | |||
<sql id="Base_Column_List"> | |||
id,create_time,update_time, | |||
create_user,update_user,mark, | |||
parent_id,name,client_id, | |||
menu_icon,path,component, | |||
target,is_hidden,sort,status | |||
</sql> | |||
<!--根据角色id获取对应的菜单集合 无父级--> | |||
<select id="getOpMenusByRoleId" resultType="com.tuoheng.model.entity.Menu"> | |||
select | |||
<include refid="Base_Column_List"/> | |||
from op_menus | |||
where mark = 1 and parent_id = 0 | |||
and status = 1 | |||
and id in (select menu_id from op_role_menu where role_id = #{roleId} and mark = 1) | |||
order by sort asc | |||
</select> | |||
<!--根据父级id查询所属对应的菜单列表--> | |||
<select id="getChildrenMenuByPid" resultType="com.tuoheng.model.entity.Menu"> | |||
select | |||
<include refid="Base_Column_List"/> | |||
from op_menus | |||
where mark = 1 and status = 1 and parent_id = #{parentId} | |||
order by sort asc | |||
</select> | |||
</mapper> |
@@ -0,0 +1,28 @@ | |||
<?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.tuoheng.mapper.Oauth2RegisteredClientMapper"> | |||
<resultMap id="BaseResultMap" type="com.tuoheng.model.dto.Oauth2RegisteredClient"> | |||
<id property="id" column="id" jdbcType="VARCHAR"/> | |||
<result property="clientId" column="client_id" jdbcType="VARCHAR"/> | |||
<result property="clientIdIssuedAt" column="client_id_issued_at" jdbcType="TIMESTAMP"/> | |||
<result property="clientSecret" column="client_secret" jdbcType="VARCHAR"/> | |||
<result property="clientSecretExpiresAt" column="client_secret_expires_at" jdbcType="TIMESTAMP"/> | |||
<result property="clientName" column="client_name" jdbcType="VARCHAR"/> | |||
<result property="clientAuthenticationMethods" column="client_authentication_methods" jdbcType="VARCHAR"/> | |||
<result property="authorizationGrantTypes" column="authorization_grant_types" jdbcType="VARCHAR"/> | |||
<result property="redirectUris" column="redirect_uris" jdbcType="VARCHAR"/> | |||
<result property="scopes" column="scopes" jdbcType="VARCHAR"/> | |||
<result property="clientSettings" column="client_settings" jdbcType="VARCHAR"/> | |||
<result property="tokenSettings" column="token_settings" jdbcType="VARCHAR"/> | |||
</resultMap> | |||
<sql id="Base_Column_List"> | |||
id,client_id,client_id_issued_at, | |||
client_secret,client_secret_expires_at,client_name, | |||
client_authentication_methods,authorization_grant_types,redirect_uris, | |||
scopes,client_settings,token_settings | |||
</sql> | |||
</mapper> |
@@ -0,0 +1,41 @@ | |||
<?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.tuoheng.mapper.op.PermissionsMapper"> | |||
<resultMap id="BaseResultMap" type="com.tuoheng.model.entity.Permissions"> | |||
<id property="id" column="id" jdbcType="INTEGER"/> | |||
<result property="createTime" column="create_time" jdbcType="TIMESTAMP"/> | |||
<result property="updateTime" column="update_time" jdbcType="TIMESTAMP"/> | |||
<result property="createUser" column="create_user" jdbcType="INTEGER"/> | |||
<result property="updateUser" column="update_user" jdbcType="INTEGER"/> | |||
<result property="mark" column="mark" jdbcType="TINYINT"/> | |||
<result property="clientId" column="client_id" jdbcType="VARCHAR"/> | |||
<result property="code" column="code" jdbcType="VARCHAR"/> | |||
<result property="name" column="name" jdbcType="VARCHAR"/> | |||
<result property="remark" column="remark" jdbcType="VARCHAR"/> | |||
<result property="type" column="type" jdbcType="INTEGER"/> | |||
<result property="menuId" column="menu_id" jdbcType="INTEGER"/> | |||
<result property="apiUrl" column="api_url" jdbcType="VARCHAR"/> | |||
</resultMap> | |||
<sql id="Base_Column_List"> | |||
id,create_time,update_time, | |||
create_user,update_user,mark, | |||
client_id,code,name, | |||
remark,type,menu_id, | |||
api_url | |||
</sql> | |||
<!--根据role_id获取对应的权限集合--> | |||
<select id="getOpPermissionsByRoleId" resultType="com.tuoheng.model.entity.Permissions"> | |||
select | |||
<include refid="Base_Column_List"/> | |||
from op_permissions | |||
where mark = 1 | |||
and id in (select permission_id from op_role_permission where role_id = #{roleId} and mark = 1) | |||
</select> | |||
</mapper> |
@@ -0,0 +1,24 @@ | |||
<?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.tuoheng.mapper.PlatformMapper"> | |||
<resultMap id="BaseResultMap" type="com.tuoheng.model.dto.Platform"> | |||
<id property="id" column="id" jdbcType="VARCHAR"/> | |||
<result property="platformCode" column="platform_code" jdbcType="VARCHAR"/> | |||
<result property="platformName" column="platform_name" jdbcType="VARCHAR"/> | |||
<result property="platformUrl" column="platform_url" jdbcType="VARCHAR"/> | |||
<result property="createUser" column="create_user" jdbcType="VARCHAR"/> | |||
<result property="createTime" column="create_time" jdbcType="TIMESTAMP"/> | |||
<result property="updateUser" column="update_user" jdbcType="VARCHAR"/> | |||
<result property="updateTime" column="update_time" jdbcType="TIMESTAMP"/> | |||
<result property="mark" column="mark" jdbcType="TINYINT"/> | |||
</resultMap> | |||
<sql id="Base_Column_List"> | |||
id,platform_code,platform_name, | |||
platform_url,create_user,create_time, | |||
update_user,update_time,mark | |||
</sql> | |||
</mapper> |
@@ -0,0 +1,30 @@ | |||
<?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.tuoheng.mapper.information.ReportMapper"> | |||
<resultMap id="BaseResultMap" type="com.tuoheng.model.entity.Report"> | |||
<id property="id" column="id" jdbcType="SMALLINT"/> | |||
<result property="reportNo" column="report_no" jdbcType="VARCHAR"/> | |||
<result property="inspectionCode" column="inspection_code" jdbcType="VARCHAR"/> | |||
<result property="inspectionName" column="inspection_name" jdbcType="VARCHAR"/> | |||
<result property="reportType" column="report_type" jdbcType="OTHER"/> | |||
<result property="clientId" column="client_id" jdbcType="VARCHAR"/> | |||
<result property="industry" column="industry" jdbcType="VARCHAR"/> | |||
<result property="tenantUsername" column="tenant_username" jdbcType="VARCHAR"/> | |||
<result property="createUser" column="create_user" jdbcType="INTEGER"/> | |||
<result property="createTime" column="create_time" jdbcType="TIMESTAMP"/> | |||
<result property="updateUser" column="update_user" jdbcType="INTEGER"/> | |||
<result property="updateTime" column="update_time" jdbcType="TIMESTAMP"/> | |||
<result property="mark" column="mark" jdbcType="TINYINT"/> | |||
</resultMap> | |||
<sql id="Base_Column_List"> | |||
id,report_no,inspection_code, | |||
inspection_name,report_type,client_id, | |||
industry,tenant_username,create_user, | |||
create_time,update_user,update_time, | |||
mark | |||
</sql> | |||
</mapper> |
@@ -0,0 +1,23 @@ | |||
<?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.tuoheng.mapper.op.RoleMenuMapper"> | |||
<resultMap id="BaseResultMap" type="com.tuoheng.model.entity.RoleMenu"> | |||
<id property="id" column="id" jdbcType="INTEGER"/> | |||
<result property="createTime" column="create_time" jdbcType="TIMESTAMP"/> | |||
<result property="updateTime" column="update_time" jdbcType="TIMESTAMP"/> | |||
<result property="createUser" column="create_user" jdbcType="INTEGER"/> | |||
<result property="updateUser" column="update_user" jdbcType="INTEGER"/> | |||
<result property="mark" column="mark" jdbcType="TINYINT"/> | |||
<result property="roleId" column="role_id" jdbcType="INTEGER"/> | |||
<result property="menuId" column="menu_id" jdbcType="INTEGER"/> | |||
</resultMap> | |||
<sql id="Base_Column_List"> | |||
id,create_time,update_time, | |||
create_user,update_user,mark, | |||
role_id,menu_id | |||
</sql> | |||
</mapper> |
@@ -0,0 +1,23 @@ | |||
<?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.tuoheng.mapper.op.RolePermissionMapper"> | |||
<resultMap id="BaseResultMap" type="com.tuoheng.model.entity.RolePermission"> | |||
<id property="id" column="id" jdbcType="INTEGER"/> | |||
<result property="createTime" column="create_time" jdbcType="TIMESTAMP"/> | |||
<result property="updateTime" column="update_time" jdbcType="TIMESTAMP"/> | |||
<result property="createUser" column="create_user" jdbcType="INTEGER"/> | |||
<result property="updateUser" column="update_user" jdbcType="INTEGER"/> | |||
<result property="mark" column="mark" jdbcType="TINYINT"/> | |||
<result property="roleId" column="role_id" jdbcType="INTEGER"/> | |||
<result property="permissionId" column="permission_id" jdbcType="INTEGER"/> | |||
</resultMap> | |||
<sql id="Base_Column_List"> | |||
id,create_time,update_time, | |||
create_user,update_user,mark, | |||
role_id,permission_id | |||
</sql> | |||
</mapper> |
@@ -0,0 +1,24 @@ | |||
<?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.tuoheng.mapper.op.RolesMapper"> | |||
<resultMap id="BaseResultMap" type="com.tuoheng.model.entity.Roles"> | |||
<id property="id" column="id" jdbcType="INTEGER"/> | |||
<result property="createTime" column="create_time" jdbcType="TIMESTAMP"/> | |||
<result property="updateTime" column="update_time" jdbcType="TIMESTAMP"/> | |||
<result property="createUser" column="create_user" jdbcType="INTEGER"/> | |||
<result property="updateUser" column="update_user" jdbcType="INTEGER"/> | |||
<result property="roleName" column="role_name" jdbcType="VARCHAR"/> | |||
<result property="remark" column="mark" jdbcType="VARCHAR"/> | |||
<result property="status" column="status" jdbcType="TINYINT"/> | |||
<result property="mark" column="mark" jdbcType="TINYINT"/> | |||
</resultMap> | |||
<sql id="Base_Column_List"> | |||
id,create_time,update_time, | |||
create_user,update_user,role_name, | |||
remark,status,mark | |||
</sql> | |||
</mapper> |
@@ -0,0 +1,6 @@ | |||
<?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.tuoheng.mapper.TenantEmployMapper"> | |||
</mapper> |
@@ -0,0 +1,28 @@ | |||
<?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.tuoheng.mapper.TenantItemMapper"> | |||
<resultMap id="BaseResultMap" type="com.tuoheng.model.entity.TenantItem"> | |||
<id property="id" column="id" jdbcType="BIGINT"/> | |||
<result property="createTime" column="create_time" jdbcType="TIMESTAMP"/> | |||
<result property="updateTime" column="update_time" jdbcType="TIMESTAMP"/> | |||
<result property="createUser" column="create_user" jdbcType="BIGINT"/> | |||
<result property="updateUser" column="update_user" jdbcType="BIGINT"/> | |||
<result property="markerId" column="marker_id" jdbcType="BIGINT"/> | |||
<result property="areaId" column="area_id" jdbcType="BIGINT"/> | |||
<result property="tenantId" column="tenant_id" jdbcType="BIGINT"/> | |||
<result property="projectCode" column="project_code" jdbcType="VARCHAR"/> | |||
<result property="contractCode" column="contract_code" jdbcType="VARCHAR"/> | |||
<result property="beginTime" column="begin_time" jdbcType="TIMESTAMP"/> | |||
<result property="endTime" column="end_time" jdbcType="TIMESTAMP"/> | |||
</resultMap> | |||
<sql id="Base_Column_List"> | |||
id,create_time,update_time, | |||
create_user,update_user,marker_id, | |||
tenant_id,project_code,contract_code, | |||
begin_time,end_time,area_id | |||
</sql> | |||
</mapper> |
@@ -0,0 +1,70 @@ | |||
<?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.tuoheng.mapper.TenantMapper"> | |||
<sql id="Base_Column_List"> | |||
id,create_time,update_time,create_user,update_user,user_id,remark,`code`,`name`, | |||
enabled,province_code,province_name, | |||
city_code,city_name,district_code,district_name,customer, | |||
customer_phone,adress,lng,lat | |||
</sql> | |||
<insert id="insertTenant" parameterType="com.tuoheng.model.po.TenantPo" keyProperty="id" useGeneratedKeys="true"> | |||
INSERT INTO t_tenant (user_id, remark, `code`, `name`, province_code, province_name, city_code, city_name, | |||
district_code, district_name, customer, customer_phone, adress, lng, lat) | |||
VALUES (#{userId}, #{remark}, #{code}, #{name}, #{provinceCode}, #{provinceName}, #{cityCode}, #{cityName}, | |||
#{districtCode}, #{districtName}, #{customer}, #{customerPhone}, #{adress}, #{lng}, #{lat}) | |||
</insert> | |||
<update id="updateById" parameterType="com.tuoheng.model.po.TenantPo"> | |||
update t_tenant | |||
<set> | |||
<if test="name != null and name !=''"> | |||
name = #{name}, | |||
</if> | |||
<if test="enabled != null"> | |||
enabled = #{enabled}, | |||
</if> | |||
province_code=#{provinceCode}, | |||
province_name=#{provinceName}, | |||
city_code =#{cityCode}, | |||
city_name=#{cityName}, | |||
district_code =#{districtCode}, | |||
district_name =#{districtName}, | |||
customer =#{customer}, | |||
customer_phone =#{customerPhone}, | |||
adress =#{adress}, | |||
lng =#{lng}, | |||
lat =#{lat} | |||
</set> | |||
where id = #{id} | |||
</update> | |||
<select id="getByCode" resultType="com.tuoheng.model.dto.TTenant"> | |||
select * | |||
from tuoheng_oidc.t_tenant | |||
where code = #{code} | |||
and enabled = 1 | |||
</select> | |||
<select id="findList" resultType="com.tuoheng.model.vo.TenantVo"> | |||
SELECT t.id, t.user_id userId, t.remark, t.code tenantCode, | |||
t.name tenantName,t.customer,t.customer_phone | |||
,t.province_code,t.province_name,t.city_code,t.city_name,t.district_code,t.district_name,u.username | |||
username,t.update_time updateTime,t.create_time createTime,u.is_able status | |||
FROM t_tenant t,users u | |||
WHERE t.enabled = 1 and t.user_id =u.id | |||
<if test="query.tenantName != null and query.tenantName != ''"> | |||
and t.name LIKE concat('%',#{query.tenantName},'%') | |||
</if> | |||
<if test="query.username != null and query.username != ''"> | |||
and u.username LIKE concat('%',#{query.username},'%') | |||
</if> | |||
<if test="query.status != null"> | |||
and u.is_able =#{query.status} | |||
</if> | |||
ORDER BY t.create_time desc | |||
</select> | |||
<select id="selectById" resultType="com.tuoheng.model.po.TenantPo"> | |||
SELECT | |||
<include refid="Base_Column_List"/> | |||
FROM t_tenant | |||
WHERE id = #{id} | |||
and enabled = 1 | |||
</select> | |||
</mapper> |
@@ -0,0 +1,31 @@ | |||
<?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.tuoheng.mapper.information.WorkorderMapper"> | |||
<resultMap id="BaseResultMap" type="com.tuoheng.model.entity.Workorder"> | |||
<id property="id" column="id" jdbcType="OTHER"/> | |||
<result property="code" column="code" jdbcType="VARCHAR"/> | |||
<result property="status" column="status" jdbcType="TINYINT"/> | |||
<result property="workCompleteTime" column="work_complete_time" jdbcType="TIMESTAMP"/> | |||
<result property="createUser" column="create_user" jdbcType="INTEGER"/> | |||
<result property="handledUser" column="handled_user" jdbcType="INTEGER"/> | |||
<result property="industry" column="industry" jdbcType="VARCHAR"/> | |||
<result property="clientId" column="client_id" jdbcType="VARCHAR"/> | |||
<result property="tenantUsername" column="tenant_username" jdbcType="VARCHAR"/> | |||
<result property="createTime" column="create_time" jdbcType="TIMESTAMP"/> | |||
<result property="updateUser" column="update_user" jdbcType="INTEGER"/> | |||
<result property="updateTime" column="update_time" jdbcType="TIMESTAMP"/> | |||
<result property="mark" column="mark" jdbcType="TINYINT"/> | |||
<result property="handledUserName" column="handled_user_name" jdbcType="VARCHAR"/> | |||
</resultMap> | |||
<sql id="Base_Column_List"> | |||
id,code,status, | |||
work_complete_time,create_user,handled_user, | |||
industry,client_id,tenant_username, | |||
create_time,update_user,update_time, | |||
mark,handled_user_name | |||
</sql> | |||
</mapper> |