mirror of
https://gitee.com/lab1024/smart-admin.git
synced 2026-02-14 05:34:26 +08:00
v1.0.4
This commit is contained in:
@@ -0,0 +1,8 @@
|
||||
/ ____| | | /\ | | (_)
|
||||
| (___ _ __ ___ __ _ _ __| |_ / \ __| |_ __ ___ _ _ __
|
||||
\___ \| '_ ` _ \ / _` | '__| __| / /\ \ / _` | '_ ` _ \| | '_ \
|
||||
____) | | | | | | (_| | | | |_ / ____ \ (_| | | | | | | | | | |
|
||||
|_____/|_| |_| |_|\__,_|_| \__/_/ \_\__,_|_| |_| |_|_|_| |_|
|
||||
|
||||
SmartAdmin v1.0.0
|
||||
|
||||
@@ -0,0 +1,122 @@
|
||||
######################### server ###################
|
||||
server.servlet.context-path=/smart-admin-api
|
||||
server.port=10086
|
||||
spring.profiles.active=dev
|
||||
|
||||
######################### tomcat ###################
|
||||
server.tomcat.basedir=/home/logs/smartadmin/tomcat-logs
|
||||
server.tomcat.accesslog.enabled=true
|
||||
server.tomcat.accesslog.pattern=%t %{X-Forwarded-For}i %a "%r" %s %D (%D ms)
|
||||
|
||||
######################### jackson #########################
|
||||
spring.jackson.serialization.write-enums-using-to-string=true
|
||||
spring.jackson.deserialization.read-enums-using-to-string=true
|
||||
spring.jackson.deserialization.fail-on-unknown-properties=false
|
||||
spring.jackson.default-property-inclusion=always
|
||||
spring.jackson.date-format=yyyy-MM-dd HH:mm:ss
|
||||
spring.jackson.time-zone=GMT+8
|
||||
spring.jackson.serialization.write-dates-as-timestamps=false
|
||||
|
||||
######################### http file #########################
|
||||
spring.servlet.multipart.max-file-size=30MB
|
||||
spring.servlet.multipart.max-request-size=30MB
|
||||
file-upload-service.path=/home/upload/
|
||||
file-upload-service.geturl=http://127.0.0.1/smartAdmin/file/
|
||||
|
||||
######################### database #########################
|
||||
spring.datasource.url=jdbc:mysql://127.0.0.1:3306/smart-admin-dev?autoReconnect=true&useServerPreparedStmts=false&rewriteBatchedStatements=true&characterEncoding=UTF-8&useSSL=false&allowMultiQueries=true&serverTimezone=UTC
|
||||
spring.datasource.username=root
|
||||
spring.datasource.password=Root.123
|
||||
spring.datasource.initial-size=2
|
||||
spring.datasource.min-idle=1
|
||||
spring.datasource.max-active=10
|
||||
spring.datasource.max-wait=60000
|
||||
spring.datasource.time-between-eviction-runs-millis=60000
|
||||
spring.datasource.min-evictable-edle-time-millis=300000
|
||||
spring.datasource.driver-class-name=com.mysql.jdbc.Driver
|
||||
spring.datasource.filters=stat
|
||||
spring.datasource.druid.username=druid
|
||||
spring.datasource.druid.password=123456
|
||||
spring.datasource.druid.login.enabled=false
|
||||
|
||||
######################### redis #######################################
|
||||
spring.redis.database=0
|
||||
spring.redis.host=127.0.0.1
|
||||
spring.redis.jedis.pool.max-active=100
|
||||
spring.redis.jedis.pool.min-idle=5
|
||||
spring.redis.jedis.pool.max-idle=10
|
||||
spring.redis.jedis.pool.max-wait=30000ms
|
||||
spring.redis.port=6379
|
||||
spring.redis.timeout=10000ms
|
||||
spring.redis.password=
|
||||
|
||||
########################## rest http pool #########################
|
||||
#\u6700\u5927\u8FDE\u63A5\u6570
|
||||
http.pool.max-total=100
|
||||
#\u5355\u8DEF\u7531\u6700\u5927\u8FDE\u63A5\u6570
|
||||
http.pool.default-max-per-route=25
|
||||
#\u670D\u52A1\u5668\u8FD4\u56DE\u6570\u636E(response)\u7684\u65F6\u95F4
|
||||
http.pool.socket-timeout=8000
|
||||
#\u8FDE\u63A5\u4E0A\u670D\u52A1\u5668(\u63E1\u624B\u6210\u529F)\u7684\u65F6\u95F4
|
||||
http.pool.connect-timeout=8000
|
||||
#\u4ECE\u8FDE\u63A5\u6C60\u4E2D\u83B7\u53D6\u8FDE\u63A5\u7684\u8D85\u65F6\u65F6\u95F4
|
||||
http.pool.connection-request-timeout=8000
|
||||
|
||||
######################### mybatis\u914D\u7F6E #########################
|
||||
mybatis.configuration.log-impl=org.apache.ibatis.logging.stdout.StdOutImpl
|
||||
# mybatis-plus \u5B57\u6BB5\u9A7C\u5CF0\u81EA\u52A8\u8F6C\u6362
|
||||
mybatis-plus.configuration.map-underscore-to-camel-case=true
|
||||
mybatis-plus.mapper-locations=classpath:/mapper/*Mapper.xml,/mapper/*/*Mapper.xml
|
||||
mybatis-plus.typeAliasesPackage=com.gangquan360.smartadmin.*.*.domain.entity
|
||||
mybatis-plus.global-config.refresh-mapper=true
|
||||
mybatis-plus.global-config.db-column-underline=true
|
||||
|
||||
######################### swagger #########################
|
||||
swagger.apiGroupName=smartAdmin
|
||||
swagger.title=smartAdmin
|
||||
swagger.description=smartAdmin
|
||||
swagger.version=1.0
|
||||
swagger.serviceUrl=http://localhost:10086/smart-admin-api
|
||||
swagger.packAge=com.gangquan360.smartadmin.module
|
||||
|
||||
######################### jwt #########################
|
||||
jwt.key=smart-admin-jwt-key
|
||||
|
||||
########################## smart reload #########################
|
||||
smart-reload.thread-count=1
|
||||
smart-reload.time-interval=5
|
||||
|
||||
######################### cros #########################
|
||||
access-control-allow-origin=*
|
||||
|
||||
######################### heart beat #########################
|
||||
heart-beat.delayHandlerTime=60000
|
||||
heart-beat.intervalTime=180000
|
||||
|
||||
######################### quartz #############################
|
||||
#\u8C03\u5EA6\u6807\u8BC6\u540D \u96C6\u7FA4\u4E2D\u6BCF\u4E00\u4E2A\u5B9E\u4F8B\u90FD\u5FC5\u987B\u4F7F\u7528\u76F8\u540C\u7684\u540D\u79F0
|
||||
spring.quartz.properties.org.quartz.scheduler.instanceName=devClusteredScheduler
|
||||
spring.quartz.properties.org.quartz.scheduler.instanceId=AUTO
|
||||
#\u8FDC\u7A0B\u7BA1\u7406\u76F8\u5173\u7684\u914D\u7F6E,\u5168\u90E8\u5173\u95ED
|
||||
spring.quartz.properties.org.quartz.scheduler.rmi.export=false
|
||||
spring.quartz.properties.org.quartz.scheduler.rmi.proxy=false
|
||||
#\u8DF3\u8FC7quartz\u7248\u672C\u68C0\u67E5
|
||||
spring.quartz.properties.org.quartz.scheduler.skipUpdateCheck=true
|
||||
#\u6570\u636E\u4FDD\u5B58\u65B9\u5F0F\u4E3A\u6301\u4E45\u5316
|
||||
spring.quartz.properties.org.quartz.jobStore.class=org.quartz.impl.jdbcjobstore.JobStoreTX
|
||||
spring.quartz.properties.org.quartz.jobStore.driverDelegateClass=org.quartz.impl.jdbcjobstore.StdJDBCDelegate
|
||||
spring.quartz.properties.org.quartz.jobStore.tablePrefix=QRTZ_
|
||||
spring.quartz.properties.org.quartz.jobStore.isClustered=true
|
||||
#\u8C03\u5EA6\u5B9E\u4F8B\u5931\u6548\u7684\u68C0\u67E5\u65F6\u95F4\u95F4\u9694
|
||||
spring.quartz.properties.org.quartz.jobStore.clusterCheckinInterval=10000
|
||||
spring.quartz.properties.org.quartz.jobStore.useProperties=false
|
||||
#\u8C03\u5EA6\u7EBF\u7A0B
|
||||
spring.quartz.properties.org.quartz.threadPool.class=org.quartz.simpl.SimpleThreadPool
|
||||
spring.quartz.properties.org.quartz.threadPool.threadCount=2
|
||||
spring.quartz.properties.org.quartz.threadPool.threadPriority=5
|
||||
spring.quartz.properties.org.quartz.threadPool.threadsInheritContextClassLoaderOfInitializingThread=true
|
||||
spring.quartz.properties.org.quartz.threadPool.threadNamePrefix=quartz
|
||||
spring.quartz.job-store-type=jdbc
|
||||
#ALWAYS,EMBEDDED,NEVER
|
||||
spring.quartz.jdbc.initialize-schema=NEVER
|
||||
spring.quartz.jdbc.schema=classpath:sql/quartz_mysql_2.3.0.sql
|
||||
@@ -0,0 +1,97 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!--
|
||||
status : 这个用于设置log4j2自身内部的信息输出,可以不设置,当设置成trace时,会看到log4j2内部各种详细输出
|
||||
monitorInterval : Log4j能够自动检测修改配置文件和重新配置本身, 设置间隔秒数。
|
||||
-->
|
||||
<Configuration status="INFO" monitorInterval="30">
|
||||
<Properties>
|
||||
<Property name="log-path">/home/logs/smart-admin/dev/logs</Property>
|
||||
</Properties>
|
||||
<Appenders>
|
||||
<Console name="Console" target="SYSTEM_OUT">
|
||||
<ThresholdFilter level="info" onMatch="ACCEPT" onMismatch="DENY"/>
|
||||
<PatternLayout pattern="[%d][%-5p][%t] %m (%F:%L)%n"/>
|
||||
</Console>
|
||||
<RollingFile name="debug" fileName="${log-path}/debug/smart-admin_debug.log"
|
||||
filePattern="${log-path}/debug/smart-admin_debug_%d{yyyy-MM-dd}-%i.log">
|
||||
<Filters>
|
||||
<ThresholdFilter level="info" onMatch="DENY" onMismatch="NEUTRAL"/>
|
||||
<ThresholdFilter level="debug" onMatch="ACCEPT" onMismatch="DENY"/>
|
||||
</Filters>
|
||||
<PatternLayout pattern="[%d][%-5p][%t] %m (%F:%L)%n"/>
|
||||
<Policies>
|
||||
<TimeBasedTriggeringPolicy interval="1" modulate="true"/>
|
||||
<SizeBasedTriggeringPolicy size="50 MB"/>
|
||||
</Policies>
|
||||
<DefaultRolloverStrategy max="30">
|
||||
<Delete basePath="${log-path}/debug" maxDepth="1">
|
||||
<IfFileName glob="smart-admin_debug_*.log"/>
|
||||
<IfLastModified age="15d"/>
|
||||
</Delete>
|
||||
</DefaultRolloverStrategy>
|
||||
</RollingFile>
|
||||
<RollingFile name="info" fileName="${log-path}/info/smart-admin_info.log"
|
||||
filePattern="${log-path}/info/smart-admin_info_%d{yyyy-MM-dd}-%i.log">
|
||||
<Filters>
|
||||
<ThresholdFilter level="warn" onMatch="DENY" onMismatch="NEUTRAL"/>
|
||||
<ThresholdFilter level="info" onMatch="ACCEPT" onMismatch="DENY"/>
|
||||
</Filters>
|
||||
<PatternLayout pattern="[%d][%-5p][%t] %m (%F:%L)%n"/>
|
||||
<Policies>
|
||||
<TimeBasedTriggeringPolicy interval="1" modulate="true"/>
|
||||
<SizeBasedTriggeringPolicy size="50 MB"/>
|
||||
</Policies>
|
||||
<DefaultRolloverStrategy max="30">
|
||||
<Delete basePath="${log-path}/info" maxDepth="1">
|
||||
<IfFileName glob="smart-admin_info_*.log"/>
|
||||
<IfLastModified age="15d"/>
|
||||
</Delete>
|
||||
</DefaultRolloverStrategy>
|
||||
</RollingFile>
|
||||
<RollingFile name="warn" fileName="${log-path}/warn/smart-admin_warn.log"
|
||||
filePattern="${log-path}/warn/smart-admin_warn_%d{yyyy-MM-dd}-%i.log">
|
||||
<Filters>
|
||||
<ThresholdFilter level="error" onMatch="DENY" onMismatch="NEUTRAL"/>
|
||||
<ThresholdFilter level="warn" onMatch="ACCEPT" onMismatch="DENY"/>
|
||||
</Filters>
|
||||
<PatternLayout pattern="[%d][%-5p][%t] %m (%F:%L)%n"/>
|
||||
<Policies>
|
||||
<TimeBasedTriggeringPolicy interval="1" modulate="true"/>
|
||||
<SizeBasedTriggeringPolicy size="50 MB"/>
|
||||
</Policies>
|
||||
<DefaultRolloverStrategy max="30">
|
||||
<Delete basePath="${log-path}/warn" maxDepth="1">
|
||||
<IfFileName glob="smart-admin_warn_*.log"/>
|
||||
<IfLastModified age="15d"/>
|
||||
</Delete>
|
||||
</DefaultRolloverStrategy>
|
||||
</RollingFile>
|
||||
<RollingFile name="error" fileName="${log-path}/error/smart-admin_error.log"
|
||||
filePattern="${log-path}/error/smart-admin_error_%d{yyyy-MM-dd}-%i.log">
|
||||
<Filters>
|
||||
<ThresholdFilter level="fatal" onMatch="DENY" onMismatch="NEUTRAL"/>
|
||||
<ThresholdFilter level="error" onMatch="ACCEPT" onMismatch="DENY"/>
|
||||
</Filters>
|
||||
<PatternLayout pattern="[%d][%-5p][%t] %m (%F:%L)%n"/>
|
||||
<Policies>
|
||||
<TimeBasedTriggeringPolicy interval="1" modulate="true"/>
|
||||
<SizeBasedTriggeringPolicy size="10 MB"/>
|
||||
</Policies>
|
||||
<DefaultRolloverStrategy max="30">
|
||||
<Delete basePath="${log-path}/error" maxDepth="1">
|
||||
<IfFileName glob="smart-admin_error_*.log"/>
|
||||
<IfLastModified age="15d"/>
|
||||
</Delete>
|
||||
</DefaultRolloverStrategy>
|
||||
</RollingFile>
|
||||
</Appenders>
|
||||
<Loggers>
|
||||
<Root level="debug">
|
||||
<AppenderRef ref="Console"/>
|
||||
<AppenderRef ref="debug"/>
|
||||
<AppenderRef ref="info"/>
|
||||
<AppenderRef ref="warn"/>
|
||||
<AppenderRef ref="error"/>
|
||||
</Root>
|
||||
</Loggers>
|
||||
</Configuration>
|
||||
@@ -0,0 +1,27 @@
|
||||
<?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.gangquan360.smartadmin.module.codegenerator.dao.TableDao">
|
||||
<resultMap id="ColumnDTO"
|
||||
type="com.gangquan360.smartadmin.module.codegenerator.domain.ColumnVO"></resultMap>
|
||||
|
||||
|
||||
|
||||
<select id="selectTableDesc" resultType="String">
|
||||
select
|
||||
table_comment
|
||||
from information_schema.tables
|
||||
where table_schema = (select database()) and table_name = #{tableName}
|
||||
</select>
|
||||
|
||||
<select id="selectTableColumn" resultMap="ColumnDTO">
|
||||
select
|
||||
column_name as columnName,
|
||||
data_type as columnType,
|
||||
column_comment as columnDesc
|
||||
from information_schema.columns
|
||||
where table_schema = (select database()) AND table_name = #{tableName} order by ordinal_position
|
||||
</select>
|
||||
|
||||
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,36 @@
|
||||
<?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.gangquan360.smartadmin.module.datascope.DataScopeRoleDao">
|
||||
|
||||
<resultMap id="DataScopeRoleEntity" type="com.gangquan360.smartadmin.module.datascope.domain.entity.DataScopeRoleEntity"></resultMap>
|
||||
|
||||
<select id="listByRoleId" resultMap="DataScopeRoleEntity">
|
||||
select id,data_scope_type,view_type,role_id,update_time,create_time from t_role_data_scope where role_id = #{roleId}
|
||||
</select>
|
||||
|
||||
<select id="listByRoleIdList" resultMap="DataScopeRoleEntity">
|
||||
select id,data_scope_type,view_type,role_id,update_time,create_time from t_role_data_scope where role_id IN
|
||||
<foreach collection="roleIdList" item="item" open="(" close= ")" separator=",">
|
||||
#{item}
|
||||
</foreach>
|
||||
</select>
|
||||
|
||||
<delete id="deleteByRoleId">
|
||||
DELETE FROM t_role_data_scope
|
||||
WHERE role_id = #{roleId}
|
||||
</delete>
|
||||
|
||||
<insert id="batchInsert" useGeneratedKeys="true" keyProperty="id" parameterType="java.util.List">
|
||||
INSERT INTO t_role_data_scope (data_scope_type,view_type,role_id,update_time,create_time) VALUES
|
||||
<foreach collection="list" item="item" separator=",">
|
||||
(
|
||||
#{item.dataScopeType},
|
||||
#{item.viewType},
|
||||
#{item.roleId},
|
||||
now(),
|
||||
now()
|
||||
)
|
||||
</foreach>
|
||||
</insert>
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,54 @@
|
||||
<?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.gangquan360.smartadmin.module.department.DepartmentDao">
|
||||
|
||||
|
||||
<resultMap id="DepartmentVO"
|
||||
type="com.gangquan360.smartadmin.module.department.domain.dto.DepartmentVO"></resultMap>
|
||||
|
||||
|
||||
<sql id="baseSql">
|
||||
d.id,
|
||||
d.name,
|
||||
d.short_name,
|
||||
d.manager_id,
|
||||
d.parent_id,
|
||||
d.sort,
|
||||
d.update_time,
|
||||
d.create_time
|
||||
</sql>
|
||||
|
||||
<select id="countSubDepartment" resultType="integer">
|
||||
SELECT
|
||||
count(1)
|
||||
FROM
|
||||
t_department
|
||||
WHERE
|
||||
parent_id = #{departmentId}
|
||||
</select>
|
||||
|
||||
<select id="listAll" resultMap="DepartmentVO">
|
||||
SELECT
|
||||
<include refid="baseSql"></include>,
|
||||
e.actual_name as managerName,
|
||||
pd.`name` as parentName
|
||||
FROM
|
||||
t_department d
|
||||
left join t_employee e on d.manager_id= e.id
|
||||
left join t_department pd on d.parent_id = pd.id
|
||||
order by sort asc
|
||||
</select>
|
||||
|
||||
<select id="selectByParentId" resultMap="DepartmentVO">
|
||||
SELECT
|
||||
<include refid="baseSql"></include>
|
||||
FROM
|
||||
t_department d
|
||||
where
|
||||
d.parent_id = #{departmentId}
|
||||
order by sort desc
|
||||
</select>
|
||||
|
||||
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,44 @@
|
||||
<?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.gangquan360.smartadmin.module.email.EmailDao">
|
||||
|
||||
<resultMap id="EmailEntity" type="com.gangquan360.smartadmin.module.email.domain.entity.EmailEntity"></resultMap>
|
||||
|
||||
|
||||
<select id="queryByPage" resultMap="EmailEntity">
|
||||
select
|
||||
id,
|
||||
title,
|
||||
to_emails,
|
||||
send_status,
|
||||
create_time,
|
||||
update_time
|
||||
from t_email
|
||||
<where>
|
||||
<if test="queryDTO.startDate != null and queryDTO.startDate != ''">
|
||||
AND DATE_FORMAT(create_time, '%Y-%m-%d') >= #{queryDTO.startDate}
|
||||
</if>
|
||||
<if test="queryDTO.endDate != null and queryDTO.endDate != ''">
|
||||
AND DATE_FORMAT(create_time, '%Y-%m-%d') <= #{queryDTO.endDate}
|
||||
</if>
|
||||
<if test="queryDTO.title != null and queryDTO.title != ''">
|
||||
AND INSTR(title,#{queryDTO.title})
|
||||
</if>
|
||||
<if test="queryDTO.sendStatus != null">
|
||||
AND send_status = #{queryDTO.sendStatus}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<delete id="deleteById">
|
||||
delete from t_email where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteByIds">
|
||||
delete from t_email where id in
|
||||
<foreach collection="idList" open="(" close=")" separator="," item="item">
|
||||
#{item}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,183 @@
|
||||
<?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.gangquan360.smartadmin.module.employee.EmployeeDao">
|
||||
|
||||
|
||||
<resultMap id="EmployeeDTO"
|
||||
type="com.gangquan360.smartadmin.module.employee.domain.dto.EmployeeDTO"></resultMap>
|
||||
|
||||
<resultMap id="EmployeeVO" type="com.gangquan360.smartadmin.module.employee.domain.vo.EmployeeVO"></resultMap>
|
||||
|
||||
<sql id="baseSql">
|
||||
e.id,
|
||||
e.login_name,
|
||||
e.login_pwd,
|
||||
e.actual_name,
|
||||
e.nick_name,
|
||||
e.phone,
|
||||
e.id_card,
|
||||
e.birthday,
|
||||
e.email,
|
||||
e.department_id,
|
||||
e.is_leave,
|
||||
e.is_disabled,
|
||||
e.remark,
|
||||
e.is_delete,
|
||||
e.update_time,
|
||||
e.create_time
|
||||
</sql>
|
||||
|
||||
<select id="selectEmployeeList" resultMap="EmployeeDTO">
|
||||
SELECT
|
||||
<include refid="baseSql"></include>,
|
||||
d.name AS department_name
|
||||
FROM
|
||||
t_employee e
|
||||
LEFT JOIN t_department d ON d.id = e.department_id
|
||||
<where>
|
||||
<if test="queryDTO.phone != null and queryDTO.phone != ''">
|
||||
<bind name="likephone" value=" '%' + queryDTO.phone +'%' "></bind>
|
||||
AND e.actual_name like #{likephone}
|
||||
</if>
|
||||
<if test="queryDTO.actualName != null and queryDTO.actualName != ''">
|
||||
<bind name="likeActualName" value=" '%' + queryDTO.actualName +'%' "></bind>
|
||||
AND e.actual_name like #{likeActualName}
|
||||
</if>
|
||||
<if test="queryDTO.keyword != null and queryDTO.keyword != ''">
|
||||
<bind name="likeName" value=" '%' + queryDTO.keyword +'%' "></bind>
|
||||
AND (e.actual_name like #{likeName} or e.nick_name like #{likeName} or e.phone like #{likeName})
|
||||
</if>
|
||||
|
||||
<if test="queryDTO.departmentId != null">
|
||||
AND e.department_id = #{queryDTO.departmentId}
|
||||
</if>
|
||||
<if test="queryDTO.isLeave != null">
|
||||
AND e.is_leave = #{queryDTO.isLeave}
|
||||
</if>
|
||||
<if test="queryDTO.isDisabled != null">
|
||||
AND e.is_disabled = #{queryDTO.isDisabled}
|
||||
</if>
|
||||
<if test="queryDTO.isDelete != null">
|
||||
AND e.is_delete = #{queryDTO.isDelete}
|
||||
</if>
|
||||
<if test="queryDTO.employeeIds != null and queryDTO.employeeIds.size > 0">
|
||||
AND e.id IN
|
||||
<foreach collection="queryDTO.employeeIds" open="(" close= ")" item="item" separator="," >
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
</where>
|
||||
order by e.create_time desc
|
||||
</select>
|
||||
|
||||
|
||||
<update id="batchUpdateStatus">
|
||||
UPDATE t_employee e
|
||||
set e.is_disabled = #{isDisabled}
|
||||
WHERE id in
|
||||
<foreach collection="employeeIds" item="item" separator="," open="(" close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
</update>
|
||||
|
||||
<select id="login" resultMap="EmployeeDTO">
|
||||
SELECT
|
||||
<include refid="baseSql"></include>
|
||||
FROM
|
||||
t_employee e
|
||||
WHERE
|
||||
e.login_name = #{loginName} and e.login_pwd = #{loginPwd}
|
||||
</select>
|
||||
|
||||
|
||||
<select id="getByLoginName" resultMap="EmployeeDTO">
|
||||
SELECT
|
||||
<include refid="baseSql"></include>
|
||||
FROM
|
||||
t_employee e
|
||||
WHERE
|
||||
e.login_name = #{loginName} and e.is_disabled = #{isDisabled}
|
||||
</select>
|
||||
|
||||
|
||||
<select id="getByPhone" resultMap="EmployeeDTO">
|
||||
SELECT
|
||||
<include refid="baseSql"></include>
|
||||
FROM
|
||||
t_employee e
|
||||
WHERE
|
||||
e.login_name = #{phone} and e.is_disabled = #{isDisabled}
|
||||
</select>
|
||||
|
||||
|
||||
<select id="listAll" resultMap="EmployeeDTO">
|
||||
SELECT
|
||||
<include refid="baseSql"></include>
|
||||
FROM
|
||||
t_employee e
|
||||
order by e.create_time desc
|
||||
</select>
|
||||
|
||||
<select id="countByDepartmentId" resultType="integer">
|
||||
SELECT
|
||||
count(1)
|
||||
FROM
|
||||
t_employee e
|
||||
WHERE
|
||||
e.department_id = #{departmentId}
|
||||
</select>
|
||||
|
||||
|
||||
<select id="getEmployeeIdByDeptId" resultMap="EmployeeVO">
|
||||
SELECT
|
||||
<include refid="baseSql"></include>
|
||||
FROM
|
||||
t_employee e
|
||||
WHERE
|
||||
e.department_id = #{departmentId}
|
||||
order by e.create_time desc
|
||||
</select>
|
||||
|
||||
|
||||
<select id="getEmployeeIdByDeptIds" resultMap="EmployeeDTO">
|
||||
SELECT
|
||||
<include refid="baseSql"></include>
|
||||
FROM
|
||||
t_employee e
|
||||
WHERE
|
||||
e.department_id IN
|
||||
<foreach collection="departmentIds" item="item" separator=",">
|
||||
#{item}
|
||||
</foreach>
|
||||
order by e.create_time desc
|
||||
</select>
|
||||
|
||||
<select id="getEmployeeByIds" resultMap="EmployeeDTO">
|
||||
SELECT
|
||||
<include refid="baseSql"></include>
|
||||
FROM
|
||||
t_employee e
|
||||
where e.id IN
|
||||
<foreach collection="ids" item="item" separator=",">
|
||||
#{item}
|
||||
</foreach>
|
||||
order by e.create_time desc
|
||||
</select>
|
||||
|
||||
|
||||
<select id="getEmployeeById" resultMap="EmployeeDTO">
|
||||
SELECT
|
||||
<include refid="baseSql"></include>
|
||||
FROM
|
||||
t_employee e
|
||||
where e.id = #{id}
|
||||
</select>
|
||||
|
||||
<update id="updatePassword">
|
||||
UPDATE t_employee
|
||||
SET login_pwd = #{password}
|
||||
WHERE id = #{employeeId}
|
||||
</update>
|
||||
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,100 @@
|
||||
<?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.gangquan360.smartadmin.module.file.FileDao">
|
||||
<resultMap id="fileMap"
|
||||
type="com.gangquan360.smartadmin.module.file.domain.entity.FileEntity"></resultMap>
|
||||
<resultMap id="fileDTO"
|
||||
type="com.gangquan360.smartadmin.module.file.domain.dto.FileDTO"></resultMap>
|
||||
|
||||
<resultMap id="fileVO" type="com.gangquan360.smartadmin.module.file.domain.vo.FileVO"></resultMap>
|
||||
|
||||
<insert id="insertFileBatch" useGeneratedKeys="true" keyProperty="id" parameterType="java.util.List">
|
||||
INSERT INTO t_file (
|
||||
module_id,
|
||||
module_type,
|
||||
file_name,
|
||||
file_size,
|
||||
file_type,
|
||||
file_path,
|
||||
creater_user,
|
||||
file_location_type
|
||||
)
|
||||
VALUES
|
||||
<foreach collection="list" item="item" index="index" separator=",">
|
||||
(#{item.moduleId},#{item.moduleType},#{item.fileName},#{item.fileSize},#{item.fileType},#{item.filePath},#{item.createrUser},#{item.createrUserType},#{item.fileLocationType})
|
||||
</foreach>
|
||||
</insert>
|
||||
|
||||
<insert id="insertFileEntityBatch" useGeneratedKeys="true" keyProperty="id" parameterType="java.util.List">
|
||||
INSERT INTO t_file (
|
||||
module_id,
|
||||
module_type,
|
||||
file_name,
|
||||
file_size,
|
||||
file_type,
|
||||
file_path,
|
||||
creater_user,
|
||||
file_location_type
|
||||
)
|
||||
VALUES
|
||||
<foreach collection="list" item="item" index="index" separator=",">
|
||||
(#{item.moduleId},#{item.moduleType},#{item.fileName},#{item.fileSize},#{item.fileType},#{item.filePath},#{item.createrUser},#{item.createrUserType},#{item.fileLocationType})
|
||||
</foreach>
|
||||
</insert>
|
||||
|
||||
<delete id="deleteFilesByModuleId">
|
||||
DELETE FROM t_file WHERE module_id =#{moduleId}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteFilesByModuleIdAndModuleType">
|
||||
DELETE FROM t_file WHERE module_id =#{moduleId} and module_type=#{moduleType}
|
||||
</delete>
|
||||
|
||||
<select id="listFilesByModuleId" resultMap="fileVO">
|
||||
SELECT * FROM t_file WHERE module_id =#{moduleId}
|
||||
</select>
|
||||
|
||||
<select id="listFilesByModuleIdAndModuleType" resultMap="fileVO">
|
||||
SELECT * FROM t_file WHERE module_id =#{moduleId} and module_type=#{moduleType}
|
||||
</select>
|
||||
|
||||
<select id="listFilesByModuleIdAndModuleTypes" resultMap="fileVO">
|
||||
SELECT * FROM t_file WHERE module_id =#{moduleId} and module_type IN
|
||||
<foreach collection="moduleTypes" open="(" close=")" separator="," item="item">
|
||||
#{item}
|
||||
</foreach>
|
||||
</select>
|
||||
|
||||
<select id="listFilesByModuleIdsAndModuleType" resultMap="fileVO">
|
||||
SELECT * FROM t_file WHERE
|
||||
module_id IN
|
||||
<foreach collection="moduleIds" open="(" close=")" separator="," item="item">
|
||||
#{item}
|
||||
</foreach>
|
||||
and module_type=#{moduleType}
|
||||
</select>
|
||||
|
||||
|
||||
<select id="listFilesByFileIds" resultMap="fileVO">
|
||||
SELECT * FROM t_file WHERE id IN
|
||||
<foreach collection="fileIds" open="(" close=")" separator="," item="item">
|
||||
#{item}
|
||||
</foreach>
|
||||
</select>
|
||||
<select id="queryListByPage" resultMap="fileVO">
|
||||
SELECT * FROM t_file
|
||||
<where>
|
||||
<if test="queryDTO.moduleType != null and queryDTO.moduleType != ''">
|
||||
AND module_type = #{queryDTO.moduleType}
|
||||
</if>
|
||||
<if test="queryDTO.fileName != null and queryDTO.fileName != '' ">
|
||||
AND INSTR(file_name,#{queryDTO.fileName})
|
||||
</if>
|
||||
<if test="queryDTO.fileLocationType != null ">
|
||||
AND file_location_type = #{queryDTO.fileLocationType}
|
||||
</if>
|
||||
</where>
|
||||
order by create_time desc
|
||||
</select>
|
||||
|
||||
</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.gangquan360.smartadmin.module.heartbeat.HeartBeatRecordDao">
|
||||
|
||||
<!-- 心跳日志 -->
|
||||
<insert id="insertHeartBeat" useGeneratedKeys="true" keyProperty="id">
|
||||
INSERT INTO t_heart_beat_record (
|
||||
project_path,
|
||||
server_ip,
|
||||
process_no,
|
||||
process_start_time,
|
||||
heart_beat_time
|
||||
)
|
||||
VALUES
|
||||
(#{projectPath},
|
||||
#{serverIp},
|
||||
#{processNo},
|
||||
#{processStartTime},
|
||||
#{heartBeatTime})
|
||||
</insert>
|
||||
|
||||
<update id="updateHeartBeatTimeById">
|
||||
update t_heart_beat_record
|
||||
set heart_beat_time = #{heartBeatTime}
|
||||
<where>
|
||||
id = #{id}
|
||||
</where>
|
||||
</update>
|
||||
|
||||
<select id="query" resultType="com.gangquan360.smartadmin.module.heartbeat.HeartBeatRecordEntity">
|
||||
select * from t_heart_beat_record where project_path = #{projectPath} and server_ip = #{serverIp} and process_no =#{processNo}
|
||||
</select>
|
||||
|
||||
<select id="pageQuery" resultType="com.gangquan360.smartadmin.module.heartbeat.HeartBeatRecordVO">
|
||||
SELECT
|
||||
*
|
||||
FROM
|
||||
t_heart_beat_record
|
||||
order by heart_beat_time desc
|
||||
</select>
|
||||
</mapper>
|
||||
@@ -0,0 +1,48 @@
|
||||
<?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.gangquan360.smartadmin.module.idgenerator.IdGeneratorDao">
|
||||
<resultMap id="idGeneratorLastNumberDTO"
|
||||
type="com.gangquan360.smartadmin.module.idgenerator.domain.IdGeneratorLastNumberDTO">
|
||||
</resultMap>
|
||||
<resultMap id="idGeneratorEntity" type="com.gangquan360.smartadmin.module.idgenerator.domain.IdGeneratorEntity">
|
||||
</resultMap>
|
||||
|
||||
<resultMap id="idGeneratorRecordDTO"
|
||||
type="com.gangquan360.smartadmin.module.idgenerator.domain.IdGeneratorRecordDTO">
|
||||
</resultMap>
|
||||
|
||||
|
||||
<!-- 查询上次id -->
|
||||
<select id="selectAll" resultMap="idGeneratorEntity">
|
||||
select * from t_id_generator
|
||||
</select>
|
||||
|
||||
|
||||
<!-- 查询上次id -->
|
||||
<select id="selectLastNumber" resultMap="idGeneratorLastNumberDTO">
|
||||
select
|
||||
update_time,last_number, now() as database_time
|
||||
from t_id_generator
|
||||
where id = #{id}
|
||||
for update
|
||||
</select>
|
||||
|
||||
<select id="selectHistoryLastNumber" resultMap="idGeneratorRecordDTO">
|
||||
select
|
||||
generator_id,year, month,day,last_number
|
||||
from t_id_generator_record
|
||||
where generator_id = #{generatorId} and year=#{year} and month=#{month} and day=#{day}
|
||||
</select>
|
||||
|
||||
|
||||
<!-- 更新id_generator -->
|
||||
<update id="updateLastNumber">
|
||||
update t_id_generator set last_number = #{lastNumber}, update_time = now() where id = #{generatorId}
|
||||
</update>
|
||||
|
||||
<update id="replaceIdGeneratorRecord">
|
||||
replace into `t_id_generator_record` (`generator_id`, `year`, `month`, `day`, `last_number`) values (#{generatorId}, #{year}, #{month}, #{day}, #{lastNumber})
|
||||
</update>
|
||||
|
||||
|
||||
</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.gangquan360.smartadmin.module.log.orderoperatelog.OrderOperateLogDao">
|
||||
<resultMap id="orderOperateLogSaveDTOMap"
|
||||
type="com.gangquan360.smartadmin.module.log.orderoperatelog.domain.entity.OrderOperateLogEntity"></resultMap>
|
||||
|
||||
|
||||
<select id="listOrderOperateLogsByOrderTypeAndOrderId" resultMap="orderOperateLogSaveDTOMap">
|
||||
select * from t_order_operate_log where order_id= #{orderId}
|
||||
AND order_type IN
|
||||
<foreach collection="orderTypeList" item="item" open="(" close=")" separator=",">
|
||||
#{item}
|
||||
</foreach>
|
||||
order by id desc
|
||||
</select>
|
||||
|
||||
<select id="listOrderOperateLogsByOrderTypeAndOrderIds" resultMap="orderOperateLogSaveDTOMap">
|
||||
select * from t_order_operate_log where
|
||||
order_id IN
|
||||
<foreach collection="orderIds" item="item" open="(" close=")" separator=",">
|
||||
#{item}
|
||||
</foreach>
|
||||
AND order_type IN
|
||||
<foreach collection="orderTypeList" item="item" open="(" close=")" separator=",">
|
||||
#{item}
|
||||
</foreach>
|
||||
order by id desc
|
||||
</select>
|
||||
|
||||
|
||||
|
||||
<insert id="batchInsert" useGeneratedKeys="true" keyProperty="id" parameterType="java.util.List">
|
||||
INSERT INTO t_order_operate_log (order_id,order_type, operate_type, operate_content, operate_remark, employee_id, employee_name,ext_data,update_time,create_time) VALUES
|
||||
<foreach collection="list" item="item" separator=",">
|
||||
(#{item.orderId},
|
||||
#{item.orderType},
|
||||
#{item.operateType},
|
||||
#{item.operateContent},
|
||||
#{item.operateRemark},
|
||||
#{item.employeeId},
|
||||
#{item.employeeName},
|
||||
#{item.extData},
|
||||
#{item.updateTime}
|
||||
#{item.createTime}
|
||||
)
|
||||
</foreach>
|
||||
</insert>
|
||||
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,46 @@
|
||||
<?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.gangquan360.smartadmin.module.log.userloginlog.UserLoginLogDao">
|
||||
|
||||
<resultMap id="UserLoginLogEntity" type="com.gangquan360.smartadmin.module.log.userloginlog.domain.UserLoginLogEntity"></resultMap>
|
||||
|
||||
|
||||
<select id="queryByPage" resultMap="UserLoginLogEntity">
|
||||
select
|
||||
id,
|
||||
user_id,
|
||||
user_name,
|
||||
remote_ip,
|
||||
remote_port,
|
||||
remote_browser,
|
||||
remote_os,
|
||||
login_status,
|
||||
update_time,
|
||||
create_time
|
||||
from t_user_login_log
|
||||
<where>
|
||||
<if test="queryDTO.startDate != null and queryDTO.startDate != ''">
|
||||
AND DATE_FORMAT(create_time, '%Y-%m-%d') >= #{queryDTO.startDate}
|
||||
</if>
|
||||
<if test="queryDTO.endDate != null and queryDTO.endDate != ''">
|
||||
AND DATE_FORMAT(create_time, '%Y-%m-%d') <= #{queryDTO.endDate}
|
||||
</if>
|
||||
<if test="queryDTO.userName != null and queryDTO.userName != ''">
|
||||
AND INSTR(user_name,#{queryDTO.userName})
|
||||
</if>
|
||||
</where>
|
||||
order by create_time desc
|
||||
</select>
|
||||
|
||||
<delete id="deleteById">
|
||||
delete from t_user_login_log where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteByIds">
|
||||
delete from t_user_login_log where id in
|
||||
<foreach collection="idList" open="(" close=")" separator="," item="item">
|
||||
#{item}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,51 @@
|
||||
<?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.gangquan360.smartadmin.module.log.useroperatelog.UserOperateLogDao">
|
||||
|
||||
<resultMap id="UserOperateLogEntity" type="com.gangquan360.smartadmin.module.log.useroperatelog.domain.UserOperateLogEntity"></resultMap>
|
||||
|
||||
|
||||
<select id="queryByPage" resultMap="UserOperateLogEntity">
|
||||
select
|
||||
id,
|
||||
user_id,
|
||||
user_name,
|
||||
module,
|
||||
content,
|
||||
url,
|
||||
method,
|
||||
param,
|
||||
result,
|
||||
fail_reason,
|
||||
update_time,
|
||||
create_time
|
||||
from t_user_operate_log
|
||||
<where>
|
||||
<if test="queryDTO.startDate != null and queryDTO.startDate != ''">
|
||||
AND DATE_FORMAT(create_time, '%Y-%m-%d') >= #{queryDTO.startDate}
|
||||
</if>
|
||||
<if test="queryDTO.endDate != null and queryDTO.endDate != ''">
|
||||
AND DATE_FORMAT(create_time, '%Y-%m-%d') <= #{queryDTO.endDate}
|
||||
</if>
|
||||
<if test="queryDTO.userName != null and queryDTO.userName != ''">
|
||||
AND INSTR(user_name,#{queryDTO.userName})
|
||||
</if>
|
||||
<if test="queryDTO.resultFlag != null">
|
||||
AND result = #{queryDTO.resultFlag}
|
||||
</if>
|
||||
</where>
|
||||
order by create_time desc
|
||||
</select>
|
||||
|
||||
<delete id="deleteById">
|
||||
delete from t_user_operate_log where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteByIds">
|
||||
delete from t_user_operate_log where id in
|
||||
<foreach collection="idList" open="(" close=")" separator="," item="item">
|
||||
#{item}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,155 @@
|
||||
<?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.gangquan360.smartadmin.module.notice.dao.NoticeDao">
|
||||
|
||||
<resultMap id="NoticeEntity" type="com.gangquan360.smartadmin.module.notice.domain.entity.NoticeEntity"></resultMap>
|
||||
|
||||
<resultMap id="NoticeDTO" type="com.gangquan360.smartadmin.module.notice.domain.dto.NoticeVO"></resultMap>
|
||||
|
||||
<resultMap id="NoticeDetailDTO" type="com.gangquan360.smartadmin.module.notice.domain.dto.NoticeDetailVO"></resultMap>
|
||||
|
||||
<resultMap id="NoticeReceiveDTO" type="com.gangquan360.smartadmin.module.notice.domain.dto.NoticeReceiveDTO"></resultMap>
|
||||
|
||||
|
||||
<resultMap id="NoticeReadCountDTO" type="com.gangquan360.smartadmin.module.notice.domain.dto.NoticeReadCountDTO"></resultMap>
|
||||
|
||||
|
||||
<select id="queryByPage" resultMap="NoticeDTO">
|
||||
select
|
||||
n.id,
|
||||
n.title,
|
||||
n.create_user,
|
||||
e.actual_name as createUserName,
|
||||
n.send_status,
|
||||
n.create_time
|
||||
from t_notice n
|
||||
left join t_employee e on e.id = n.create_user
|
||||
<where>
|
||||
<if test="queryDTO.startDate != null and queryDTO.startDate != ''">
|
||||
AND DATE_FORMAT(n.create_time, '%Y-%m-%d') >= #{queryDTO.startDate}
|
||||
</if>
|
||||
<if test="queryDTO.endDate != null and queryDTO.endDate != ''">
|
||||
AND DATE_FORMAT(n.create_time, '%Y-%m-%d') <= #{queryDTO.endDate}
|
||||
</if>
|
||||
<if test="queryDTO.title != null and queryDTO.title != ''">
|
||||
AND INSTR(n.title,#{queryDTO.title})
|
||||
</if>
|
||||
<if test="queryDTO.deleted != null">
|
||||
AND n.deleted = #{queryDTO.deleted}
|
||||
</if>
|
||||
</where>
|
||||
ORDER by n.create_time desc
|
||||
</select>
|
||||
|
||||
|
||||
|
||||
<select id="queryUnreadByPage" resultMap="NoticeDTO">
|
||||
select
|
||||
n.id,
|
||||
n.title,
|
||||
n.send_status,
|
||||
n.create_user,
|
||||
e.actual_name as createUserName,
|
||||
n.create_time
|
||||
from t_notice n
|
||||
left join t_employee e on e.id = n.create_user
|
||||
where n.id not in (select notice_id from t_notice_receive_record nrr where nrr.employee_id = #{employeeId})
|
||||
and n.send_status = #{sendStatus}
|
||||
ORDER by n.create_time desc
|
||||
</select>
|
||||
|
||||
|
||||
<select id="queryReceiveByPage" resultMap="NoticeReceiveDTO">
|
||||
select
|
||||
n.id,
|
||||
n.title,
|
||||
n.create_user,
|
||||
n.send_status,
|
||||
e.actual_name as createUserName,
|
||||
n.create_time,
|
||||
nrr.create_time as receiveTime
|
||||
from t_notice n
|
||||
left join t_employee e on e.id = n.create_user
|
||||
left join t_notice_receive_record nrr on nrr.notice_id=n.id and nrr.employee_id=#{queryDTO.employeeId}
|
||||
<where>
|
||||
<if test="queryDTO.startDate != null and queryDTO.startDate != ''">
|
||||
AND DATE_FORMAT(n.create_time, '%Y-%m-%d') >= #{queryDTO.startDate}
|
||||
</if>
|
||||
<if test="queryDTO.endDate != null and queryDTO.endDate != ''">
|
||||
AND DATE_FORMAT(n.create_time, '%Y-%m-%d') <= #{queryDTO.endDate}
|
||||
</if>
|
||||
<if test="queryDTO.title != null and queryDTO.title != ''">
|
||||
AND INSTR(n.title,#{queryDTO.title})
|
||||
</if>
|
||||
<if test="queryDTO.sendStatus != null">
|
||||
AND n.send_status = #{queryDTO.sendStatus}
|
||||
</if>
|
||||
</where>
|
||||
ORDER by n.create_time desc
|
||||
</select>
|
||||
|
||||
|
||||
|
||||
|
||||
<select id="detail" resultMap="NoticeDetailDTO">
|
||||
select
|
||||
n.id,
|
||||
n.title,
|
||||
n.content,
|
||||
n.send_status,
|
||||
n.create_user,
|
||||
e.actual_name as createUserName,
|
||||
n.create_time,
|
||||
n.update_time
|
||||
from t_notice n
|
||||
left join t_employee e on e.id = n.create_user
|
||||
where n.id = #{id}
|
||||
</select>
|
||||
|
||||
|
||||
|
||||
<update id="logicDeleteById">
|
||||
UPDATE t_notice
|
||||
set deleted = #{deletedFlag}
|
||||
WHERE id =#{id}
|
||||
</update>
|
||||
|
||||
|
||||
<delete id="logicDeleteByIds">
|
||||
UPDATE t_notice set deleted = #{deletedFlag} where id in
|
||||
<foreach collection="idList" open="(" close=")" separator="," item="item">
|
||||
#{item}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
|
||||
<select id="noticeCount" resultType="integer">
|
||||
select
|
||||
count(1)
|
||||
from t_notice where send_status = #{sendStatus}
|
||||
</select>
|
||||
|
||||
<select id="readCount" resultMap="NoticeReadCountDTO">
|
||||
SELECT
|
||||
nrr.employee_id,
|
||||
count(1) as readCount
|
||||
from t_notice_receive_record nrr
|
||||
where nrr.employee_id in
|
||||
<foreach collection="employeeIds" open="(" close=")" separator="," item="item">
|
||||
#{item}
|
||||
</foreach>
|
||||
GROUP BY nrr.employee_id
|
||||
</select>
|
||||
|
||||
|
||||
|
||||
<select id="noticeUnreadCount" resultType="integer">
|
||||
select
|
||||
count(1)
|
||||
from t_notice n
|
||||
where n.id not in (select msg_id from t_notice_receive_record nrr where nrr.employee_id = #{employeeId})
|
||||
and n.send_status = #{sendStatus}
|
||||
</select>
|
||||
|
||||
|
||||
</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.gangquan360.smartadmin.module.notice.dao.NoticeReceiveRecordDao">
|
||||
|
||||
<resultMap id="NoticeReceiveRecordEntity" type="com.gangquan360.smartadmin.module.notice.domain.entity.NoticeReceiveRecordEntity"></resultMap>
|
||||
|
||||
|
||||
<delete id="deleteByNoticeId">
|
||||
delete from t_notice_receive_record where notice_id = #{noticeId}
|
||||
</delete>
|
||||
|
||||
<insert id="batchInsert" useGeneratedKeys="true" keyProperty="id" parameterType="java.util.List">
|
||||
INSERT INTO t_notice_receive_record (notice_id, employee_id, update_time, create_time) VALUES
|
||||
<foreach collection="list" item="item" separator=",">
|
||||
(
|
||||
#{item.noticeId},
|
||||
#{item.employeeId},
|
||||
now(),
|
||||
now()
|
||||
)
|
||||
</foreach>
|
||||
</insert>
|
||||
|
||||
|
||||
|
||||
|
||||
<select id="selectByEmployeeAndNotice" resultMap="NoticeReceiveRecordEntity">
|
||||
SELECT
|
||||
nrr.id,
|
||||
nrr.employee_id,
|
||||
nrr.notice_id,
|
||||
nrr.create_time,
|
||||
nrr.update_time
|
||||
from t_notice_receive_record nrr
|
||||
where nrr.employee_id = #{employeeId} and nrr.notice_id=#{noticeId}
|
||||
</select>
|
||||
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,77 @@
|
||||
<?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.gangquan360.smartadmin.module.position.PositionDao">
|
||||
|
||||
|
||||
<sql id="baseSql">
|
||||
id,
|
||||
position_name,
|
||||
remark,
|
||||
update_time,
|
||||
create_time
|
||||
</sql>
|
||||
|
||||
<select id="selectByPage" resultType="com.gangquan360.smartadmin.module.position.domain.entity.PositionEntity">
|
||||
SELECT
|
||||
<include refid="baseSql"></include>
|
||||
FROM
|
||||
t_position
|
||||
<where>
|
||||
<if test="positionName != null and positionName != ''">
|
||||
AND INSTR(position_name,#{positionName})
|
||||
</if>
|
||||
</where>
|
||||
order by create_time desc
|
||||
</select>
|
||||
|
||||
<select id="selectRelation" resultType="com.gangquan360.smartadmin.module.position.domain.dto.PositionRelationResultDTO">
|
||||
SELECT
|
||||
job.position_name,
|
||||
rel.position_id,
|
||||
rel.employee_id,
|
||||
rel.update_time,
|
||||
rel.create_time
|
||||
FROM
|
||||
t_position_relation rel
|
||||
LEFT JOIN t_position job ON rel.position_id = job.id
|
||||
<where>
|
||||
<if test="positionId != null">
|
||||
AND rel.position_id = #{positionId}
|
||||
</if>
|
||||
<if test="employeeId != null">
|
||||
AND rel.employee_id = #{employeeId}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectEmployeesRelation" resultType="com.gangquan360.smartadmin.module.position.domain.dto.PositionRelationResultDTO">
|
||||
SELECT
|
||||
job.position_name,
|
||||
rel.position_id,
|
||||
rel.employee_id,
|
||||
rel.update_time,
|
||||
rel.create_time
|
||||
FROM
|
||||
t_position_relation rel
|
||||
LEFT JOIN t_position job ON rel.position_id = job.id
|
||||
<where>
|
||||
rel.employee_id IN
|
||||
<foreach collection="employeeIdList" item="item" separator="," open="(" close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<insert id="insertBatchRelation">
|
||||
INSERT INTO t_position_relation (position_id,employee_id) VALUES
|
||||
<foreach collection="batchDTO.positionIdList" item="item" separator=",">
|
||||
(#{item},#{batchDTO.employeeId})
|
||||
</foreach>
|
||||
</insert>
|
||||
|
||||
|
||||
<delete id="deleteRelationByEmployeeId">
|
||||
DELETE FROM t_position_relation WHERE employee_id = #{employeeId}
|
||||
</delete>
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,111 @@
|
||||
<?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.gangquan360.smartadmin.module.privilege.dao.PrivilegeDao">
|
||||
|
||||
<resultMap id="PrivilegeEntity"
|
||||
type="com.gangquan360.smartadmin.module.privilege.domain.entity.PrivilegeEntity"></resultMap>
|
||||
|
||||
<sql id="baseSql">
|
||||
p.id,
|
||||
p.type,
|
||||
p.name,
|
||||
p.key,
|
||||
p.url,
|
||||
p.sort,
|
||||
p.parent_key,
|
||||
p.update_time,
|
||||
p.create_time
|
||||
</sql>
|
||||
|
||||
<select id="selectByType" resultMap="PrivilegeEntity">
|
||||
SELECT
|
||||
<include refid="baseSql"></include>
|
||||
FROM
|
||||
t_privilege p
|
||||
WHERE
|
||||
p.type = #{type}
|
||||
</select>
|
||||
|
||||
|
||||
<select id="selectByExcludeType" resultMap="PrivilegeEntity">
|
||||
SELECT
|
||||
<include refid="baseSql"></include>
|
||||
FROM
|
||||
t_privilege p
|
||||
WHERE
|
||||
p.type <> #{type}
|
||||
</select>
|
||||
|
||||
|
||||
<delete id="delByKeyList">
|
||||
DELETE FROM t_privilege
|
||||
WHERE `key` IN
|
||||
<foreach collection="keyList" item="item" separator="," open="(" close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
<delete id="delByParentKeyList">
|
||||
DELETE FROM t_privilege
|
||||
WHERE parent_key IN
|
||||
<foreach collection="keyList" item="item" separator="," open="(" close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
<insert id="batchInsert" useGeneratedKeys="true" keyProperty="id" parameterType="java.util.List">
|
||||
INSERT INTO t_privilege (`type`, `name`, `key`,url,sort,parent_key,create_time,update_time) VALUES
|
||||
<foreach collection="list" item="item" separator=",">
|
||||
(
|
||||
#{item.type},
|
||||
#{item.name},
|
||||
#{item.key},
|
||||
#{item.url},
|
||||
#{item.sort},
|
||||
#{item.parentKey},
|
||||
now(),
|
||||
now()
|
||||
)
|
||||
</foreach>
|
||||
</insert>
|
||||
|
||||
<update id="batchUpdate">
|
||||
<foreach collection="updateList" item="item" index="index" separator=";">
|
||||
UPDATE t_privilege
|
||||
SET `type`=#{item.type},`name`=#{item.name},url=#{item.url},sort=#{item.sort},parent_key=#{item.parentKey},update_time=now()
|
||||
WHERE `key` = #{item.key}
|
||||
</foreach>
|
||||
</update>
|
||||
|
||||
|
||||
|
||||
<select id="selectByParentKey" resultMap="PrivilegeEntity">
|
||||
SELECT
|
||||
<include refid="baseSql"></include>
|
||||
FROM
|
||||
t_privilege p
|
||||
WHERE
|
||||
p.parent_key = #{parentKey}
|
||||
order by sort asc
|
||||
</select>
|
||||
|
||||
|
||||
<select id="selectByKey" resultMap="PrivilegeEntity">
|
||||
SELECT
|
||||
<include refid="baseSql"></include>
|
||||
FROM
|
||||
t_privilege p
|
||||
WHERE
|
||||
p.key = #{key}
|
||||
</select>
|
||||
|
||||
<select id="selectAll" resultMap="PrivilegeEntity">
|
||||
SELECT
|
||||
<include refid="baseSql"></include>,
|
||||
parent.id as parent_id
|
||||
FROM
|
||||
t_privilege p
|
||||
LEFT JOIN t_privilege parent on p.parent_key = parent.`key`
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,38 @@
|
||||
<?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.gangquan360.smartadmin.module.quartz.dao.QuartzTaskLogDao">
|
||||
|
||||
<resultMap id="QuartzTaskLogDTO"
|
||||
type="com.gangquan360.smartadmin.module.quartz.domain.dto.QuartzTaskLogVO"></resultMap>
|
||||
|
||||
|
||||
|
||||
|
||||
<sql id="baseSql">
|
||||
tl.id,
|
||||
tl.task_id,
|
||||
tl.task_name,
|
||||
tl.task_params,
|
||||
tl.process_status,
|
||||
tl.process_duration,
|
||||
tl.process_log,
|
||||
tl.ip_address,
|
||||
tl.update_time,
|
||||
tl.create_time
|
||||
</sql>
|
||||
|
||||
|
||||
<select id="queryList" resultMap="QuartzTaskLogDTO">
|
||||
SELECT
|
||||
<include refid="baseSql"></include>
|
||||
FROM
|
||||
t_quartz_task_log tl
|
||||
<where>
|
||||
<if test="queryDTO.taskId != null">
|
||||
AND tl.task_id = #{queryDTO.taskId}
|
||||
</if>
|
||||
</where>
|
||||
order BY tl.create_time DESC
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,36 @@
|
||||
<?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.gangquan360.smartadmin.module.quartz.dao.QuartzTaskDao">
|
||||
|
||||
<resultMap id="QuartzTaskDTO"
|
||||
type="com.gangquan360.smartadmin.module.quartz.domain.entity.QuartzTaskEntity"></resultMap>
|
||||
|
||||
<sql id="baseSql">
|
||||
t.id,
|
||||
t.task_name,
|
||||
t.task_bean,
|
||||
t.task_params,
|
||||
t.task_cron,
|
||||
t.task_status,
|
||||
t.remark,
|
||||
t.update_time,
|
||||
t.create_time
|
||||
</sql>
|
||||
|
||||
|
||||
<select id="queryList" resultMap="QuartzTaskDTO">
|
||||
SELECT
|
||||
<include refid="baseSql"></include>
|
||||
FROM
|
||||
t_quartz_task t
|
||||
</select>
|
||||
|
||||
|
||||
<update id="updateStatus">
|
||||
UPDATE t_quartz_task t
|
||||
set t.task_status = #{taskStatus}
|
||||
WHERE t.id = #{taskId}
|
||||
</update>
|
||||
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,124 @@
|
||||
<?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.gangquan360.smartadmin.module.role.roleemployee.RoleEmployeeDao">
|
||||
|
||||
|
||||
<resultMap id="EmployeeDTO"
|
||||
type="com.gangquan360.smartadmin.module.employee.domain.dto.EmployeeDTO"></resultMap>
|
||||
|
||||
|
||||
<sql id="baseSql">
|
||||
er.id,
|
||||
er.role_id,
|
||||
er.employee_id,
|
||||
er.update_time,
|
||||
er.create_time
|
||||
</sql>
|
||||
|
||||
|
||||
<select id="selectRoleIdByEmployeeId" resultType="java.lang.Long">
|
||||
SELECT
|
||||
er.role_id
|
||||
FROM
|
||||
t_role_employee er
|
||||
WHERE
|
||||
er.employee_id = #{employeeId}
|
||||
</select>
|
||||
|
||||
|
||||
<select id="selectEmployeeByNamePage" resultMap="EmployeeDTO">
|
||||
SELECT
|
||||
e.id,
|
||||
e.login_name,
|
||||
e.login_pwd,
|
||||
e.actual_name,
|
||||
e.nick_name,
|
||||
e.phone,
|
||||
e.id_card,
|
||||
e.birthday,
|
||||
e.email,
|
||||
e.department_id,
|
||||
e.is_leave,
|
||||
e.is_disabled,
|
||||
e.remark,
|
||||
e.update_time,
|
||||
e.create_time
|
||||
FROM
|
||||
t_role_employee er
|
||||
left join t_employee e on er.employee_id = e.id
|
||||
left join t_role r on er.role_id = r.id
|
||||
<where>
|
||||
<if test="queryDTO.roleName != null and queryDTO.roleName != ''">
|
||||
<bind name="likeRoleName" value=" '%' + queryDTO.roleName +'%' "></bind>
|
||||
AND r.role_name like #{likeRoleName}
|
||||
</if>
|
||||
<if test="queryDTO.roleId != null">
|
||||
AND er.role_id = #{queryDTO.roleId}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectEmployeeByRoleId" resultMap="EmployeeDTO">
|
||||
SELECT
|
||||
e.id,
|
||||
e.login_name,
|
||||
e.login_pwd,
|
||||
e.actual_name,
|
||||
e.nick_name,
|
||||
e.phone,
|
||||
e.id_card,
|
||||
e.birthday,
|
||||
e.email,
|
||||
e.department_id,
|
||||
e.is_leave,
|
||||
e.is_disabled,
|
||||
e.remark,
|
||||
e.update_time,
|
||||
e.create_time
|
||||
FROM
|
||||
t_role_employee er
|
||||
left join t_employee e on er.employee_id = e.id
|
||||
WHERE
|
||||
er.role_id = #{roleId}
|
||||
</select>
|
||||
|
||||
|
||||
<delete id="deleteByEmployeeId">
|
||||
DELETE FROM t_role_employee
|
||||
WHERE employee_id = #{employeeId}
|
||||
</delete>
|
||||
|
||||
|
||||
<delete id="deleteByRoleId">
|
||||
DELETE FROM t_role_employee
|
||||
WHERE role_id = #{roleId}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteByEmployeeIdRoleId">
|
||||
DELETE FROM t_role_employee
|
||||
WHERE role_id = #{roleId} and employee_id = #{employeeId}
|
||||
</delete>
|
||||
|
||||
|
||||
<delete id="batchDeleteEmployeeRole">
|
||||
DELETE FROM t_role_employee
|
||||
WHERE role_id = #{roleId} and employee_id in
|
||||
<foreach collection="employeeIds" item="item" open="(" close= ")" separator=",">
|
||||
#{item}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
<insert id="batchInsert" useGeneratedKeys="true" keyProperty="id" parameterType="java.util.List">
|
||||
INSERT INTO t_role_employee (role_id, employee_id, update_time, create_time) VALUES
|
||||
<foreach collection="list" item="item" separator=",">
|
||||
(
|
||||
#{item.roleId},
|
||||
#{item.employeeId},
|
||||
now(),
|
||||
now()
|
||||
)
|
||||
</foreach>
|
||||
</insert>
|
||||
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,27 @@
|
||||
<?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.gangquan360.smartadmin.module.role.basic.RoleDao">
|
||||
|
||||
<resultMap id="RoleEntity"
|
||||
type="com.gangquan360.smartadmin.module.role.basic.domain.entity.RoleEntity"></resultMap>
|
||||
|
||||
|
||||
<sql id="baseSql">
|
||||
r.id,
|
||||
r.role_name,
|
||||
r.remark,
|
||||
r.update_time,
|
||||
r.create_time
|
||||
</sql>
|
||||
|
||||
|
||||
<select id="getByRoleName" resultMap="RoleEntity">
|
||||
SELECT
|
||||
<include refid="baseSql"></include>
|
||||
FROM
|
||||
t_role r
|
||||
WHERE
|
||||
r.role_name = #{roleName}
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,72 @@
|
||||
<?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.gangquan360.smartadmin.module.role.roleprivilege.RolePrivilegeDao">
|
||||
|
||||
<resultMap id="RolePrivilegeEntity"
|
||||
type="com.gangquan360.smartadmin.module.role.roleprivilege.domain.entity.RolePrivilegeEntity"></resultMap>
|
||||
|
||||
<resultMap id="PrivilegeEntity"
|
||||
type="com.gangquan360.smartadmin.module.privilege.domain.entity.PrivilegeEntity"></resultMap>
|
||||
|
||||
<sql id="baseSql">
|
||||
rp.id,
|
||||
rp.role_id,
|
||||
rp.privilege_key,
|
||||
rp.update_time,
|
||||
rp.create_time
|
||||
</sql>
|
||||
|
||||
|
||||
<delete id="deleteByRoleId">
|
||||
DELETE FROM t_role_privilege
|
||||
WHERE role_id = #{roleId}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteByPrivilegeKey">
|
||||
DELETE FROM t_role_privilege
|
||||
WHERE privilege_key in
|
||||
<foreach collection="privilegeKeyList" item="item" open="(" close=")" separator=",">
|
||||
#{item}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
|
||||
<insert id="batchInsert" useGeneratedKeys="true" keyProperty="id" parameterType="java.util.List">
|
||||
INSERT INTO t_role_privilege (role_id, privilege_key, update_time, create_time) VALUES
|
||||
<foreach collection="list" item="item" separator=",">
|
||||
(
|
||||
#{item.roleId},
|
||||
#{item.privilegeKey},
|
||||
now(),
|
||||
now()
|
||||
)
|
||||
</foreach>
|
||||
</insert>
|
||||
|
||||
|
||||
|
||||
<select id="listByRoleIds" resultMap="PrivilegeEntity">
|
||||
SELECT DISTINCT p.*
|
||||
FROM
|
||||
t_privilege p
|
||||
left JOIN t_role_privilege rp on p.key = rp.privilege_key
|
||||
WHERE
|
||||
rp.role_id IN
|
||||
<foreach collection="roleIds" item="item" open="(" close=")" separator=",">
|
||||
#{item}
|
||||
</foreach>
|
||||
order by p.create_time desc
|
||||
</select>
|
||||
|
||||
<select id="listByRoleId" resultMap="PrivilegeEntity">
|
||||
SELECT p.*
|
||||
FROM
|
||||
t_privilege p
|
||||
left JOIN t_role_privilege rp on p.key = rp.privilege_key
|
||||
WHERE
|
||||
rp.role_id = #{roleId}
|
||||
|
||||
</select>
|
||||
|
||||
|
||||
</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.gangquan360.smartadmin.module.smartreload.dao.ReloadItemDao">
|
||||
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,18 @@
|
||||
<?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.gangquan360.smartadmin.module.smartreload.dao.ReloadResultDao">
|
||||
|
||||
<resultMap id="reloadResultEntity"
|
||||
type="com.gangquan360.smartadmin.module.smartreload.domain.entity.ReloadResultEntity"></resultMap>
|
||||
|
||||
<select id="query" resultMap="reloadResultEntity">
|
||||
SELECT
|
||||
*
|
||||
FROM
|
||||
t_reload_result
|
||||
WHERE
|
||||
tag = #{tag}
|
||||
ORDER BY
|
||||
create_time DESC
|
||||
</select>
|
||||
</mapper>
|
||||
@@ -0,0 +1,98 @@
|
||||
<?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.gangquan360.smartadmin.module.systemconfig.SystemConfigDao">
|
||||
|
||||
<resultMap id="systemConfigMap" type="com.gangquan360.smartadmin.module.systemconfig.domain.entity.SystemConfigEntity"></resultMap>
|
||||
|
||||
<!-- 查询所有系统配置(分页) -->
|
||||
<select id="selectSystemSettingList" resultMap="systemConfigMap">
|
||||
SELECT
|
||||
id,
|
||||
config_name,
|
||||
config_key,
|
||||
config_value,
|
||||
config_group,
|
||||
is_using,
|
||||
remark,
|
||||
create_time,
|
||||
update_time
|
||||
FROM
|
||||
t_system_config
|
||||
<where>
|
||||
<if test="key != null and key != ''">
|
||||
<bind name="keyLike" value=" '%' + key +'%' "></bind>
|
||||
AND config_key LIKE #{keyLike}
|
||||
</if>
|
||||
<if test="configGroup != null">
|
||||
<bind name="configGroupLike" value=" '%' + configGroup +'%' "></bind>
|
||||
AND config_group like #{configGroupLike}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
<select id="getListByGroup" resultMap="systemConfigMap">
|
||||
SELECT
|
||||
id,
|
||||
config_name,
|
||||
config_key,
|
||||
config_value,
|
||||
config_group,
|
||||
is_using,
|
||||
remark,
|
||||
create_time,
|
||||
update_time
|
||||
FROM
|
||||
t_system_config where config_group= #{group}
|
||||
</select>
|
||||
<!-- 根据key查询获取数据 -->
|
||||
<select id="getByKey" resultMap="systemConfigMap">
|
||||
SELECT
|
||||
id,
|
||||
config_name,
|
||||
config_key,
|
||||
config_value,
|
||||
config_group,
|
||||
is_using,
|
||||
remark,
|
||||
create_time,
|
||||
update_time
|
||||
FROM
|
||||
t_system_config
|
||||
WHERE
|
||||
config_key = #{key}
|
||||
</select>
|
||||
|
||||
|
||||
|
||||
<select id="getByKeyExcludeId" resultMap="systemConfigMap">
|
||||
SELECT
|
||||
id,
|
||||
config_name,
|
||||
config_key,
|
||||
config_value,
|
||||
config_group,
|
||||
is_using,
|
||||
remark,
|
||||
create_time,
|
||||
update_time
|
||||
FROM
|
||||
t_system_config
|
||||
WHERE
|
||||
config_key = #{key} and id <> #{excludeId}
|
||||
</select>
|
||||
|
||||
<select id="selectByKeyAndGroup" resultMap="systemConfigMap">
|
||||
SELECT
|
||||
id,
|
||||
config_name,
|
||||
config_key,
|
||||
config_value,
|
||||
config_group,
|
||||
is_using,
|
||||
remark,
|
||||
create_time,
|
||||
update_time
|
||||
FROM
|
||||
t_system_config
|
||||
WHERE config_group = #{group} AND config_key = #{configKey}
|
||||
</select>
|
||||
</mapper>
|
||||
@@ -0,0 +1,122 @@
|
||||
######################### server ###################
|
||||
server.servlet.context-path=/smart-admin-api
|
||||
server.port=10086
|
||||
spring.profiles.active=dev
|
||||
|
||||
######################### tomcat ###################
|
||||
server.tomcat.basedir=/home/logs/smartadmin/tomcat-logs
|
||||
server.tomcat.accesslog.enabled=true
|
||||
server.tomcat.accesslog.pattern=%t %{X-Forwarded-For}i %a "%r" %s %D (%D ms)
|
||||
|
||||
######################### jackson #########################
|
||||
spring.jackson.serialization.write-enums-using-to-string=true
|
||||
spring.jackson.deserialization.read-enums-using-to-string=true
|
||||
spring.jackson.deserialization.fail-on-unknown-properties=false
|
||||
spring.jackson.default-property-inclusion=always
|
||||
spring.jackson.date-format=yyyy-MM-dd HH:mm:ss
|
||||
spring.jackson.time-zone=GMT+8
|
||||
spring.jackson.serialization.write-dates-as-timestamps=false
|
||||
|
||||
######################### http file #########################
|
||||
spring.servlet.multipart.max-file-size=30MB
|
||||
spring.servlet.multipart.max-request-size=30MB
|
||||
file-upload-service.path=/home/upload/
|
||||
file-upload-service.geturl=http://172.16.0.145/smartAdmin/file/
|
||||
|
||||
######################### database #########################
|
||||
spring.datasource.url=jdbc:mysql://127.0.0.1:3306/smart-admin-dev?autoReconnect=true&useServerPreparedStmts=false&rewriteBatchedStatements=true&characterEncoding=UTF-8&useSSL=false&allowMultiQueries=true&serverTimezone=UTC
|
||||
spring.datasource.username=erp
|
||||
spring.datasource.password=listen1015
|
||||
spring.datasource.initial-size=2
|
||||
spring.datasource.min-idle=1
|
||||
spring.datasource.max-active=10
|
||||
spring.datasource.max-wait=60000
|
||||
spring.datasource.time-between-eviction-runs-millis=60000
|
||||
spring.datasource.min-evictable-edle-time-millis=300000
|
||||
spring.datasource.driver-class-name=com.mysql.jdbc.Driver
|
||||
spring.datasource.filters=stat
|
||||
spring.datasource.druid.username=druid
|
||||
spring.datasource.druid.password=Gq123456
|
||||
spring.datasource.druid.login.enabled=false
|
||||
|
||||
######################### redis #######################################
|
||||
spring.redis.database=13
|
||||
spring.redis.host=172.16.0.145
|
||||
spring.redis.jedis.pool.max-active=100
|
||||
spring.redis.jedis.pool.min-idle=5
|
||||
spring.redis.jedis.pool.max-idle=10
|
||||
spring.redis.jedis.pool.max-wait=30000ms
|
||||
spring.redis.port=50000
|
||||
spring.redis.timeout=10000ms
|
||||
spring.redis.password=
|
||||
|
||||
########################## rest http pool #########################
|
||||
#\u6700\u5927\u8FDE\u63A5\u6570
|
||||
http.pool.max-total=100
|
||||
#\u5355\u8DEF\u7531\u6700\u5927\u8FDE\u63A5\u6570
|
||||
http.pool.default-max-per-route=25
|
||||
#\u670D\u52A1\u5668\u8FD4\u56DE\u6570\u636E(response)\u7684\u65F6\u95F4
|
||||
http.pool.socket-timeout=8000
|
||||
#\u8FDE\u63A5\u4E0A\u670D\u52A1\u5668(\u63E1\u624B\u6210\u529F)\u7684\u65F6\u95F4
|
||||
http.pool.connect-timeout=8000
|
||||
#\u4ECE\u8FDE\u63A5\u6C60\u4E2D\u83B7\u53D6\u8FDE\u63A5\u7684\u8D85\u65F6\u65F6\u95F4
|
||||
http.pool.connection-request-timeout=8000
|
||||
|
||||
######################### mybatis\u914D\u7F6E #########################
|
||||
mybatis.configuration.log-impl=org.apache.ibatis.logging.stdout.StdOutImpl
|
||||
# mybatis-plus \u5B57\u6BB5\u9A7C\u5CF0\u81EA\u52A8\u8F6C\u6362
|
||||
mybatis-plus.configuration.map-underscore-to-camel-case=true
|
||||
mybatis-plus.mapper-locations=classpath:/mapper/*Mapper.xml,/mapper/*/*Mapper.xml
|
||||
mybatis-plus.typeAliasesPackage=com.gangquan360.smartadmin.*.*.domain.entity
|
||||
mybatis-plus.global-config.refresh-mapper=true
|
||||
mybatis-plus.global-config.db-column-underline=true
|
||||
|
||||
######################### swagger #########################
|
||||
swagger.apiGroupName=smartAdmin
|
||||
swagger.title=smartAdmin
|
||||
swagger.description=smartAdmin
|
||||
swagger.version=1.0
|
||||
swagger.serviceUrl=http://localhost:10086/smart-admin-api
|
||||
swagger.packAge=com.gangquan360.smartadmin.module
|
||||
|
||||
######################### jwt #########################
|
||||
jwt.key=smart-admin-jwt-key
|
||||
|
||||
########################## smart reload #########################
|
||||
smart-reload.thread-count=1
|
||||
smart-reload.time-interval=5
|
||||
|
||||
######################### cros #########################
|
||||
access-control-allow-origin=*
|
||||
|
||||
######################### heart beat #########################
|
||||
heart-beat.delayHandlerTime=60000
|
||||
heart-beat.intervalTime=180000
|
||||
|
||||
######################### quartz #############################
|
||||
#\u8C03\u5EA6\u6807\u8BC6\u540D \u96C6\u7FA4\u4E2D\u6BCF\u4E00\u4E2A\u5B9E\u4F8B\u90FD\u5FC5\u987B\u4F7F\u7528\u76F8\u540C\u7684\u540D\u79F0
|
||||
spring.quartz.properties.org.quartz.scheduler.instanceName=devClusteredScheduler
|
||||
spring.quartz.properties.org.quartz.scheduler.instanceId=AUTO
|
||||
#\u8FDC\u7A0B\u7BA1\u7406\u76F8\u5173\u7684\u914D\u7F6E,\u5168\u90E8\u5173\u95ED
|
||||
spring.quartz.properties.org.quartz.scheduler.rmi.export=false
|
||||
spring.quartz.properties.org.quartz.scheduler.rmi.proxy=false
|
||||
#\u8DF3\u8FC7quartz\u7248\u672C\u68C0\u67E5
|
||||
spring.quartz.properties.org.quartz.scheduler.skipUpdateCheck=true
|
||||
#\u6570\u636E\u4FDD\u5B58\u65B9\u5F0F\u4E3A\u6301\u4E45\u5316
|
||||
spring.quartz.properties.org.quartz.jobStore.class=org.quartz.impl.jdbcjobstore.JobStoreTX
|
||||
spring.quartz.properties.org.quartz.jobStore.driverDelegateClass=org.quartz.impl.jdbcjobstore.StdJDBCDelegate
|
||||
spring.quartz.properties.org.quartz.jobStore.tablePrefix=QRTZ_
|
||||
spring.quartz.properties.org.quartz.jobStore.isClustered=true
|
||||
#\u8C03\u5EA6\u5B9E\u4F8B\u5931\u6548\u7684\u68C0\u67E5\u65F6\u95F4\u95F4\u9694
|
||||
spring.quartz.properties.org.quartz.jobStore.clusterCheckinInterval=10000
|
||||
spring.quartz.properties.org.quartz.jobStore.useProperties=false
|
||||
#\u8C03\u5EA6\u7EBF\u7A0B
|
||||
spring.quartz.properties.org.quartz.threadPool.class=org.quartz.simpl.SimpleThreadPool
|
||||
spring.quartz.properties.org.quartz.threadPool.threadCount=2
|
||||
spring.quartz.properties.org.quartz.threadPool.threadPriority=5
|
||||
spring.quartz.properties.org.quartz.threadPool.threadsInheritContextClassLoaderOfInitializingThread=true
|
||||
spring.quartz.properties.org.quartz.threadPool.threadNamePrefix=quartz
|
||||
spring.quartz.job-store-type=jdbc
|
||||
#ALWAYS,EMBEDDED,NEVER
|
||||
spring.quartz.jdbc.initialize-schema=NEVER
|
||||
spring.quartz.jdbc.schema=classpath:sql/quartz_mysql_2.3.0.sql
|
||||
@@ -0,0 +1,97 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!--
|
||||
status : 这个用于设置log4j2自身内部的信息输出,可以不设置,当设置成trace时,会看到log4j2内部各种详细输出
|
||||
monitorInterval : Log4j能够自动检测修改配置文件和重新配置本身, 设置间隔秒数。
|
||||
-->
|
||||
<Configuration status="INFO" monitorInterval="30">
|
||||
<Properties>
|
||||
<Property name="log-path">/home/logs/smart-admin/dev/logs</Property>
|
||||
</Properties>
|
||||
<Appenders>
|
||||
<Console name="Console" target="SYSTEM_OUT">
|
||||
<ThresholdFilter level="info" onMatch="ACCEPT" onMismatch="DENY"/>
|
||||
<PatternLayout pattern="[%d][%-5p][%t] %m (%F:%L)%n"/>
|
||||
</Console>
|
||||
<RollingFile name="debug" fileName="${log-path}/debug/smart-admin_debug.log"
|
||||
filePattern="${log-path}/debug/smart-admin_debug_%d{yyyy-MM-dd}-%i.log">
|
||||
<Filters>
|
||||
<ThresholdFilter level="info" onMatch="DENY" onMismatch="NEUTRAL"/>
|
||||
<ThresholdFilter level="debug" onMatch="ACCEPT" onMismatch="DENY"/>
|
||||
</Filters>
|
||||
<PatternLayout pattern="[%d][%-5p][%t] %m (%F:%L)%n"/>
|
||||
<Policies>
|
||||
<TimeBasedTriggeringPolicy interval="1" modulate="true"/>
|
||||
<SizeBasedTriggeringPolicy size="50 MB"/>
|
||||
</Policies>
|
||||
<DefaultRolloverStrategy max="30">
|
||||
<Delete basePath="${log-path}/debug" maxDepth="1">
|
||||
<IfFileName glob="smart-admin_debug_*.log"/>
|
||||
<IfLastModified age="15d"/>
|
||||
</Delete>
|
||||
</DefaultRolloverStrategy>
|
||||
</RollingFile>
|
||||
<RollingFile name="info" fileName="${log-path}/info/smart-admin_info.log"
|
||||
filePattern="${log-path}/info/smart-admin_info_%d{yyyy-MM-dd}-%i.log">
|
||||
<Filters>
|
||||
<ThresholdFilter level="warn" onMatch="DENY" onMismatch="NEUTRAL"/>
|
||||
<ThresholdFilter level="info" onMatch="ACCEPT" onMismatch="DENY"/>
|
||||
</Filters>
|
||||
<PatternLayout pattern="[%d][%-5p][%t] %m (%F:%L)%n"/>
|
||||
<Policies>
|
||||
<TimeBasedTriggeringPolicy interval="1" modulate="true"/>
|
||||
<SizeBasedTriggeringPolicy size="50 MB"/>
|
||||
</Policies>
|
||||
<DefaultRolloverStrategy max="30">
|
||||
<Delete basePath="${log-path}/info" maxDepth="1">
|
||||
<IfFileName glob="smart-admin_info_*.log"/>
|
||||
<IfLastModified age="15d"/>
|
||||
</Delete>
|
||||
</DefaultRolloverStrategy>
|
||||
</RollingFile>
|
||||
<RollingFile name="warn" fileName="${log-path}/warn/smart-admin_warn.log"
|
||||
filePattern="${log-path}/warn/smart-admin_warn_%d{yyyy-MM-dd}-%i.log">
|
||||
<Filters>
|
||||
<ThresholdFilter level="error" onMatch="DENY" onMismatch="NEUTRAL"/>
|
||||
<ThresholdFilter level="warn" onMatch="ACCEPT" onMismatch="DENY"/>
|
||||
</Filters>
|
||||
<PatternLayout pattern="[%d][%-5p][%t] %m (%F:%L)%n"/>
|
||||
<Policies>
|
||||
<TimeBasedTriggeringPolicy interval="1" modulate="true"/>
|
||||
<SizeBasedTriggeringPolicy size="50 MB"/>
|
||||
</Policies>
|
||||
<DefaultRolloverStrategy max="30">
|
||||
<Delete basePath="${log-path}/warn" maxDepth="1">
|
||||
<IfFileName glob="smart-admin_warn_*.log"/>
|
||||
<IfLastModified age="15d"/>
|
||||
</Delete>
|
||||
</DefaultRolloverStrategy>
|
||||
</RollingFile>
|
||||
<RollingFile name="error" fileName="${log-path}/error/smart-admin_error.log"
|
||||
filePattern="${log-path}/error/smart-admin_error_%d{yyyy-MM-dd}-%i.log">
|
||||
<Filters>
|
||||
<ThresholdFilter level="fatal" onMatch="DENY" onMismatch="NEUTRAL"/>
|
||||
<ThresholdFilter level="error" onMatch="ACCEPT" onMismatch="DENY"/>
|
||||
</Filters>
|
||||
<PatternLayout pattern="[%d][%-5p][%t] %m (%F:%L)%n"/>
|
||||
<Policies>
|
||||
<TimeBasedTriggeringPolicy interval="1" modulate="true"/>
|
||||
<SizeBasedTriggeringPolicy size="10 MB"/>
|
||||
</Policies>
|
||||
<DefaultRolloverStrategy max="30">
|
||||
<Delete basePath="${log-path}/error" maxDepth="1">
|
||||
<IfFileName glob="smart-admin_error_*.log"/>
|
||||
<IfLastModified age="15d"/>
|
||||
</Delete>
|
||||
</DefaultRolloverStrategy>
|
||||
</RollingFile>
|
||||
</Appenders>
|
||||
<Loggers>
|
||||
<Root level="warn">
|
||||
<AppenderRef ref="Console"/>
|
||||
<AppenderRef ref="debug"/>
|
||||
<AppenderRef ref="info"/>
|
||||
<AppenderRef ref="warn"/>
|
||||
<AppenderRef ref="error"/>
|
||||
</Root>
|
||||
</Loggers>
|
||||
</Configuration>
|
||||
@@ -0,0 +1,122 @@
|
||||
######################### server ###################
|
||||
server.servlet.context-path=/smart-admin-api
|
||||
server.port=10088
|
||||
spring.profiles.active=@profiles.active@
|
||||
|
||||
######################### tomcat ###################
|
||||
server.tomcat.basedir=/home/logs/smart-admin/tomcat-logs
|
||||
server.tomcat.accesslog.enabled=true
|
||||
server.tomcat.accesslog.pattern=%t %{X-Forwarded-For}i %a "%r" %s %D (%D ms)
|
||||
|
||||
######################### jackson #########################
|
||||
spring.jackson.serialization.write-enums-using-to-string=true
|
||||
spring.jackson.deserialization.read-enums-using-to-string=true
|
||||
spring.jackson.deserialization.fail-on-unknown-properties=false
|
||||
|
||||
spring.jackson.default-property-inclusion=always
|
||||
spring.jackson.date-format=yyyy-MM-dd HH:mm:ss
|
||||
spring.jackson.time-zone=GMT+8
|
||||
spring.jackson.serialization.write-dates-as-timestamps=false
|
||||
|
||||
######################### http file #########################
|
||||
spring.servlet.multipart.max-file-size=30MB
|
||||
spring.servlet.multipart.max-request-size=30MB
|
||||
file-upload-service.path=/home/upload/smart-admin-file
|
||||
file-upload-service.geturl=http://smartadmin.gangquan360.com/demoAdmin/file/
|
||||
|
||||
######################### database #########################
|
||||
spring.datasource.url=jdbc:mysql://172.16.0.201:3306/smart-admin-prod?autoReconnect=true&useServerPreparedStmts=false&rewriteBatchedStatements=true&characterEncoding=UTF-8&useSSL=false&allowMultiQueries=true
|
||||
spring.datasource.username=smart-admin
|
||||
spring.datasource.password=Admin@123457
|
||||
spring.datasource.initial-size=2
|
||||
spring.datasource.min-idle=1
|
||||
spring.datasource.max-active=10
|
||||
spring.datasource.max-wait=60000
|
||||
spring.datasource.time-between-eviction-runs-millis=60000
|
||||
spring.datasource.min-evictable-edle-time-millis=300000
|
||||
spring.datasource.driver-class-name=com.mysql.jdbc.Driver
|
||||
spring.datasource.filters=stat
|
||||
spring.datasource.druid.username=druid
|
||||
spring.datasource.druid.password=Gq123456
|
||||
spring.datasource.druid.login.enabled=false
|
||||
|
||||
######################### redis #######################################
|
||||
spring.redis.database=13
|
||||
spring.redis.host=127.0.0.1
|
||||
spring.redis.jedis.pool.max-active=100
|
||||
spring.redis.jedis.pool.min-idle=5
|
||||
spring.redis.jedis.pool.max-idle=10
|
||||
spring.redis.jedis.pool.max-wait=30000ms
|
||||
spring.redis.port=6379
|
||||
spring.redis.timeout=10000ms
|
||||
spring.redis.password=Gq123456@
|
||||
|
||||
########################## rest http pool #########################
|
||||
#\u6700\u5927\u8FDE\u63A5\u6570
|
||||
http.pool.max-total=100
|
||||
#\u5355\u8DEF\u7531\u6700\u5927\u8FDE\u63A5\u6570
|
||||
http.pool.default-max-per-route=25
|
||||
#\u670D\u52A1\u5668\u8FD4\u56DE\u6570\u636E(response)\u7684\u65F6\u95F4
|
||||
http.pool.socket-timeout=8000
|
||||
#\u8FDE\u63A5\u4E0A\u670D\u52A1\u5668(\u63E1\u624B\u6210\u529F)\u7684\u65F6\u95F4
|
||||
http.pool.connect-timeout=8000
|
||||
#\u4ECE\u8FDE\u63A5\u6C60\u4E2D\u83B7\u53D6\u8FDE\u63A5\u7684\u8D85\u65F6\u65F6\u95F4
|
||||
http.pool.connection-request-timeout=8000
|
||||
|
||||
######################### mybatis\u914D\u7F6E #########################
|
||||
mybatis.configuration.log-impl=org.apache.ibatis.logging.stdout.StdOutImpl
|
||||
# mybatis-plus \u5B57\u6BB5\u9A7C\u5CF0\u81EA\u52A8\u8F6C\u6362
|
||||
mybatis-plus.configuration.map-underscore-to-camel-case=true
|
||||
mybatis-plus.mapper-locations=classpath:/mapper/*Mapper.xml,/mapper/*/*Mapper.xml
|
||||
mybatis-plus.typeAliasesPackage=com.gangquan360.smartadmin.*.*.domain.entity
|
||||
mybatis-plus.global-config.refresh-mapper=true
|
||||
mybatis-plus.global-config.db-column-underline=true
|
||||
|
||||
######################### swagger #########################
|
||||
swagger.apiGroupName=smartAdmin
|
||||
swagger.title=smartAdmin
|
||||
swagger.description=smartAdmin
|
||||
swagger.version=1.0
|
||||
swagger.serviceUrl=http://localhost:10086/smart-admin-api
|
||||
swagger.packAge=com.gangquan360.smartadmin.module
|
||||
|
||||
######################### jwt #########################
|
||||
jwt.key=smart-admin-jwt-key
|
||||
|
||||
########################## smart reload #########################
|
||||
smart-reload.thread-count=2
|
||||
smart-reload.time-interval=20
|
||||
######################### cros #########################
|
||||
access-control-allow-origin=preview.smartadmin.1024lab.net
|
||||
######################### heart beat #########################
|
||||
heart-beat.delayHandlerTime=60000
|
||||
heart-beat.intervalTime=180000
|
||||
|
||||
######################### quartz #############################
|
||||
#\u8C03\u5EA6\u6807\u8BC6\u540D \u96C6\u7FA4\u4E2D\u6BCF\u4E00\u4E2A\u5B9E\u4F8B\u90FD\u5FC5\u987B\u4F7F\u7528\u76F8\u540C\u7684\u540D\u79F0
|
||||
spring.quartz.properties.org.quartz.scheduler.instanceName=prodClusteredScheduler
|
||||
spring.quartz.properties.org.quartz.scheduler.instanceId=AUTO
|
||||
#\u8FDC\u7A0B\u7BA1\u7406\u76F8\u5173\u7684\u914D\u7F6E,\u5168\u90E8\u5173\u95ED
|
||||
spring.quartz.properties.org.quartz.scheduler.rmi.export=false
|
||||
spring.quartz.properties.org.quartz.scheduler.rmi.proxy=false
|
||||
#\u8DF3\u8FC7quartz\u7248\u672C\u68C0\u67E5
|
||||
spring.quartz.properties.org.quartz.scheduler.skipUpdateCheck=true
|
||||
#\u6570\u636E\u4FDD\u5B58\u65B9\u5F0F\u4E3A\u6301\u4E45\u5316
|
||||
spring.quartz.properties.org.quartz.jobStore.class=org.quartz.impl.jdbcjobstore.JobStoreTX
|
||||
spring.quartz.properties.org.quartz.jobStore.driverDelegateClass=org.quartz.impl.jdbcjobstore.StdJDBCDelegate
|
||||
spring.quartz.properties.org.quartz.jobStore.tablePrefix=QRTZ_
|
||||
spring.quartz.properties.org.quartz.jobStore.isClustered=true
|
||||
#\u8C03\u5EA6\u5B9E\u4F8B\u5931\u6548\u7684\u68C0\u67E5\u65F6\u95F4\u95F4\u9694
|
||||
spring.quartz.properties.org.quartz.jobStore.clusterCheckinInterval=10000
|
||||
spring.quartz.properties.org.quartz.jobStore.useProperties=false
|
||||
#\u8C03\u5EA6\u7EBF\u7A0B
|
||||
spring.quartz.properties.org.quartz.threadPool.class=org.quartz.simpl.SimpleThreadPool
|
||||
spring.quartz.properties.org.quartz.threadPool.threadCount=2
|
||||
spring.quartz.properties.org.quartz.threadPool.threadPriority=5
|
||||
spring.quartz.properties.org.quartz.threadPool.threadsInheritContextClassLoaderOfInitializingThread=true
|
||||
spring.quartz.properties.org.quartz.threadPool.threadNamePrefix=quartz
|
||||
|
||||
spring.quartz.job-store-type=jdbc
|
||||
#ALWAYS,EMBEDDED,NEVER
|
||||
spring.quartz.jdbc.initialize-schema=NEVER
|
||||
spring.quartz.jdbc.schema=classpath:sql/quartz_mysql_2.3.0.sql
|
||||
@@ -0,0 +1,97 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!--
|
||||
status : 这个用于设置log4j2自身内部的信息输出,可以不设置,当设置成trace时,会看到log4j2内部各种详细输出
|
||||
monitorInterval : Log4j能够自动检测修改配置文件和重新配置本身, 设置间隔秒数。
|
||||
-->
|
||||
<Configuration status="INFO" monitorInterval="30">
|
||||
<Properties>
|
||||
<Property name="log-path">/home/logs/smart-admin</Property>
|
||||
</Properties>
|
||||
<Appenders>
|
||||
<Console name="Console" target="SYSTEM_OUT">
|
||||
<ThresholdFilter level="info" onMatch="ACCEPT" onMismatch="DENY"/>
|
||||
<PatternLayout pattern="[%d][%-5p][%t] %m (%F:%L)%n"/>
|
||||
</Console>
|
||||
<RollingFile name="debug" fileName="${log-path}/debug/smart-admin_debug.log"
|
||||
filePattern="${log-path}/debug/smart-admin_debug_%d{yyyy-MM-dd}-%i.log">
|
||||
<Filters>
|
||||
<ThresholdFilter level="info" onMatch="DENY" onMismatch="NEUTRAL"/>
|
||||
<ThresholdFilter level="debug" onMatch="ACCEPT" onMismatch="DENY"/>
|
||||
</Filters>
|
||||
<PatternLayout pattern="[%d][%-5p][%t] %m (%F:%L)%n"/>
|
||||
<Policies>
|
||||
<TimeBasedTriggeringPolicy interval="1" modulate="true"/>
|
||||
<SizeBasedTriggeringPolicy size="50 MB"/>
|
||||
</Policies>
|
||||
<DefaultRolloverStrategy max="30">
|
||||
<Delete basePath="${log-path}/debug" maxDepth="1">
|
||||
<IfFileName glob="smart-admin_debug_*.log"/>
|
||||
<IfLastModified age="15d"/>
|
||||
</Delete>
|
||||
</DefaultRolloverStrategy>
|
||||
</RollingFile>
|
||||
<RollingFile name="info" fileName="${log-path}/info/smart-admin_info.log"
|
||||
filePattern="${log-path}/info/smart-admin_info_%d{yyyy-MM-dd}-%i.log">
|
||||
<Filters>
|
||||
<ThresholdFilter level="warn" onMatch="DENY" onMismatch="NEUTRAL"/>
|
||||
<ThresholdFilter level="info" onMatch="ACCEPT" onMismatch="DENY"/>
|
||||
</Filters>
|
||||
<PatternLayout pattern="[%d][%-5p][%t] %m (%F:%L)%n"/>
|
||||
<Policies>
|
||||
<TimeBasedTriggeringPolicy interval="1" modulate="true"/>
|
||||
<SizeBasedTriggeringPolicy size="50 MB"/>
|
||||
</Policies>
|
||||
<DefaultRolloverStrategy max="30">
|
||||
<Delete basePath="${log-path}/info" maxDepth="1">
|
||||
<IfFileName glob="smart-admin_info_*.log"/>
|
||||
<IfLastModified age="15d"/>
|
||||
</Delete>
|
||||
</DefaultRolloverStrategy>
|
||||
</RollingFile>
|
||||
<RollingFile name="warn" fileName="${log-path}/warn/smart-admin_warn.log"
|
||||
filePattern="${log-path}/warn/smart-admin_warn_%d{yyyy-MM-dd}-%i.log">
|
||||
<Filters>
|
||||
<ThresholdFilter level="error" onMatch="DENY" onMismatch="NEUTRAL"/>
|
||||
<ThresholdFilter level="warn" onMatch="ACCEPT" onMismatch="DENY"/>
|
||||
</Filters>
|
||||
<PatternLayout pattern="[%d][%-5p][%t] %m (%F:%L)%n"/>
|
||||
<Policies>
|
||||
<TimeBasedTriggeringPolicy interval="1" modulate="true"/>
|
||||
<SizeBasedTriggeringPolicy size="50 MB"/>
|
||||
</Policies>
|
||||
<DefaultRolloverStrategy max="30">
|
||||
<Delete basePath="${log-path}/warn" maxDepth="1">
|
||||
<IfFileName glob="smart-admin_warn_*.log"/>
|
||||
<IfLastModified age="15d"/>
|
||||
</Delete>
|
||||
</DefaultRolloverStrategy>
|
||||
</RollingFile>
|
||||
<RollingFile name="error" fileName="${log-path}/error/smart-admin_error.log"
|
||||
filePattern="${log-path}/error/smart-admin_error_%d{yyyy-MM-dd}-%i.log">
|
||||
<Filters>
|
||||
<ThresholdFilter level="fatal" onMatch="DENY" onMismatch="NEUTRAL"/>
|
||||
<ThresholdFilter level="error" onMatch="ACCEPT" onMismatch="DENY"/>
|
||||
</Filters>
|
||||
<PatternLayout pattern="[%d][%-5p][%t] %m (%F:%L)%n"/>
|
||||
<Policies>
|
||||
<TimeBasedTriggeringPolicy interval="1" modulate="true"/>
|
||||
<SizeBasedTriggeringPolicy size="10 MB"/>
|
||||
</Policies>
|
||||
<DefaultRolloverStrategy max="30">
|
||||
<Delete basePath="${log-path}/error" maxDepth="1">
|
||||
<IfFileName glob="smart-admin_error_*.log"/>
|
||||
<IfLastModified age="15d"/>
|
||||
</Delete>
|
||||
</DefaultRolloverStrategy>
|
||||
</RollingFile>
|
||||
</Appenders>
|
||||
<Loggers>
|
||||
<Root level="warn">
|
||||
<AppenderRef ref="Console"/>
|
||||
<AppenderRef ref="debug"/>
|
||||
<AppenderRef ref="info"/>
|
||||
<AppenderRef ref="warn"/>
|
||||
<AppenderRef ref="error"/>
|
||||
</Root>
|
||||
</Loggers>
|
||||
</Configuration>
|
||||
@@ -0,0 +1,122 @@
|
||||
######################### server ###################
|
||||
server.servlet.context-path=/smart-admin-api
|
||||
server.port=10086
|
||||
spring.profiles.active=dev
|
||||
|
||||
######################### tomcat ###################
|
||||
server.tomcat.basedir=/home/logs/smartadmin/tomcat-logs
|
||||
server.tomcat.accesslog.enabled=true
|
||||
server.tomcat.accesslog.pattern=%t %{X-Forwarded-For}i %a "%r" %s %D (%D ms)
|
||||
|
||||
######################### jackson #########################
|
||||
spring.jackson.serialization.write-enums-using-to-string=true
|
||||
spring.jackson.deserialization.read-enums-using-to-string=true
|
||||
spring.jackson.deserialization.fail-on-unknown-properties=false
|
||||
spring.jackson.default-property-inclusion=always
|
||||
spring.jackson.date-format=yyyy-MM-dd HH:mm:ss
|
||||
spring.jackson.time-zone=GMT+8
|
||||
spring.jackson.serialization.write-dates-as-timestamps=false
|
||||
|
||||
######################### http file #########################
|
||||
spring.servlet.multipart.max-file-size=30MB
|
||||
spring.servlet.multipart.max-request-size=30MB
|
||||
file-upload-service.path=/home/upload/
|
||||
file-upload-service.geturl=http://172.16.0.145/smartAdmin/file/
|
||||
|
||||
######################### database #########################
|
||||
spring.datasource.url=jdbc:mysql://127.0.0.1:3306/smart-admin-dev?autoReconnect=true&useServerPreparedStmts=false&rewriteBatchedStatements=true&characterEncoding=UTF-8&useSSL=false&allowMultiQueries=true&serverTimezone=UTC
|
||||
spring.datasource.username=erp
|
||||
spring.datasource.password=listen1015
|
||||
spring.datasource.initial-size=2
|
||||
spring.datasource.min-idle=1
|
||||
spring.datasource.max-active=10
|
||||
spring.datasource.max-wait=60000
|
||||
spring.datasource.time-between-eviction-runs-millis=60000
|
||||
spring.datasource.min-evictable-edle-time-millis=300000
|
||||
spring.datasource.driver-class-name=com.mysql.jdbc.Driver
|
||||
spring.datasource.filters=stat
|
||||
spring.datasource.druid.username=druid
|
||||
spring.datasource.druid.password=Gq123456
|
||||
spring.datasource.druid.login.enabled=false
|
||||
|
||||
######################### redis #######################################
|
||||
spring.redis.database=13
|
||||
spring.redis.host=172.16.0.145
|
||||
spring.redis.jedis.pool.max-active=100
|
||||
spring.redis.jedis.pool.min-idle=5
|
||||
spring.redis.jedis.pool.max-idle=10
|
||||
spring.redis.jedis.pool.max-wait=30000ms
|
||||
spring.redis.port=50000
|
||||
spring.redis.timeout=10000ms
|
||||
spring.redis.password=
|
||||
|
||||
########################## rest http pool #########################
|
||||
#\u6700\u5927\u8FDE\u63A5\u6570
|
||||
http.pool.max-total=100
|
||||
#\u5355\u8DEF\u7531\u6700\u5927\u8FDE\u63A5\u6570
|
||||
http.pool.default-max-per-route=25
|
||||
#\u670D\u52A1\u5668\u8FD4\u56DE\u6570\u636E(response)\u7684\u65F6\u95F4
|
||||
http.pool.socket-timeout=8000
|
||||
#\u8FDE\u63A5\u4E0A\u670D\u52A1\u5668(\u63E1\u624B\u6210\u529F)\u7684\u65F6\u95F4
|
||||
http.pool.connect-timeout=8000
|
||||
#\u4ECE\u8FDE\u63A5\u6C60\u4E2D\u83B7\u53D6\u8FDE\u63A5\u7684\u8D85\u65F6\u65F6\u95F4
|
||||
http.pool.connection-request-timeout=8000
|
||||
|
||||
######################### mybatis\u914D\u7F6E #########################
|
||||
mybatis.configuration.log-impl=org.apache.ibatis.logging.stdout.StdOutImpl
|
||||
# mybatis-plus \u5B57\u6BB5\u9A7C\u5CF0\u81EA\u52A8\u8F6C\u6362
|
||||
mybatis-plus.configuration.map-underscore-to-camel-case=true
|
||||
mybatis-plus.mapper-locations=classpath:/mapper/*Mapper.xml,/mapper/*/*Mapper.xml
|
||||
mybatis-plus.typeAliasesPackage=com.gangquan360.smartadmin.*.*.domain.entity
|
||||
mybatis-plus.global-config.refresh-mapper=true
|
||||
mybatis-plus.global-config.db-column-underline=true
|
||||
|
||||
######################### swagger #########################
|
||||
swagger.apiGroupName=smartAdmin
|
||||
swagger.title=smartAdmin
|
||||
swagger.description=smartAdmin
|
||||
swagger.version=1.0
|
||||
swagger.serviceUrl=http://localhost:10086/smart-admin-api
|
||||
swagger.packAge=com.gangquan360.smartadmin.module
|
||||
|
||||
######################### jwt #########################
|
||||
jwt.key=smart-admin-jwt-key
|
||||
|
||||
########################## smart reload #########################
|
||||
smart-reload.thread-count=1
|
||||
smart-reload.time-interval=5
|
||||
|
||||
######################### cros #########################
|
||||
access-control-allow-origin=*
|
||||
|
||||
######################### heart beat #########################
|
||||
heart-beat.delayHandlerTime=60000
|
||||
heart-beat.intervalTime=180000
|
||||
|
||||
######################### quartz #############################
|
||||
#\u8C03\u5EA6\u6807\u8BC6\u540D \u96C6\u7FA4\u4E2D\u6BCF\u4E00\u4E2A\u5B9E\u4F8B\u90FD\u5FC5\u987B\u4F7F\u7528\u76F8\u540C\u7684\u540D\u79F0
|
||||
spring.quartz.properties.org.quartz.scheduler.instanceName=devClusteredScheduler
|
||||
spring.quartz.properties.org.quartz.scheduler.instanceId=AUTO
|
||||
#\u8FDC\u7A0B\u7BA1\u7406\u76F8\u5173\u7684\u914D\u7F6E,\u5168\u90E8\u5173\u95ED
|
||||
spring.quartz.properties.org.quartz.scheduler.rmi.export=false
|
||||
spring.quartz.properties.org.quartz.scheduler.rmi.proxy=false
|
||||
#\u8DF3\u8FC7quartz\u7248\u672C\u68C0\u67E5
|
||||
spring.quartz.properties.org.quartz.scheduler.skipUpdateCheck=true
|
||||
#\u6570\u636E\u4FDD\u5B58\u65B9\u5F0F\u4E3A\u6301\u4E45\u5316
|
||||
spring.quartz.properties.org.quartz.jobStore.class=org.quartz.impl.jdbcjobstore.JobStoreTX
|
||||
spring.quartz.properties.org.quartz.jobStore.driverDelegateClass=org.quartz.impl.jdbcjobstore.StdJDBCDelegate
|
||||
spring.quartz.properties.org.quartz.jobStore.tablePrefix=QRTZ_
|
||||
spring.quartz.properties.org.quartz.jobStore.isClustered=true
|
||||
#\u8C03\u5EA6\u5B9E\u4F8B\u5931\u6548\u7684\u68C0\u67E5\u65F6\u95F4\u95F4\u9694
|
||||
spring.quartz.properties.org.quartz.jobStore.clusterCheckinInterval=10000
|
||||
spring.quartz.properties.org.quartz.jobStore.useProperties=false
|
||||
#\u8C03\u5EA6\u7EBF\u7A0B
|
||||
spring.quartz.properties.org.quartz.threadPool.class=org.quartz.simpl.SimpleThreadPool
|
||||
spring.quartz.properties.org.quartz.threadPool.threadCount=2
|
||||
spring.quartz.properties.org.quartz.threadPool.threadPriority=5
|
||||
spring.quartz.properties.org.quartz.threadPool.threadsInheritContextClassLoaderOfInitializingThread=true
|
||||
spring.quartz.properties.org.quartz.threadPool.threadNamePrefix=quartz
|
||||
spring.quartz.job-store-type=jdbc
|
||||
#ALWAYS,EMBEDDED,NEVER
|
||||
spring.quartz.jdbc.initialize-schema=NEVER
|
||||
spring.quartz.jdbc.schema=classpath:sql/quartz_mysql_2.3.0.sql
|
||||
@@ -0,0 +1,97 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!--
|
||||
status : 这个用于设置log4j2自身内部的信息输出,可以不设置,当设置成trace时,会看到log4j2内部各种详细输出
|
||||
monitorInterval : Log4j能够自动检测修改配置文件和重新配置本身, 设置间隔秒数。
|
||||
-->
|
||||
<Configuration status="INFO" monitorInterval="30">
|
||||
<Properties>
|
||||
<Property name="log-path">/home/logs/smart-admin/dev/logs</Property>
|
||||
</Properties>
|
||||
<Appenders>
|
||||
<Console name="Console" target="SYSTEM_OUT">
|
||||
<ThresholdFilter level="info" onMatch="ACCEPT" onMismatch="DENY"/>
|
||||
<PatternLayout pattern="[%d][%-5p][%t] %m (%F:%L)%n"/>
|
||||
</Console>
|
||||
<RollingFile name="debug" fileName="${log-path}/debug/smart-admin_debug.log"
|
||||
filePattern="${log-path}/debug/smart-admin_debug_%d{yyyy-MM-dd}-%i.log">
|
||||
<Filters>
|
||||
<ThresholdFilter level="info" onMatch="DENY" onMismatch="NEUTRAL"/>
|
||||
<ThresholdFilter level="debug" onMatch="ACCEPT" onMismatch="DENY"/>
|
||||
</Filters>
|
||||
<PatternLayout pattern="[%d][%-5p][%t] %m (%F:%L)%n"/>
|
||||
<Policies>
|
||||
<TimeBasedTriggeringPolicy interval="1" modulate="true"/>
|
||||
<SizeBasedTriggeringPolicy size="50 MB"/>
|
||||
</Policies>
|
||||
<DefaultRolloverStrategy max="30">
|
||||
<Delete basePath="${log-path}/debug" maxDepth="1">
|
||||
<IfFileName glob="smart-admin_debug_*.log"/>
|
||||
<IfLastModified age="15d"/>
|
||||
</Delete>
|
||||
</DefaultRolloverStrategy>
|
||||
</RollingFile>
|
||||
<RollingFile name="info" fileName="${log-path}/info/smart-admin_info.log"
|
||||
filePattern="${log-path}/info/smart-admin_info_%d{yyyy-MM-dd}-%i.log">
|
||||
<Filters>
|
||||
<ThresholdFilter level="warn" onMatch="DENY" onMismatch="NEUTRAL"/>
|
||||
<ThresholdFilter level="info" onMatch="ACCEPT" onMismatch="DENY"/>
|
||||
</Filters>
|
||||
<PatternLayout pattern="[%d][%-5p][%t] %m (%F:%L)%n"/>
|
||||
<Policies>
|
||||
<TimeBasedTriggeringPolicy interval="1" modulate="true"/>
|
||||
<SizeBasedTriggeringPolicy size="50 MB"/>
|
||||
</Policies>
|
||||
<DefaultRolloverStrategy max="30">
|
||||
<Delete basePath="${log-path}/info" maxDepth="1">
|
||||
<IfFileName glob="smart-admin_info_*.log"/>
|
||||
<IfLastModified age="15d"/>
|
||||
</Delete>
|
||||
</DefaultRolloverStrategy>
|
||||
</RollingFile>
|
||||
<RollingFile name="warn" fileName="${log-path}/warn/smart-admin_warn.log"
|
||||
filePattern="${log-path}/warn/smart-admin_warn_%d{yyyy-MM-dd}-%i.log">
|
||||
<Filters>
|
||||
<ThresholdFilter level="error" onMatch="DENY" onMismatch="NEUTRAL"/>
|
||||
<ThresholdFilter level="warn" onMatch="ACCEPT" onMismatch="DENY"/>
|
||||
</Filters>
|
||||
<PatternLayout pattern="[%d][%-5p][%t] %m (%F:%L)%n"/>
|
||||
<Policies>
|
||||
<TimeBasedTriggeringPolicy interval="1" modulate="true"/>
|
||||
<SizeBasedTriggeringPolicy size="50 MB"/>
|
||||
</Policies>
|
||||
<DefaultRolloverStrategy max="30">
|
||||
<Delete basePath="${log-path}/warn" maxDepth="1">
|
||||
<IfFileName glob="smart-admin_warn_*.log"/>
|
||||
<IfLastModified age="15d"/>
|
||||
</Delete>
|
||||
</DefaultRolloverStrategy>
|
||||
</RollingFile>
|
||||
<RollingFile name="error" fileName="${log-path}/error/smart-admin_error.log"
|
||||
filePattern="${log-path}/error/smart-admin_error_%d{yyyy-MM-dd}-%i.log">
|
||||
<Filters>
|
||||
<ThresholdFilter level="fatal" onMatch="DENY" onMismatch="NEUTRAL"/>
|
||||
<ThresholdFilter level="error" onMatch="ACCEPT" onMismatch="DENY"/>
|
||||
</Filters>
|
||||
<PatternLayout pattern="[%d][%-5p][%t] %m (%F:%L)%n"/>
|
||||
<Policies>
|
||||
<TimeBasedTriggeringPolicy interval="1" modulate="true"/>
|
||||
<SizeBasedTriggeringPolicy size="10 MB"/>
|
||||
</Policies>
|
||||
<DefaultRolloverStrategy max="30">
|
||||
<Delete basePath="${log-path}/error" maxDepth="1">
|
||||
<IfFileName glob="smart-admin_error_*.log"/>
|
||||
<IfLastModified age="15d"/>
|
||||
</Delete>
|
||||
</DefaultRolloverStrategy>
|
||||
</RollingFile>
|
||||
</Appenders>
|
||||
<Loggers>
|
||||
<Root level="info">
|
||||
<AppenderRef ref="Console"/>
|
||||
<AppenderRef ref="debug"/>
|
||||
<AppenderRef ref="info"/>
|
||||
<AppenderRef ref="warn"/>
|
||||
<AppenderRef ref="error"/>
|
||||
</Root>
|
||||
</Loggers>
|
||||
</Configuration>
|
||||
@@ -0,0 +1,179 @@
|
||||
#
|
||||
# In your Quartz properties file, you'll need to set
|
||||
# org.quartz.jobStore.driverDelegateClass = org.quartz.impl.jdbcjobstore.StdJDBCDelegate
|
||||
#
|
||||
#
|
||||
# By: Ron Cordell - roncordell
|
||||
# I didn't see this anywhere, so I thought I'd post it here. This is the script from Quartz to create the tables in a MySQL database, modified to use INNODB instead of MYISAM.
|
||||
|
||||
DROP TABLE IF EXISTS QRTZ_FIRED_TRIGGERS;
|
||||
DROP TABLE IF EXISTS QRTZ_PAUSED_TRIGGER_GRPS;
|
||||
DROP TABLE IF EXISTS QRTZ_SCHEDULER_STATE;
|
||||
DROP TABLE IF EXISTS QRTZ_LOCKS;
|
||||
DROP TABLE IF EXISTS QRTZ_SIMPLE_TRIGGERS;
|
||||
DROP TABLE IF EXISTS QRTZ_SIMPROP_TRIGGERS;
|
||||
DROP TABLE IF EXISTS QRTZ_CRON_TRIGGERS;
|
||||
DROP TABLE IF EXISTS QRTZ_BLOB_TRIGGERS;
|
||||
DROP TABLE IF EXISTS QRTZ_TRIGGERS;
|
||||
DROP TABLE IF EXISTS QRTZ_JOB_DETAILS;
|
||||
DROP TABLE IF EXISTS QRTZ_CALENDARS;
|
||||
|
||||
CREATE TABLE QRTZ_JOB_DETAILS(
|
||||
SCHED_NAME VARCHAR(120) NOT NULL,
|
||||
JOB_NAME VARCHAR(190) NOT NULL,
|
||||
JOB_GROUP VARCHAR(190) NOT NULL,
|
||||
DESCRIPTION VARCHAR(250) NULL,
|
||||
JOB_CLASS_NAME VARCHAR(250) NOT NULL,
|
||||
IS_DURABLE VARCHAR(1) NOT NULL,
|
||||
IS_NONCONCURRENT VARCHAR(1) NOT NULL,
|
||||
IS_UPDATE_DATA VARCHAR(1) NOT NULL,
|
||||
REQUESTS_RECOVERY VARCHAR(1) NOT NULL,
|
||||
JOB_DATA BLOB NULL,
|
||||
PRIMARY KEY (SCHED_NAME,JOB_NAME,JOB_GROUP))
|
||||
ENGINE=InnoDB;
|
||||
|
||||
CREATE TABLE QRTZ_TRIGGERS (
|
||||
SCHED_NAME VARCHAR(120) NOT NULL,
|
||||
TRIGGER_NAME VARCHAR(190) NOT NULL,
|
||||
TRIGGER_GROUP VARCHAR(190) NOT NULL,
|
||||
JOB_NAME VARCHAR(190) NOT NULL,
|
||||
JOB_GROUP VARCHAR(190) NOT NULL,
|
||||
DESCRIPTION VARCHAR(250) NULL,
|
||||
NEXT_FIRE_TIME BIGINT(13) NULL,
|
||||
PREV_FIRE_TIME BIGINT(13) NULL,
|
||||
PRIORITY INTEGER NULL,
|
||||
TRIGGER_STATE VARCHAR(16) NOT NULL,
|
||||
TRIGGER_TYPE VARCHAR(8) NOT NULL,
|
||||
START_TIME BIGINT(13) NOT NULL,
|
||||
END_TIME BIGINT(13) NULL,
|
||||
CALENDAR_NAME VARCHAR(190) NULL,
|
||||
MISFIRE_INSTR SMALLINT(2) NULL,
|
||||
JOB_DATA BLOB NULL,
|
||||
PRIMARY KEY (SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP),
|
||||
FOREIGN KEY (SCHED_NAME,JOB_NAME,JOB_GROUP)
|
||||
REFERENCES QRTZ_JOB_DETAILS(SCHED_NAME,JOB_NAME,JOB_GROUP))
|
||||
ENGINE=InnoDB;
|
||||
|
||||
CREATE TABLE QRTZ_SIMPLE_TRIGGERS (
|
||||
SCHED_NAME VARCHAR(120) NOT NULL,
|
||||
TRIGGER_NAME VARCHAR(190) NOT NULL,
|
||||
TRIGGER_GROUP VARCHAR(190) NOT NULL,
|
||||
REPEAT_COUNT BIGINT(7) NOT NULL,
|
||||
REPEAT_INTERVAL BIGINT(12) NOT NULL,
|
||||
TIMES_TRIGGERED BIGINT(10) NOT NULL,
|
||||
PRIMARY KEY (SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP),
|
||||
FOREIGN KEY (SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP)
|
||||
REFERENCES QRTZ_TRIGGERS(SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP))
|
||||
ENGINE=InnoDB;
|
||||
|
||||
CREATE TABLE QRTZ_CRON_TRIGGERS (
|
||||
SCHED_NAME VARCHAR(120) NOT NULL,
|
||||
TRIGGER_NAME VARCHAR(190) NOT NULL,
|
||||
TRIGGER_GROUP VARCHAR(190) NOT NULL,
|
||||
CRON_EXPRESSION VARCHAR(120) NOT NULL,
|
||||
TIME_ZONE_ID VARCHAR(80),
|
||||
PRIMARY KEY (SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP),
|
||||
FOREIGN KEY (SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP)
|
||||
REFERENCES QRTZ_TRIGGERS(SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP))
|
||||
ENGINE=InnoDB;
|
||||
|
||||
CREATE TABLE QRTZ_SIMPROP_TRIGGERS
|
||||
(
|
||||
SCHED_NAME VARCHAR(120) NOT NULL,
|
||||
TRIGGER_NAME VARCHAR(190) NOT NULL,
|
||||
TRIGGER_GROUP VARCHAR(190) NOT NULL,
|
||||
STR_PROP_1 VARCHAR(512) NULL,
|
||||
STR_PROP_2 VARCHAR(512) NULL,
|
||||
STR_PROP_3 VARCHAR(512) NULL,
|
||||
INT_PROP_1 INT NULL,
|
||||
INT_PROP_2 INT NULL,
|
||||
LONG_PROP_1 BIGINT NULL,
|
||||
LONG_PROP_2 BIGINT NULL,
|
||||
DEC_PROP_1 NUMERIC(13,4) NULL,
|
||||
DEC_PROP_2 NUMERIC(13,4) NULL,
|
||||
BOOL_PROP_1 VARCHAR(1) NULL,
|
||||
BOOL_PROP_2 VARCHAR(1) NULL,
|
||||
PRIMARY KEY (SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP),
|
||||
FOREIGN KEY (SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP)
|
||||
REFERENCES QRTZ_TRIGGERS(SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP))
|
||||
ENGINE=InnoDB;
|
||||
|
||||
CREATE TABLE QRTZ_BLOB_TRIGGERS (
|
||||
SCHED_NAME VARCHAR(120) NOT NULL,
|
||||
TRIGGER_NAME VARCHAR(190) NOT NULL,
|
||||
TRIGGER_GROUP VARCHAR(190) NOT NULL,
|
||||
BLOB_DATA BLOB NULL,
|
||||
PRIMARY KEY (SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP),
|
||||
INDEX (SCHED_NAME,TRIGGER_NAME, TRIGGER_GROUP),
|
||||
FOREIGN KEY (SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP)
|
||||
REFERENCES QRTZ_TRIGGERS(SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP))
|
||||
ENGINE=InnoDB;
|
||||
|
||||
CREATE TABLE QRTZ_CALENDARS (
|
||||
SCHED_NAME VARCHAR(120) NOT NULL,
|
||||
CALENDAR_NAME VARCHAR(190) NOT NULL,
|
||||
CALENDAR BLOB NOT NULL,
|
||||
PRIMARY KEY (SCHED_NAME,CALENDAR_NAME))
|
||||
ENGINE=InnoDB;
|
||||
|
||||
CREATE TABLE QRTZ_PAUSED_TRIGGER_GRPS (
|
||||
SCHED_NAME VARCHAR(120) NOT NULL,
|
||||
TRIGGER_GROUP VARCHAR(190) NOT NULL,
|
||||
PRIMARY KEY (SCHED_NAME,TRIGGER_GROUP))
|
||||
ENGINE=InnoDB;
|
||||
|
||||
CREATE TABLE QRTZ_FIRED_TRIGGERS (
|
||||
SCHED_NAME VARCHAR(120) NOT NULL,
|
||||
ENTRY_ID VARCHAR(95) NOT NULL,
|
||||
TRIGGER_NAME VARCHAR(190) NOT NULL,
|
||||
TRIGGER_GROUP VARCHAR(190) NOT NULL,
|
||||
INSTANCE_NAME VARCHAR(190) NOT NULL,
|
||||
FIRED_TIME BIGINT(13) NOT NULL,
|
||||
SCHED_TIME BIGINT(13) NOT NULL,
|
||||
PRIORITY INTEGER NOT NULL,
|
||||
STATE VARCHAR(16) NOT NULL,
|
||||
JOB_NAME VARCHAR(190) NULL,
|
||||
JOB_GROUP VARCHAR(190) NULL,
|
||||
IS_NONCONCURRENT VARCHAR(1) NULL,
|
||||
REQUESTS_RECOVERY VARCHAR(1) NULL,
|
||||
PRIMARY KEY (SCHED_NAME,ENTRY_ID))
|
||||
ENGINE=InnoDB;
|
||||
|
||||
CREATE TABLE QRTZ_SCHEDULER_STATE (
|
||||
SCHED_NAME VARCHAR(120) NOT NULL,
|
||||
INSTANCE_NAME VARCHAR(190) NOT NULL,
|
||||
LAST_CHECKIN_TIME BIGINT(13) NOT NULL,
|
||||
CHECKIN_INTERVAL BIGINT(13) NOT NULL,
|
||||
PRIMARY KEY (SCHED_NAME,INSTANCE_NAME))
|
||||
ENGINE=InnoDB;
|
||||
|
||||
CREATE TABLE QRTZ_LOCKS (
|
||||
SCHED_NAME VARCHAR(120) NOT NULL,
|
||||
LOCK_NAME VARCHAR(40) NOT NULL,
|
||||
PRIMARY KEY (SCHED_NAME,LOCK_NAME))
|
||||
ENGINE=InnoDB;
|
||||
|
||||
CREATE INDEX IDX_QRTZ_J_REQ_RECOVERY ON QRTZ_JOB_DETAILS(SCHED_NAME,REQUESTS_RECOVERY);
|
||||
CREATE INDEX IDX_QRTZ_J_GRP ON QRTZ_JOB_DETAILS(SCHED_NAME,JOB_GROUP);
|
||||
|
||||
CREATE INDEX IDX_QRTZ_T_J ON QRTZ_TRIGGERS(SCHED_NAME,JOB_NAME,JOB_GROUP);
|
||||
CREATE INDEX IDX_QRTZ_T_JG ON QRTZ_TRIGGERS(SCHED_NAME,JOB_GROUP);
|
||||
CREATE INDEX IDX_QRTZ_T_C ON QRTZ_TRIGGERS(SCHED_NAME,CALENDAR_NAME);
|
||||
CREATE INDEX IDX_QRTZ_T_G ON QRTZ_TRIGGERS(SCHED_NAME,TRIGGER_GROUP);
|
||||
CREATE INDEX IDX_QRTZ_T_STATE ON QRTZ_TRIGGERS(SCHED_NAME,TRIGGER_STATE);
|
||||
CREATE INDEX IDX_QRTZ_T_N_STATE ON QRTZ_TRIGGERS(SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP,TRIGGER_STATE);
|
||||
CREATE INDEX IDX_QRTZ_T_N_G_STATE ON QRTZ_TRIGGERS(SCHED_NAME,TRIGGER_GROUP,TRIGGER_STATE);
|
||||
CREATE INDEX IDX_QRTZ_T_NEXT_FIRE_TIME ON QRTZ_TRIGGERS(SCHED_NAME,NEXT_FIRE_TIME);
|
||||
CREATE INDEX IDX_QRTZ_T_NFT_ST ON QRTZ_TRIGGERS(SCHED_NAME,TRIGGER_STATE,NEXT_FIRE_TIME);
|
||||
CREATE INDEX IDX_QRTZ_T_NFT_MISFIRE ON QRTZ_TRIGGERS(SCHED_NAME,MISFIRE_INSTR,NEXT_FIRE_TIME);
|
||||
CREATE INDEX IDX_QRTZ_T_NFT_ST_MISFIRE ON QRTZ_TRIGGERS(SCHED_NAME,MISFIRE_INSTR,NEXT_FIRE_TIME,TRIGGER_STATE);
|
||||
CREATE INDEX IDX_QRTZ_T_NFT_ST_MISFIRE_GRP ON QRTZ_TRIGGERS(SCHED_NAME,MISFIRE_INSTR,NEXT_FIRE_TIME,TRIGGER_GROUP,TRIGGER_STATE);
|
||||
|
||||
CREATE INDEX IDX_QRTZ_FT_TRIG_INST_NAME ON QRTZ_FIRED_TRIGGERS(SCHED_NAME,INSTANCE_NAME);
|
||||
CREATE INDEX IDX_QRTZ_FT_INST_JOB_REQ_RCVRY ON QRTZ_FIRED_TRIGGERS(SCHED_NAME,INSTANCE_NAME,REQUESTS_RECOVERY);
|
||||
CREATE INDEX IDX_QRTZ_FT_J_G ON QRTZ_FIRED_TRIGGERS(SCHED_NAME,JOB_NAME,JOB_GROUP);
|
||||
CREATE INDEX IDX_QRTZ_FT_JG ON QRTZ_FIRED_TRIGGERS(SCHED_NAME,JOB_GROUP);
|
||||
CREATE INDEX IDX_QRTZ_FT_T_G ON QRTZ_FIRED_TRIGGERS(SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP);
|
||||
CREATE INDEX IDX_QRTZ_FT_TG ON QRTZ_FIRED_TRIGGERS(SCHED_NAME,TRIGGER_GROUP);
|
||||
|
||||
commit;
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,64 @@
|
||||
package ${basePackage}.module.${modulePackage}.controller;
|
||||
|
||||
import ${basePackage}.common.constant.SwaggerTagConst;
|
||||
import ${basePackage}.common.domain.PageInfoDTO;
|
||||
import ${basePackage}.common.domain.ResponseDTO;
|
||||
import ${basePackage}.module.${modulePackage}.domain.dto.${moduleClass}DTO;
|
||||
import ${basePackage}.module.${modulePackage}.domain.dto.${moduleClass}QueryDTO;
|
||||
import ${basePackage}.module.${modulePackage}.service.${moduleClass}Service;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.validation.Valid;
|
||||
|
||||
/**
|
||||
* [ ${tableDesc} ]
|
||||
*
|
||||
* @author ${author}
|
||||
* @version 1.0
|
||||
* @company ${company}
|
||||
* @copyright (c) 2019 ${company}Inc. All rights reserved.
|
||||
* @date ${date}
|
||||
* @since JDK1.8
|
||||
*/
|
||||
@RestController
|
||||
@Api(tags = {"${tableDesc}"})
|
||||
public class ${moduleClass}Controller {
|
||||
|
||||
@Autowired
|
||||
private ${moduleClass}Service ${moduleVar}Service;
|
||||
|
||||
@ApiOperation(value = "分页查询${tableDesc}",notes = "@author ${author}")
|
||||
@PostMapping("/${moduleVar}/page/query")
|
||||
public ResponseDTO<PageInfoDTO<${moduleClass}DTO>> queryByPage(@RequestBody ${moduleClass}QueryDTO queryDTO) {
|
||||
return ${moduleVar}Service.queryByPage(queryDTO);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "添加${tableDesc}",notes = "@author ${author}")
|
||||
@PostMapping("/${moduleVar}/add")
|
||||
public ResponseDTO<String> add(@RequestBody @Valid ${moduleClass}DTO addTO){
|
||||
return ${moduleVar}Service.add(addTO);
|
||||
}
|
||||
|
||||
@ApiOperation(value="修改${tableDesc}",notes = "@author ${author}")
|
||||
@PostMapping("/${moduleVar}/update")
|
||||
public ResponseDTO<String> update(@RequestBody @Valid ${moduleClass}DTO updateDTO){
|
||||
return ${moduleVar}Service.update(updateDTO);
|
||||
}
|
||||
|
||||
|
||||
@ApiOperation(value="删除${tableDesc}",notes = "@author ${author}")
|
||||
@GetMapping("/${moduleVar}/delete/{id}")
|
||||
public ResponseDTO<String> delete(@PathVariable("id") Long id){
|
||||
return ${moduleVar}Service.delete(id);
|
||||
}
|
||||
|
||||
|
||||
@ApiOperation(value="详情${tableDesc}",notes = "@author ${author}")
|
||||
@GetMapping("/${moduleVar}/detail/{id}")
|
||||
public ResponseDTO<${moduleClass}DTO> detail(@PathVariable("id") Long id){
|
||||
return ${moduleVar}Service.detail(id);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
package ${basePackage}.module.${modulePackage}.domain.dto;
|
||||
import lombok.Data;
|
||||
#foreach ($dtoImport in $dtoImports)
|
||||
$dtoImport
|
||||
#end
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
|
||||
/**
|
||||
* [ ${tableDesc} ]
|
||||
*
|
||||
* @author ${author}
|
||||
* @version 1.0
|
||||
* @company ${company}
|
||||
* @copyright (c) 2018 ${company}Inc. All rights reserved.
|
||||
* @date 2019/3/27 0027 下午 12:27
|
||||
* @since JDK1.8
|
||||
*/
|
||||
@Data
|
||||
public class ${moduleClass}DTO {
|
||||
|
||||
#foreach ($column in $columnList)
|
||||
#if($column.fieldType == 'Date')
|
||||
@ApiModelProperty("${column.columnDesc}")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
private $column.fieldType $column.fieldName;
|
||||
#else
|
||||
@ApiModelProperty("${column.columnDesc}")
|
||||
private $column.fieldType $column.fieldName;
|
||||
#end
|
||||
|
||||
#end
|
||||
|
||||
}
|
||||
@@ -0,0 +1,48 @@
|
||||
package ${basePackage}.module.${modulePackage}.dao;
|
||||
|
||||
import com.baomidou.mybatisplus.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.plugins.pagination.Pagination;
|
||||
import ${basePackage}.module.${modulePackage}.domain.dto.${moduleClass}QueryDTO;
|
||||
import ${basePackage}.module.${modulePackage}.domain.entity.${moduleClass}Entity;
|
||||
import ${basePackage}.utils.PaginationUtil;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* [ ${tableDesc} ]
|
||||
*
|
||||
* @author ${author}
|
||||
* @version 1.0
|
||||
* @company ${company}
|
||||
* @copyright (c) 2018 ${company}Inc. All rights reserved.
|
||||
* @date ${date}
|
||||
* @since JDK1.8
|
||||
*/
|
||||
@Mapper
|
||||
@Component
|
||||
public interface ${moduleClass}Dao extends BaseMapper<${moduleClass}Entity> {
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
* @param queryDTO
|
||||
* @return ${moduleClass}Entity
|
||||
*/
|
||||
List<${moduleClass}Entity> queryByPage(Pagination page, @Param("queryDTO") ${moduleClass}QueryDTO queryDTO);
|
||||
|
||||
/**
|
||||
* 根据id删除
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
void deleteById(@Param("id") Long id);
|
||||
|
||||
/**
|
||||
* 批量删除
|
||||
* @param idList
|
||||
* @return
|
||||
*/
|
||||
void deleteByIds(@Param("idList") List<Long> idList);
|
||||
}
|
||||
@@ -0,0 +1,77 @@
|
||||
<?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="${basePackage}.module.${modulePackage}.dao.${moduleClass}Dao">
|
||||
|
||||
<resultMap id="${moduleClass}Entity" type="${basePackage}.module.${modulePackage}.domain.entity.${moduleClass}Entity"></resultMap>
|
||||
|
||||
|
||||
<select id="queryByPage" resultMap="${moduleClass}Entity">
|
||||
select
|
||||
#foreach($column in $columnList)
|
||||
#if($velocityCount != $columnList.size())
|
||||
$column.columnName,
|
||||
#else
|
||||
$column.columnName
|
||||
#end
|
||||
#end
|
||||
from ${tableName}
|
||||
<where>
|
||||
#foreach($queryField in $queryFieldList)
|
||||
#if ($queryField.sqlOperate == 'like')
|
||||
<if test="queryDTO.${queryField.fieldName} != null and queryDTO.${queryField.fieldName} != ''">
|
||||
AND INSTR($queryField.columnName,#{queryDTO.$queryField.fieldName})
|
||||
</if>
|
||||
#end
|
||||
#if ($queryField.sqlOperate == 'equals')
|
||||
#if ($queryField.fieldType == 'String')
|
||||
<if test="queryDTO.${queryField.fieldName} != null and queryDTO.${queryField.fieldName} != ''">
|
||||
AND $queryField.columnName = #{queryDTO.$queryField.fieldName}
|
||||
</if>
|
||||
#else
|
||||
<if test="queryDTO.${queryField.fieldName} != null">
|
||||
AND $queryField.columnName = #{queryDTO.$queryField.fieldName}
|
||||
</if>
|
||||
#end
|
||||
#end
|
||||
#if ($queryField.sqlOperate == 'time_equals')
|
||||
<if test="queryDTO.${queryField.fieldName} != null and queryDTO.${queryField.fieldName} != ''">
|
||||
AND DATE_FORMAT($queryField.columnName, '%Y-%m-%d') = #{queryDTO.$queryField.fieldName}
|
||||
</if>
|
||||
#end
|
||||
#if ($queryField.sqlOperate == 'time_between')
|
||||
<if test="queryDTO.startDate != null and queryDTO.startDate != ''">
|
||||
AND DATE_FORMAT($queryField.columnName, '%Y-%m-%d') >= #{queryDTO.startDate}
|
||||
</if>
|
||||
<if test="queryDTO.endDate != null and queryDTO.endDate != ''">
|
||||
AND DATE_FORMAT($queryField.columnName, '%Y-%m-%d') <= #{queryDTO.endDate}
|
||||
</if>
|
||||
#end
|
||||
#if ($queryField.sqlOperate == 'in')
|
||||
<if test="queryDTO.${queryField.fieldName}List !=null and queryDTO.${queryField.fieldName}List.size() > 0">
|
||||
and $queryField.columnName in
|
||||
<foreach collection="queryDTO.${queryField.fieldName}List" open="(" index="index" separator="," close=")" item="item">
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
#end
|
||||
#if ($queryField.sqlOperate == 'gt')
|
||||
<if test="queryDTO.startDate != null and queryDTO.startDate != ''">
|
||||
and DATE_FORMAT($queryField.columnName, '%Y-%m-%d') >= DATE_FORMAT(#{queryDTO.startDate}, '%Y-%m-%d')
|
||||
</if>
|
||||
#end
|
||||
#end
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<delete id="deleteById">
|
||||
delete from ${tableName} where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteByIds">
|
||||
delete from ${tableName} where id in
|
||||
<foreach collection="idList" open="(" close=")" separator="," item="item">
|
||||
#{item}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,35 @@
|
||||
package ${basePackage}.module.${modulePackage}.domain.entity;
|
||||
import com.baomidou.mybatisplus.annotations.TableName;
|
||||
import com.gangquan360.smartadmin.common.domain.BaseEntity;
|
||||
#foreach ($entityImport in $entityImports)
|
||||
$entityImport
|
||||
#end
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* [ ${tableDesc} ]
|
||||
*
|
||||
* @author ${author}
|
||||
* @version 1.0
|
||||
* @company ${company}
|
||||
* @copyright (c) 2018 ${company}Inc. All rights reserved.
|
||||
* @date ${date}
|
||||
* @since JDK1.8
|
||||
*/
|
||||
@Data
|
||||
@TableName("${tableName}")
|
||||
public class ${moduleClass}Entity extends BaseEntity{
|
||||
|
||||
#foreach ($column in $columnList)
|
||||
|
||||
#if($column.columnName != 'id' && $column.fieldName != 'updateTime' && $column.fieldName != 'createTime')
|
||||
/**
|
||||
* $column.columnDesc
|
||||
*/
|
||||
private $column.fieldType $column.fieldName;
|
||||
#end
|
||||
#end
|
||||
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
package ${basePackage}.module.${modulePackage}.domain.dto;
|
||||
|
||||
import ${basePackage}.common.domain.PageBaseDTO;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
#foreach ($queryImport in $queryImports)
|
||||
$queryImport
|
||||
#end
|
||||
|
||||
/**
|
||||
* [ ${tableDesc} ]
|
||||
*
|
||||
* @author ${author}
|
||||
* @version 1.0
|
||||
* @company ${company}
|
||||
* @copyright (c) 2019 ${company}Inc. All rights reserved.
|
||||
* @date ${date}
|
||||
* @since JDK1.8
|
||||
*/
|
||||
@Data
|
||||
public class ${moduleClass}QueryDTO extends PageBaseDTO {
|
||||
|
||||
#foreach ($queryField in $queryFieldList)
|
||||
|
||||
#if($queryField.sqlOperate == 'in')
|
||||
@ApiModelProperty("${queryField.columnDesc}")
|
||||
private List<${queryField.fieldType}> ${queryField.fieldName}List;
|
||||
#elseif($queryField.sqlOperate == 'time_equals')
|
||||
@ApiModelProperty("${queryField.columnDesc}")
|
||||
private String ${queryField.fieldName};
|
||||
#elseif($queryField.sqlOperate == 'time_between')
|
||||
@ApiModelProperty("开始日期")
|
||||
private String startDate;
|
||||
|
||||
@ApiModelProperty("结束日期")
|
||||
private String endDate;
|
||||
#else
|
||||
@ApiModelProperty("${queryField.columnDesc}")
|
||||
private ${queryField.fieldType} ${queryField.fieldName};
|
||||
#end
|
||||
|
||||
#end
|
||||
}
|
||||
@@ -0,0 +1,95 @@
|
||||
package ${basePackage}.module.${modulePackage}.service;
|
||||
|
||||
import com.baomidou.mybatisplus.plugins.Page;
|
||||
import ${basePackage}.common.domain.PageInfoDTO;
|
||||
import ${basePackage}.common.domain.ResponseDTO;
|
||||
import ${basePackage}.module.${modulePackage}.dao.${moduleClass}Dao;
|
||||
import ${basePackage}.module.${modulePackage}.domain.dto.${moduleClass}DTO;
|
||||
import ${basePackage}.module.${modulePackage}.domain.dto.${moduleClass}QueryDTO;
|
||||
import ${basePackage}.module.${modulePackage}.domain.entity.${moduleClass}Entity;
|
||||
import ${basePackage}.utils.PaginationUtil;
|
||||
import com.gangquan360.smartutil.bean.SmartBeanUtil;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* [ ${tableDesc} ]
|
||||
*
|
||||
* @author ${author}
|
||||
* @version 1.0
|
||||
* @company ${company}
|
||||
* @copyright (c) 2019 ${company}Inc. All rights reserved.
|
||||
* @date ${date}
|
||||
* @since JDK1.8
|
||||
*/
|
||||
@Service
|
||||
public class ${moduleClass}Service {
|
||||
|
||||
@Autowired
|
||||
private ${moduleClass}Dao ${moduleVar}Dao;
|
||||
|
||||
|
||||
/**
|
||||
* @author ${author}
|
||||
* @description 分页查询
|
||||
* @date ${date}
|
||||
*/
|
||||
public ResponseDTO<PageInfoDTO<${moduleClass}DTO>> queryByPage(${moduleClass}QueryDTO queryDTO) {
|
||||
Page page = PaginationUtil.convert2PageQueryInfo(queryDTO);
|
||||
List<${moduleClass}Entity> entities = ${moduleVar}Dao.queryByPage(page, queryDTO);
|
||||
List<${moduleClass}DTO> dtoList = SmartBeanUtil.copyList(entities, ${moduleClass}DTO.class);
|
||||
page.setRecords(dtoList);
|
||||
PageInfoDTO<${moduleClass}DTO> pageResultDTO = PaginationUtil.convert2PageInfoDTO(page);
|
||||
return ResponseDTO.succData(pageResultDTO);
|
||||
}
|
||||
|
||||
/**
|
||||
* @author ${author}
|
||||
* @description 添加
|
||||
* @date ${date}
|
||||
*/
|
||||
public ResponseDTO<String> add(${moduleClass}DTO addDTO) {
|
||||
${moduleClass}Entity entity = SmartBeanUtil.copy(addDTO, ${moduleClass}Entity.class);
|
||||
${moduleVar}Dao.insert(entity);
|
||||
return ResponseDTO.succ();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @author ${author}
|
||||
* @description 编辑
|
||||
* @date ${date}
|
||||
*/
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public ResponseDTO<String> update(${moduleClass}DTO updateDTO) {
|
||||
${moduleClass}Entity entity = SmartBeanUtil.copy(updateDTO, ${moduleClass}Entity.class);
|
||||
${moduleVar}Dao.updateById(entity);
|
||||
return ResponseDTO.succ();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @author ${author}
|
||||
* @description 删除
|
||||
* @date ${date}
|
||||
*/
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public ResponseDTO<String> delete(Long id) {
|
||||
${moduleVar}Dao.deleteById(id);
|
||||
return ResponseDTO.succ();
|
||||
}
|
||||
|
||||
/**
|
||||
* @author ${author}
|
||||
* @description 根据ID查询
|
||||
* @date ${date}
|
||||
*/
|
||||
public ResponseDTO<${moduleClass}DTO> detail(Long id){
|
||||
${moduleClass}Entity entity = ${moduleVar}Dao.selectById(id);
|
||||
${moduleClass}DTO dto = SmartBeanUtil.copy(entity,${moduleClass}DTO.class);
|
||||
return ResponseDTO.succData(dto);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user