feat:init

This commit is contained in:
llh 2026-03-03 08:52:00 +08:00
parent c5b299616a
commit 12ca95224a
19 changed files with 166 additions and 60 deletions

View File

@ -539,6 +539,7 @@ CREATE TABLE d_acl_ip_rule (
is_deleted INT NOT NULL DEFAULT 0, is_deleted INT NOT NULL DEFAULT 0,
PRIMARY KEY (id) PRIMARY KEY (id)
); );
COMMENT ON TABLE d_acl_ip_rule IS '访问控制-IP黑白名单规则';
CREATE INDEX idx_acl_ip_scope_status ON d_acl_ip_rule (scope_code, status); CREATE INDEX idx_acl_ip_scope_status ON d_acl_ip_rule (scope_code, status);
CREATE INDEX idx_acl_ip_priority ON d_acl_ip_rule (priority); CREATE INDEX idx_acl_ip_priority ON d_acl_ip_rule (priority);
@ -557,6 +558,7 @@ CREATE TABLE d_acl_endpoint_rule (
is_deleted INT NOT NULL DEFAULT 0, is_deleted INT NOT NULL DEFAULT 0,
PRIMARY KEY (id) PRIMARY KEY (id)
); );
COMMENT ON TABLE d_acl_endpoint_rule IS '访问控制-接口封堵规则';
CREATE INDEX idx_acl_ep_scope_status ON d_acl_endpoint_rule (scope_code, status); CREATE INDEX idx_acl_ep_scope_status ON d_acl_endpoint_rule (scope_code, status);
CREATE INDEX idx_acl_ep_match_type ON d_acl_endpoint_rule (match_type); CREATE INDEX idx_acl_ep_match_type ON d_acl_endpoint_rule (match_type);
@ -577,6 +579,7 @@ CREATE TABLE d_acl_custom_rule (
PRIMARY KEY (id), PRIMARY KEY (id),
CONSTRAINT uk_acl_custom_rule_code UNIQUE (rule_code) CONSTRAINT uk_acl_custom_rule_code UNIQUE (rule_code)
); );
COMMENT ON TABLE d_acl_custom_rule IS '访问控制-自定义组合规则';
CREATE INDEX idx_acl_custom_scope_status ON d_acl_custom_rule (scope_code, status); CREATE INDEX idx_acl_custom_scope_status ON d_acl_custom_rule (scope_code, status);
CREATE INDEX idx_acl_custom_priority ON d_acl_custom_rule (priority); CREATE INDEX idx_acl_custom_priority ON d_acl_custom_rule (priority);
@ -593,6 +596,7 @@ CREATE TABLE d_acl_custom_condition (
PRIMARY KEY (id), PRIMARY KEY (id),
CONSTRAINT fk_acl_condition_rule FOREIGN KEY (rule_id) REFERENCES d_acl_custom_rule(id) ON DELETE CASCADE CONSTRAINT fk_acl_condition_rule FOREIGN KEY (rule_id) REFERENCES d_acl_custom_rule(id) ON DELETE CASCADE
); );
COMMENT ON TABLE d_acl_custom_condition IS '访问控制-组合规则条件明细';
CREATE INDEX idx_acl_condition_rule_seq ON d_acl_custom_condition (rule_id, seq_no); CREATE INDEX idx_acl_condition_rule_seq ON d_acl_custom_condition (rule_id, seq_no);
-- ========================= -- =========================
@ -616,6 +620,7 @@ CREATE TABLE d_content_policy (
PRIMARY KEY (id), PRIMARY KEY (id),
CONSTRAINT uk_content_policy_code UNIQUE (policy_code) CONSTRAINT uk_content_policy_code UNIQUE (policy_code)
); );
COMMENT ON TABLE d_content_policy IS '内容管控-合规策略';
CREATE INDEX idx_content_policy_scope_status ON d_content_policy (scope_code, status); CREATE INDEX idx_content_policy_scope_status ON d_content_policy (scope_code, status);
CREATE TABLE d_content_dlp_rule ( CREATE TABLE d_content_dlp_rule (
@ -635,6 +640,7 @@ CREATE TABLE d_content_dlp_rule (
PRIMARY KEY (id), PRIMARY KEY (id),
CONSTRAINT uk_content_dlp_code UNIQUE (rule_code) CONSTRAINT uk_content_dlp_code UNIQUE (rule_code)
); );
COMMENT ON TABLE d_content_dlp_rule IS '内容管控-DLP识别规则';
CREATE INDEX idx_content_dlp_scope_status ON d_content_dlp_rule (scope_code, status); CREATE INDEX idx_content_dlp_scope_status ON d_content_dlp_rule (scope_code, status);
CREATE TABLE d_content_mask_policy ( CREATE TABLE d_content_mask_policy (
@ -654,6 +660,7 @@ CREATE TABLE d_content_mask_policy (
PRIMARY KEY (id), PRIMARY KEY (id),
CONSTRAINT uk_content_mask_policy_code UNIQUE (policy_code) CONSTRAINT uk_content_mask_policy_code UNIQUE (policy_code)
); );
COMMENT ON TABLE d_content_mask_policy IS '内容管控-脱敏策略';
CREATE INDEX idx_content_mask_scope_status ON d_content_mask_policy (scope_code, status); CREATE INDEX idx_content_mask_scope_status ON d_content_mask_policy (scope_code, status);
-- ========================= -- =========================
@ -676,6 +683,7 @@ CREATE TABLE d_attack_switch (
PRIMARY KEY (id), PRIMARY KEY (id),
CONSTRAINT uk_attack_switch_scope_key UNIQUE (scope_code, switch_key) CONSTRAINT uk_attack_switch_scope_key UNIQUE (scope_code, switch_key)
); );
COMMENT ON TABLE d_attack_switch IS '攻击防护-开关矩阵';
CREATE INDEX idx_attack_switch_scope_sort ON d_attack_switch (scope_code, sort_order); CREATE INDEX idx_attack_switch_scope_sort ON d_attack_switch (scope_code, sort_order);
CREATE TABLE d_attack_rule ( CREATE TABLE d_attack_rule (
@ -695,6 +703,7 @@ CREATE TABLE d_attack_rule (
PRIMARY KEY (id), PRIMARY KEY (id),
CONSTRAINT uk_attack_rule_code UNIQUE (rule_code) CONSTRAINT uk_attack_rule_code UNIQUE (rule_code)
); );
COMMENT ON TABLE d_attack_rule IS '攻击防护-注入/提示词规则';
CREATE INDEX idx_attack_rule_scope_category ON d_attack_rule (scope_code, category); CREATE INDEX idx_attack_rule_scope_category ON d_attack_rule (scope_code, category);
CREATE INDEX idx_attack_rule_status ON d_attack_rule (status); CREATE INDEX idx_attack_rule_status ON d_attack_rule (status);
@ -713,6 +722,7 @@ CREATE TABLE d_attack_signature (
is_deleted INT NOT NULL DEFAULT 0, is_deleted INT NOT NULL DEFAULT 0,
PRIMARY KEY (id) PRIMARY KEY (id)
); );
COMMENT ON TABLE d_attack_signature IS '攻击防护-特征库';
CREATE INDEX idx_attack_signature_scope_status ON d_attack_signature (scope_code, status); CREATE INDEX idx_attack_signature_scope_status ON d_attack_signature (scope_code, status);
CREATE INDEX idx_attack_signature_rule_code ON d_attack_signature (rule_code); CREATE INDEX idx_attack_signature_rule_code ON d_attack_signature (rule_code);
@ -731,6 +741,7 @@ CREATE TABLE d_log_attack_policy (
is_deleted INT NOT NULL DEFAULT 0, is_deleted INT NOT NULL DEFAULT 0,
PRIMARY KEY (id) PRIMARY KEY (id)
); );
COMMENT ON TABLE d_log_attack_policy IS '攻击防护-日志策略';
CREATE INDEX idx_log_attack_policy_scope_status ON d_log_attack_policy (scope_code, status); CREATE INDEX idx_log_attack_policy_scope_status ON d_log_attack_policy (scope_code, status);
-- ========================= -- =========================
@ -773,6 +784,7 @@ CREATE TABLE d_log_alert_event (
PRIMARY KEY (id), PRIMARY KEY (id),
CONSTRAINT uk_alert_event_no UNIQUE (event_no) CONSTRAINT uk_alert_event_no UNIQUE (event_no)
); );
COMMENT ON TABLE d_log_alert_event IS '告警命中日志主表(记录请求触发的告警)';
CREATE INDEX idx_alert_request ON d_log_alert_event (request_id); CREATE INDEX idx_alert_request ON d_log_alert_event (request_id);
CREATE INDEX idx_alert_trace ON d_log_alert_event (trace_id); CREATE INDEX idx_alert_trace ON d_log_alert_event (trace_id);
CREATE INDEX idx_alert_scope_time ON d_log_alert_event (scope_code, occurred_at); CREATE INDEX idx_alert_scope_time ON d_log_alert_event (scope_code, occurred_at);
@ -798,4 +810,5 @@ CREATE TABLE d_log_alert_hit (
PRIMARY KEY (id), PRIMARY KEY (id),
CONSTRAINT fk_log_alert_hit_event FOREIGN KEY (event_id) REFERENCES d_log_alert_event(id) ON DELETE CASCADE CONSTRAINT fk_log_alert_hit_event FOREIGN KEY (event_id) REFERENCES d_log_alert_event(id) ON DELETE CASCADE
); );
COMMENT ON TABLE d_log_alert_hit IS '告警命中日志明细表(一条事件可包含多条命中明细)';
CREATE INDEX idx_alert_hit_event ON d_log_alert_hit (event_id, hit_order); CREATE INDEX idx_alert_hit_event ON d_log_alert_hit (event_id, hit_order);

Binary file not shown.

Binary file not shown.

View File

@ -52,18 +52,41 @@
</dependency> </dependency>
</dependencies> </dependencies>
<build> <build>
<finalName>${project.artifactId}</finalName> <finalName>${project.artifactId}</finalName>
<plugins> <plugins>
<plugin> <plugin>
<groupId>org.springframework.boot</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>spring-boot-maven-plugin</artifactId> <artifactId>maven-jar-plugin</artifactId>
<version>3.3.0</version>
<configuration>
<archive>
<manifest>
<mainClass>com.llm.guard.auth.LlmAuthApplication</mainClass>
<addClasspath>true</addClasspath>
<classpathPrefix>lib/</classpathPrefix>
</manifest>
</archive>
</configuration>
</plugin>
<!-- 把所有依赖 copy 到 lib/ 目录 -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<version>3.6.1</version>
<executions> <executions>
<execution> <execution>
<id>copy-dependencies</id>
<phase>package</phase>
<goals> <goals>
<goal>repackage</goal> <goal>copy-dependencies</goal>
</goals> </goals>
<configuration>
<outputDirectory>${project.build.directory}/lib</outputDirectory>
<excludeTransitive>false</excludeTransitive>
</configuration>
</execution> </execution>
</executions> </executions>
</plugin> </plugin>

View File

@ -122,11 +122,11 @@ public class DataScopeAspect
if (scopeCustomIds.size() > 1) if (scopeCustomIds.size() > 1)
{ {
// 多个自定数据权限使用in查询避免多次拼接 // 多个自定数据权限使用in查询避免多次拼接
sqlString.append(StringUtils.format(" OR {}.dept_id IN ( SELECT dept_id FROM sys_role_dept WHERE role_id in ({}) ) ", deptAlias, String.join(",", scopeCustomIds))); sqlString.append(StringUtils.format(" OR {}.dept_id IN ( SELECT dept_id FROM d_sys_role_dept WHERE role_id in ({}) ) ", deptAlias, String.join(",", scopeCustomIds)));
} }
else else
{ {
sqlString.append(StringUtils.format(" OR {}.dept_id IN ( SELECT dept_id FROM sys_role_dept WHERE role_id = {} ) ", deptAlias, role.getRoleId())); sqlString.append(StringUtils.format(" OR {}.dept_id IN ( SELECT dept_id FROM d_sys_role_dept WHERE role_id = {} ) ", deptAlias, role.getRoleId()));
} }
} }
else if (DATA_SCOPE_DEPT.equals(dataScope)) else if (DATA_SCOPE_DEPT.equals(dataScope))
@ -135,7 +135,7 @@ public class DataScopeAspect
} }
else if (DATA_SCOPE_DEPT_AND_CHILD.equals(dataScope)) else if (DATA_SCOPE_DEPT_AND_CHILD.equals(dataScope))
{ {
sqlString.append(StringUtils.format(" OR {}.dept_id IN ( SELECT dept_id FROM sys_dept WHERE dept_id = {} or find_in_set( {} , ancestors ) )", deptAlias, user.getDeptId(), user.getDeptId())); sqlString.append(StringUtils.format(" OR {}.dept_id IN ( SELECT dept_id FROM d_sys_dept WHERE dept_id = {} or concat(',', ancestors, ',') like concat('%,', {}, ',%') )", deptAlias, user.getDeptId(), user.getDeptId()));
} }
else if (DATA_SCOPE_SELF.equals(dataScope)) else if (DATA_SCOPE_SELF.equals(dataScope))
{ {

View File

@ -107,13 +107,36 @@
<finalName>${project.artifactId}</finalName> <finalName>${project.artifactId}</finalName>
<plugins> <plugins>
<plugin> <plugin>
<groupId>org.springframework.boot</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>spring-boot-maven-plugin</artifactId> <artifactId>maven-jar-plugin</artifactId>
<version>3.3.0</version>
<configuration>
<archive>
<manifest>
<mainClass>com.llm.guard.gateway.LlmGatewayApplication</mainClass>
<addClasspath>true</addClasspath>
<classpathPrefix>lib/</classpathPrefix>
</manifest>
</archive>
</configuration>
</plugin>
<!-- 把所有依赖 copy 到 lib/ 目录 -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<version>3.6.1</version>
<executions> <executions>
<execution> <execution>
<id>copy-dependencies</id>
<phase>package</phase>
<goals> <goals>
<goal>repackage</goal> <goal>copy-dependencies</goal>
</goals> </goals>
<configuration>
<outputDirectory>${project.build.directory}/lib</outputDirectory>
<excludeTransitive>false</excludeTransitive>
</configuration>
</execution> </execution>
</executions> </executions>
</plugin> </plugin>

View File

@ -115,13 +115,36 @@
<finalName>${project.artifactId}</finalName> <finalName>${project.artifactId}</finalName>
<plugins> <plugins>
<plugin> <plugin>
<groupId>org.springframework.boot</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>spring-boot-maven-plugin</artifactId> <artifactId>maven-jar-plugin</artifactId>
<version>3.3.0</version>
<configuration>
<archive>
<manifest>
<mainClass>com.llm.guard.biz.LlmBizApplication</mainClass>
<addClasspath>true</addClasspath>
<classpathPrefix>lib/</classpathPrefix>
</manifest>
</archive>
</configuration>
</plugin>
<!-- 把所有依赖 copy 到 lib/ 目录 -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<version>3.6.1</version>
<executions> <executions>
<execution> <execution>
<id>copy-dependencies</id>
<phase>package</phase>
<goals> <goals>
<goal>repackage</goal> <goal>copy-dependencies</goal>
</goals> </goals>
<configuration>
<outputDirectory>${project.build.directory}/lib</outputDirectory>
<excludeTransitive>false</excludeTransitive>
</configuration>
</execution> </execution>
</executions> </executions>
</plugin> </plugin>

View File

@ -79,17 +79,41 @@
</dependency> </dependency>
</dependencies> </dependencies>
<build> <build>
<finalName>${project.artifactId}</finalName> <finalName>${project.artifactId}</finalName>
<plugins> <plugins>
<plugin> <plugin>
<groupId>org.springframework.boot</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>spring-boot-maven-plugin</artifactId> <artifactId>maven-jar-plugin</artifactId>
<version>3.3.0</version>
<configuration>
<archive>
<manifest>
<mainClass>com.llm.guard.system.LlmSystemApplication</mainClass>
<addClasspath>true</addClasspath>
<classpathPrefix>lib/</classpathPrefix>
</manifest>
</archive>
</configuration>
</plugin>
<!-- 把所有依赖 copy 到 lib/ 目录 -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<version>3.6.1</version>
<executions> <executions>
<execution> <execution>
<id>copy-dependencies</id>
<phase>package</phase>
<goals> <goals>
<goal>repackage</goal> <goal>copy-dependencies</goal>
</goals> </goals>
<configuration>
<outputDirectory>${project.build.directory}/lib</outputDirectory>
<excludeTransitive>false</excludeTransitive>
</configuration>
</execution> </execution>
</executions> </executions>
</plugin> </plugin>

View File

@ -51,10 +51,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
AND config_key like concat('%', #{configKey}, '%') AND config_key like concat('%', #{configKey}, '%')
</if> </if>
<if test="params.beginTime != null and params.beginTime != ''"><!-- 开始时间检索 --> <if test="params.beginTime != null and params.beginTime != ''"><!-- 开始时间检索 -->
and date_format(create_time,'%Y%m%d') &gt;= date_format(#{params.beginTime},'%Y%m%d') and date(create_time) &gt;= date(#{params.beginTime})
</if> </if>
<if test="params.endTime != null and params.endTime != ''"><!-- 结束时间检索 --> <if test="params.endTime != null and params.endTime != ''"><!-- 结束时间检索 -->
and date_format(create_time,'%Y%m%d') &lt;= date_format(#{params.endTime},'%Y%m%d') and date(create_time) &lt;= date(#{params.endTime})
</if> </if>
</where> </where>
</select> </select>
@ -85,7 +85,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="configType != null and configType != ''">#{configType},</if> <if test="configType != null and configType != ''">#{configType},</if>
<if test="createBy != null and createBy != ''">#{createBy},</if> <if test="createBy != null and createBy != ''">#{createBy},</if>
<if test="remark != null and remark != ''">#{remark},</if> <if test="remark != null and remark != ''">#{remark},</if>
sysdate() now()
) )
</insert> </insert>
@ -98,7 +98,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="configType != null and configType != ''">config_type = #{configType},</if> <if test="configType != null and configType != ''">config_type = #{configType},</if>
<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if> <if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
<if test="remark != null">remark = #{remark},</if> <if test="remark != null">remark = #{remark},</if>
update_time = sysdate() update_time = now()
</set> </set>
where config_id = #{configId} where config_id = #{configId}
</update> </update>

View File

@ -73,11 +73,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</select> </select>
<select id="selectChildrenDeptById" parameterType="String" resultMap="SysDeptResult"> <select id="selectChildrenDeptById" parameterType="String" resultMap="SysDeptResult">
select * from d_sys_dept where find_in_set(#{deptId}, ancestors) select * from d_sys_dept where concat(',', ancestors, ',') like concat('%,', #{deptId}, ',%')
</select> </select>
<select id="selectNormalChildrenDeptById" parameterType="String" resultType="int"> <select id="selectNormalChildrenDeptById" parameterType="String" resultType="int">
select count(*) from d_sys_dept where status = 0 and del_flag = '0' and find_in_set(#{deptId}, ancestors) select count(*) from d_sys_dept where status = '0' and del_flag = '0' and concat(',', ancestors, ',') like concat('%,', #{deptId}, ',%')
</select> </select>
<select id="checkDeptNameUnique" resultMap="SysDeptResult"> <select id="checkDeptNameUnique" resultMap="SysDeptResult">
@ -109,7 +109,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="email != null and email != ''">#{email},</if> <if test="email != null and email != ''">#{email},</if>
<if test="status != null">#{status},</if> <if test="status != null">#{status},</if>
<if test="createBy != null and createBy != ''">#{createBy},</if> <if test="createBy != null and createBy != ''">#{createBy},</if>
sysdate() now()
) )
</insert> </insert>
@ -125,7 +125,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="email != null">email = #{email},</if> <if test="email != null">email = #{email},</if>
<if test="status != null and status != ''">status = #{status},</if> <if test="status != null and status != ''">status = #{status},</if>
<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if> <if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
update_time = sysdate() update_time = now()
</set> </set>
where dept_id = #{deptId} where dept_id = #{deptId}
</update> </update>
@ -154,4 +154,4 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
update d_sys_dept set del_flag = '2' where dept_id = #{deptId} update d_sys_dept set del_flag = '2' where dept_id = #{deptId}
</delete> </delete>
</mapper> </mapper>

View File

@ -84,7 +84,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="status != null">status = #{status},</if> <if test="status != null">status = #{status},</if>
<if test="remark != null">remark = #{remark},</if> <if test="remark != null">remark = #{remark},</if>
<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if> <if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
update_time = sysdate() update_time = now()
</set> </set>
where dict_code = #{dictCode} where dict_code = #{dictCode}
</update> </update>
@ -117,7 +117,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="status != null">#{status},</if> <if test="status != null">#{status},</if>
<if test="remark != null and remark != ''">#{remark},</if> <if test="remark != null and remark != ''">#{remark},</if>
<if test="createBy != null and createBy != ''">#{createBy},</if> <if test="createBy != null and createBy != ''">#{createBy},</if>
sysdate() now()
) )
</insert> </insert>

View File

@ -33,10 +33,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
AND dict_type like concat('%', #{dictType}, '%') AND dict_type like concat('%', #{dictType}, '%')
</if> </if>
<if test="params.beginTime != null and params.beginTime != ''"><!-- 开始时间检索 --> <if test="params.beginTime != null and params.beginTime != ''"><!-- 开始时间检索 -->
and date_format(create_time,'%Y%m%d') &gt;= date_format(#{params.beginTime},'%Y%m%d') and date(create_time) &gt;= date(#{params.beginTime})
</if> </if>
<if test="params.endTime != null and params.endTime != ''"><!-- 结束时间检索 --> <if test="params.endTime != null and params.endTime != ''"><!-- 结束时间检索 -->
and date_format(create_time,'%Y%m%d') &lt;= date_format(#{params.endTime},'%Y%m%d') and date(create_time) &lt;= date(#{params.endTime})
</if> </if>
</where> </where>
</select> </select>
@ -79,7 +79,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="status != null">status = #{status},</if> <if test="status != null">status = #{status},</if>
<if test="remark != null">remark = #{remark},</if> <if test="remark != null">remark = #{remark},</if>
<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if> <if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
update_time = sysdate() update_time = now()
</set> </set>
where dict_id = #{dictId} where dict_id = #{dictId}
</update> </update>
@ -98,7 +98,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="status != null">#{status},</if> <if test="status != null">#{status},</if>
<if test="remark != null and remark != ''">#{remark},</if> <if test="remark != null and remark != ''">#{remark},</if>
<if test="createBy != null and createBy != ''">#{createBy},</if> <if test="createBy != null and createBy != ''">#{createBy},</if>
sysdate() now()
) )
</insert> </insert>

View File

@ -15,7 +15,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<insert id="insertLogininfor" parameterType="SysLogininfor"> <insert id="insertLogininfor" parameterType="SysLogininfor">
insert into d_sys_logininfor (user_name, status, ipaddr, msg, access_time) insert into d_sys_logininfor (user_name, status, ipaddr, msg, access_time)
values (#{userName}, #{status}, #{ipaddr}, #{msg}, sysdate()) values (#{userName}, #{status}, #{ipaddr}, #{msg}, now())
</insert> </insert>
<select id="selectLogininforList" parameterType="SysLogininfor" resultMap="SysLogininforResult"> <select id="selectLogininforList" parameterType="SysLogininfor" resultMap="SysLogininforResult">

View File

@ -29,7 +29,7 @@
</resultMap> </resultMap>
<sql id="selectMenuVo"> <sql id="selectMenuVo">
select menu_id, menu_name, parent_id, order_num, path, component, `query`, route_name, is_frame, is_cache, menu_type, visible, status, ifnull(perms,'') as perms, icon, create_time select menu_id, menu_name, parent_id, order_num, path, component, query, route_name, is_frame, is_cache, menu_type, visible, status, coalesce(perms,'') as perms, icon, create_time
from d_sys_menu from d_sys_menu
</sql> </sql>
@ -50,13 +50,13 @@
</select> </select>
<select id="selectMenuTreeAll" resultMap="SysMenuResult"> <select id="selectMenuTreeAll" resultMap="SysMenuResult">
select distinct m.menu_id, m.parent_id, m.menu_name, m.path, m.component, m.`query`, m.route_name, m.visible, m.status, ifnull(m.perms,'') as perms, m.is_frame, m.is_cache, m.menu_type, m.icon, m.order_num, m.create_time select distinct m.menu_id, m.parent_id, m.menu_name, m.path, m.component, m.query, m.route_name, m.visible, m.status, coalesce(m.perms,'') as perms, m.is_frame, m.is_cache, m.menu_type, m.icon, m.order_num, m.create_time
from d_sys_menu m where m.menu_type in ('M', 'C') and m.status = 0 from d_sys_menu m where m.menu_type in ('M', 'C') and m.status = '0'
order by m.parent_id, m.order_num order by m.parent_id, m.order_num
</select> </select>
<select id="selectMenuListByUserId" parameterType="SysMenu" resultMap="SysMenuResult"> <select id="selectMenuListByUserId" parameterType="SysMenu" resultMap="SysMenuResult">
select distinct m.menu_id, m.parent_id, m.menu_name, m.path, m.component, m.`query`, m.route_name, m.visible, m.status, ifnull(m.perms,'') as perms, m.is_frame, m.is_cache, m.menu_type, m.icon, m.order_num, m.create_time select distinct m.menu_id, m.parent_id, m.menu_name, m.path, m.component, m.query, m.route_name, m.visible, m.status, coalesce(m.perms,'') as perms, m.is_frame, m.is_cache, m.menu_type, m.icon, m.order_num, m.create_time
from d_sys_menu m from d_sys_menu m
left join d_sys_role_menu rm on m.menu_id = rm.menu_id left join d_sys_role_menu rm on m.menu_id = rm.menu_id
left join d_sys_user_role ur on rm.role_id = ur.role_id left join d_sys_user_role ur on rm.role_id = ur.role_id
@ -75,13 +75,13 @@
</select> </select>
<select id="selectMenuTreeByUserId" parameterType="String" resultMap="SysMenuResult"> <select id="selectMenuTreeByUserId" parameterType="String" resultMap="SysMenuResult">
select distinct m.menu_id, m.parent_id, m.menu_name, m.path, m.component, m.`query`, m.route_name, m.visible, m.status, ifnull(m.perms,'') as perms, m.is_frame, m.is_cache, m.menu_type, m.icon, m.order_num, m.create_time select distinct m.menu_id, m.parent_id, m.menu_name, m.path, m.component, m.query, m.route_name, m.visible, m.status, coalesce(m.perms,'') as perms, m.is_frame, m.is_cache, m.menu_type, m.icon, m.order_num, m.create_time
from d_sys_menu m from d_sys_menu m
left join d_sys_role_menu rm on m.menu_id = rm.menu_id left join d_sys_role_menu rm on m.menu_id = rm.menu_id
left join d_sys_user_role ur on rm.role_id = ur.role_id left join d_sys_user_role ur on rm.role_id = ur.role_id
left join d_sys_role ro on ur.role_id = ro.role_id left join d_sys_role ro on ur.role_id = ro.role_id
left join d_sys_user u on ur.user_id = u.user_id left join d_sys_user u on ur.user_id = u.user_id
where u.user_id = #{userId} and m.menu_type in ('M', 'C') and m.status = 0 AND ro.status = 0 where u.user_id = #{userId} and m.menu_type in ('M', 'C') and m.status = '0' AND ro.status = '0'
order by m.parent_id, m.order_num order by m.parent_id, m.order_num
</select> </select>
@ -141,7 +141,7 @@
<if test="orderNum != null">order_num = #{orderNum},</if> <if test="orderNum != null">order_num = #{orderNum},</if>
<if test="path != null and path != ''">path = #{path},</if> <if test="path != null and path != ''">path = #{path},</if>
<if test="component != null">component = #{component},</if> <if test="component != null">component = #{component},</if>
<if test="query != null">`query` = #{query},</if> <if test="query != null">query = #{query},</if>
<if test="routeName != null">route_name = #{routeName},</if> <if test="routeName != null">route_name = #{routeName},</if>
<if test="isFrame != null and isFrame != ''">is_frame = #{isFrame},</if> <if test="isFrame != null and isFrame != ''">is_frame = #{isFrame},</if>
<if test="isCache != null and isCache != ''">is_cache = #{isCache},</if> <if test="isCache != null and isCache != ''">is_cache = #{isCache},</if>
@ -152,7 +152,7 @@
<if test="icon !=null and icon != ''">icon = #{icon},</if> <if test="icon !=null and icon != ''">icon = #{icon},</if>
<if test="remark != null and remark != ''">remark = #{remark},</if> <if test="remark != null and remark != ''">remark = #{remark},</if>
<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if> <if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
update_time = sysdate() update_time = now()
</set> </set>
where menu_id = #{menuId} where menu_id = #{menuId}
</update> </update>
@ -165,7 +165,7 @@
<if test="orderNum != null">order_num,</if> <if test="orderNum != null">order_num,</if>
<if test="path != null and path != ''">path,</if> <if test="path != null and path != ''">path,</if>
<if test="component != null and component != ''">component,</if> <if test="component != null and component != ''">component,</if>
<if test="query != null and query != ''">`query`,</if> <if test="query != null and query != ''">query,</if>
<if test="routeName != null">route_name,</if> <if test="routeName != null">route_name,</if>
<if test="isFrame != null and isFrame != ''">is_frame,</if> <if test="isFrame != null and isFrame != ''">is_frame,</if>
<if test="isCache != null and isCache != ''">is_cache,</if> <if test="isCache != null and isCache != ''">is_cache,</if>
@ -195,7 +195,7 @@
<if test="icon != null and icon != ''">#{icon},</if> <if test="icon != null and icon != ''">#{icon},</if>
<if test="remark != null and remark != ''">#{remark},</if> <if test="remark != null and remark != ''">#{remark},</if>
<if test="createBy != null and createBy != ''">#{createBy},</if> <if test="createBy != null and createBy != ''">#{createBy},</if>
sysdate() now()
) )
</insert> </insert>
@ -203,4 +203,4 @@
delete from d_sys_menu where menu_id = #{menuId} delete from d_sys_menu where menu_id = #{menuId}
</delete> </delete>
</mapper> </mapper>

View File

@ -58,7 +58,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="status != null and status != ''">#{status}, </if> <if test="status != null and status != ''">#{status}, </if>
<if test="remark != null and remark != ''">#{remark},</if> <if test="remark != null and remark != ''">#{remark},</if>
<if test="createBy != null and createBy != ''">#{createBy},</if> <if test="createBy != null and createBy != ''">#{createBy},</if>
sysdate() now()
) )
</insert> </insert>
@ -70,7 +70,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="noticeContent != null">notice_content = #{noticeContent}, </if> <if test="noticeContent != null">notice_content = #{noticeContent}, </if>
<if test="status != null and status != ''">status = #{status}, </if> <if test="status != null and status != ''">status = #{status}, </if>
<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if> <if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
update_time = sysdate() update_time = now()
</set> </set>
where notice_id = #{noticeId} where notice_id = #{noticeId}
</update> </update>

View File

@ -30,7 +30,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<insert id="insertOperlog" parameterType="SysOperLog"> <insert id="insertOperlog" parameterType="SysOperLog">
insert into d_sys_oper_log(title, business_type, method, request_method, operator_type, oper_name, dept_name, oper_url, oper_ip, oper_param, json_result, status, error_msg, cost_time, oper_time) insert into d_sys_oper_log(title, business_type, method, request_method, operator_type, oper_name, dept_name, oper_url, oper_ip, oper_param, json_result, status, error_msg, cost_time, oper_time)
values (#{title}, #{businessType}, #{method}, #{requestMethod}, #{operatorType}, #{operName}, #{deptName}, #{operUrl}, #{operIp}, #{operParam}, #{jsonResult}, #{status}, #{errorMsg}, #{costTime}, sysdate()) values (#{title}, #{businessType}, #{method}, #{requestMethod}, #{operatorType}, #{operName}, #{deptName}, #{operUrl}, #{operIp}, #{operParam}, #{jsonResult}, #{status}, #{errorMsg}, #{costTime}, now())
</insert> </insert>
<select id="selectOperLogList" parameterType="SysOperLog" resultMap="SysOperLogResult"> <select id="selectOperLogList" parameterType="SysOperLog" resultMap="SysOperLogResult">

View File

@ -81,7 +81,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="status != null and status != ''">status = #{status},</if> <if test="status != null and status != ''">status = #{status},</if>
<if test="remark != null">remark = #{remark},</if> <if test="remark != null">remark = #{remark},</if>
<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if> <if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
update_time = sysdate() update_time = now()
</set> </set>
where post_id = #{postId} where post_id = #{postId}
</update> </update>
@ -104,7 +104,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="status != null and status != ''">#{status},</if> <if test="status != null and status != ''">#{status},</if>
<if test="remark != null and remark != ''">#{remark},</if> <if test="remark != null and remark != ''">#{remark},</if>
<if test="createBy != null and createBy != ''">#{createBy},</if> <if test="createBy != null and createBy != ''">#{createBy},</if>
sysdate() now()
) )
</insert> </insert>

View File

@ -46,10 +46,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
AND r.role_key like concat('%', #{roleKey}, '%') AND r.role_key like concat('%', #{roleKey}, '%')
</if> </if>
<if test="params.beginTime != null and params.beginTime != ''"><!-- 开始时间检索 --> <if test="params.beginTime != null and params.beginTime != ''"><!-- 开始时间检索 -->
and date_format(r.create_time,'%Y%m%d') &gt;= date_format(#{params.beginTime},'%Y%m%d') and date(r.create_time) &gt;= date(#{params.beginTime})
</if> </if>
<if test="params.endTime != null and params.endTime != ''"><!-- 结束时间检索 --> <if test="params.endTime != null and params.endTime != ''"><!-- 结束时间检索 -->
and date_format(r.create_time,'%Y%m%d') &lt;= date_format(#{params.endTime},'%Y%m%d') and date(r.create_time) &lt;= date(#{params.endTime})
</if> </if>
<!-- 数据范围过滤 --> <!-- 数据范围过滤 -->
${params.dataScope} ${params.dataScope}
@ -117,7 +117,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="status != null and status != ''">#{status},</if> <if test="status != null and status != ''">#{status},</if>
<if test="remark != null and remark != ''">#{remark},</if> <if test="remark != null and remark != ''">#{remark},</if>
<if test="createBy != null and createBy != ''">#{createBy},</if> <if test="createBy != null and createBy != ''">#{createBy},</if>
sysdate() now()
) )
</insert> </insert>
@ -133,7 +133,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="status != null and status != ''">status = #{status},</if> <if test="status != null and status != ''">status = #{status},</if>
<if test="remark != null">remark = #{remark},</if> <if test="remark != null">remark = #{remark},</if>
<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if> <if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
update_time = sysdate() update_time = now()
</set> </set>
where role_id = #{roleId} where role_id = #{roleId}
</update> </update>

View File

@ -74,13 +74,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
AND u.phonenumber like concat('%', #{phonenumber}, '%') AND u.phonenumber like concat('%', #{phonenumber}, '%')
</if> </if>
<if test="params.beginTime != null and params.beginTime != ''"><!-- 开始时间检索 --> <if test="params.beginTime != null and params.beginTime != ''"><!-- 开始时间检索 -->
AND date_format(u.create_time,'%Y%m%d') &gt;= date_format(#{params.beginTime},'%Y%m%d') AND date(u.create_time) &gt;= date(#{params.beginTime})
</if> </if>
<if test="params.endTime != null and params.endTime != ''"><!-- 结束时间检索 --> <if test="params.endTime != null and params.endTime != ''"><!-- 结束时间检索 -->
AND date_format(u.create_time,'%Y%m%d') &lt;= date_format(#{params.endTime},'%Y%m%d') AND date(u.create_time) &lt;= date(#{params.endTime})
</if> </if>
<if test="deptId != null and deptId != ''"> <if test="deptId != null and deptId != ''">
AND (u.dept_id = #{deptId} OR u.dept_id IN ( SELECT t.dept_id FROM d_sys_dept t WHERE find_in_set(#{deptId}, ancestors) )) AND (u.dept_id = #{deptId} OR u.dept_id IN ( SELECT t.dept_id FROM d_sys_dept t WHERE concat(',', ancestors, ',') like concat('%,', #{deptId}, ',%') ))
</if> </if>
<!-- 数据范围过滤 --> <!-- 数据范围过滤 -->
${params.dataScope} ${params.dataScope}
@ -173,7 +173,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="pwdUpdateDate != null">#{pwdUpdateDate},</if> <if test="pwdUpdateDate != null">#{pwdUpdateDate},</if>
<if test="createBy != null and createBy != ''">#{createBy},</if> <if test="createBy != null and createBy != ''">#{createBy},</if>
<if test="remark != null and remark != ''">#{remark},</if> <if test="remark != null and remark != ''">#{remark},</if>
sysdate() now()
) )
</insert> </insert>
@ -192,17 +192,17 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="loginDate != null">login_date = #{loginDate},</if> <if test="loginDate != null">login_date = #{loginDate},</if>
<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if> <if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
<if test="remark != null">remark = #{remark},</if> <if test="remark != null">remark = #{remark},</if>
update_time = sysdate() update_time = now()
</set> </set>
where user_id = #{userId} where user_id = #{userId}
</update> </update>
<update id="updateUserStatus" parameterType="SysUser"> <update id="updateUserStatus" parameterType="SysUser">
update d_sys_user set status = #{status}, update_time = sysdate() where user_id = #{userId} update d_sys_user set status = #{status}, update_time = now() where user_id = #{userId}
</update> </update>
<update id="updateUserAvatar" parameterType="SysUser"> <update id="updateUserAvatar" parameterType="SysUser">
update d_sys_user set avatar = #{avatar}, update_time = sysdate() where user_id = #{userId} update d_sys_user set avatar = #{avatar}, update_time = now() where user_id = #{userId}
</update> </update>
<update id="updateLoginInfo" parameterType="SysUser"> <update id="updateLoginInfo" parameterType="SysUser">
@ -210,7 +210,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</update> </update>
<update id="resetUserPwd" parameterType="SysUser"> <update id="resetUserPwd" parameterType="SysUser">
update d_sys_user set pwd_update_date = sysdate(), password = #{password}, update_time = sysdate() where user_id = #{userId} update d_sys_user set pwd_update_date = now(), password = #{password}, update_time = now() where user_id = #{userId}
</update> </update>
<delete id="deleteUserById" parameterType="String"> <delete id="deleteUserById" parameterType="String">