refactor: 多租户开发和代码规范调整
This commit is contained in:
@@ -2,9 +2,9 @@
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.youlai.boot.platform.ai.mapper.AiCommandLogMapper">
|
||||
<mapper namespace="com.youlai.boot.platform.ai.mapper.AiCommandRecordMapper">
|
||||
|
||||
<resultMap id="AiCommandLogVOResult" type="com.youlai.boot.platform.ai.model.vo.AiCommandLogVO">
|
||||
<resultMap id="AiCommandRecordResultMap" type="com.youlai.boot.platform.ai.model.vo.AiCommandRecordVO">
|
||||
<id property="id" column="id"/>
|
||||
<result property="userId" column="user_id"/>
|
||||
<result property="username" column="username"/>
|
||||
@@ -28,55 +28,55 @@
|
||||
<result property="updateTime" column="update_time"/>
|
||||
</resultMap>
|
||||
|
||||
<select id="getLogPage" resultMap="AiCommandLogVOResult">
|
||||
<select id="getRecordPage" resultMap="AiCommandRecordResultMap">
|
||||
SELECT
|
||||
acl.id,
|
||||
acl.user_id,
|
||||
acl.username,
|
||||
acl.original_command,
|
||||
acl.ai_provider,
|
||||
acl.ai_model,
|
||||
acl.parse_status,
|
||||
acl.function_calls,
|
||||
acl.explanation,
|
||||
acl.confidence,
|
||||
acl.parse_error_message,
|
||||
acl.input_tokens,
|
||||
acl.output_tokens,
|
||||
acl.parse_duration_ms,
|
||||
acl.function_name,
|
||||
acl.function_arguments,
|
||||
acl.execute_status,
|
||||
acl.execute_error_message,
|
||||
acl.ip_address,
|
||||
acl.create_time,
|
||||
acl.update_time
|
||||
FROM ai_command_log acl
|
||||
acr.id,
|
||||
acr.user_id,
|
||||
acr.username,
|
||||
acr.original_command,
|
||||
acr.ai_provider,
|
||||
acr.ai_model,
|
||||
acr.parse_status,
|
||||
acr.function_calls,
|
||||
acr.explanation,
|
||||
acr.confidence,
|
||||
acr.parse_error_message,
|
||||
acr.input_tokens,
|
||||
acr.output_tokens,
|
||||
acr.parse_duration_ms,
|
||||
acr.function_name,
|
||||
acr.function_arguments,
|
||||
acr.execute_status,
|
||||
acr.execute_error_message,
|
||||
acr.ip_address,
|
||||
acr.create_time,
|
||||
acr.update_time
|
||||
FROM ai_command_record acr
|
||||
<where>
|
||||
<if test="queryParams.keywords != null and queryParams.keywords != ''">
|
||||
(
|
||||
acl.original_command LIKE CONCAT('%', #{queryParams.keywords}, '%')
|
||||
OR acl.function_name LIKE CONCAT('%', #{queryParams.keywords}, '%')
|
||||
OR acl.username LIKE CONCAT('%', #{queryParams.keywords}, '%')
|
||||
acr.original_command LIKE CONCAT('%', #{queryParams.keywords}, '%')
|
||||
OR acr.function_name LIKE CONCAT('%', #{queryParams.keywords}, '%')
|
||||
OR acr.username LIKE CONCAT('%', #{queryParams.keywords}, '%')
|
||||
)
|
||||
</if>
|
||||
<if test="queryParams.executeStatus != null">
|
||||
AND acl.execute_status = #{queryParams.executeStatus}
|
||||
AND acr.execute_status = #{queryParams.executeStatus}
|
||||
</if>
|
||||
<if test="queryParams.userId != null">
|
||||
AND acl.user_id = #{queryParams.userId}
|
||||
AND acr.user_id = #{queryParams.userId}
|
||||
</if>
|
||||
<if test="queryParams.parseStatus != null">
|
||||
AND acl.parse_status = #{queryParams.parseStatus}
|
||||
AND acr.parse_status = #{queryParams.parseStatus}
|
||||
</if>
|
||||
<if test="queryParams.functionName != null and queryParams.functionName != ''">
|
||||
AND acl.function_name = #{queryParams.functionName}
|
||||
AND acr.function_name = #{queryParams.functionName}
|
||||
</if>
|
||||
<if test="queryParams.aiProvider != null and queryParams.aiProvider != ''">
|
||||
AND acl.ai_provider = #{queryParams.aiProvider}
|
||||
AND acr.ai_provider = #{queryParams.aiProvider}
|
||||
</if>
|
||||
<if test="queryParams.aiModel != null and queryParams.aiModel != ''">
|
||||
AND acl.ai_model = #{queryParams.aiModel}
|
||||
AND acr.ai_model = #{queryParams.aiModel}
|
||||
</if>
|
||||
<if test="
|
||||
queryParams.createTime != null
|
||||
@@ -86,10 +86,10 @@
|
||||
and queryParams.createTime[1] != null
|
||||
and queryParams.createTime[1] != ''
|
||||
">
|
||||
AND acl.create_time BETWEEN #{queryParams.createTime[0]} AND #{queryParams.createTime[1]}
|
||||
AND acr.create_time BETWEEN #{queryParams.createTime[0]} AND #{queryParams.createTime[1]}
|
||||
</if>
|
||||
</where>
|
||||
ORDER BY acl.create_time DESC
|
||||
ORDER BY acr.create_time DESC
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
@@ -16,7 +16,7 @@
|
||||
CASE WHEN t2.id IS NOT NULL THEN 1 ELSE 0 END AS isConfigured
|
||||
FROM
|
||||
information_schema.tables t1
|
||||
LEFT JOIN gen_config t2 on t1.TABLE_NAME = t2.table_name
|
||||
LEFT JOIN gen_table t2 on t1.TABLE_NAME = t2.table_name
|
||||
WHERE
|
||||
t1.TABLE_SCHEMA = (SELECT DATABASE())
|
||||
AND t1.table_type = 'BASE TABLE'
|
||||
@@ -46,7 +46,7 @@
|
||||
ALL_TABLES t1
|
||||
LEFT JOIN ALL_TAB_COMMENTS c ON t1.TABLE_NAME = c.TABLE_NAME AND t1.OWNER = c.OWNER
|
||||
LEFT JOIN ALL_OBJECTS o ON t1.TABLE_NAME = o.OBJECT_NAME AND t1.OWNER = o.OWNER AND o.OBJECT_TYPE = 'TABLE'
|
||||
LEFT JOIN gen_config t2 ON t1.TABLE_NAME = t2.table_name
|
||||
LEFT JOIN gen_table t2 ON t1.TABLE_NAME = t2.table_name
|
||||
WHERE
|
||||
t1.OWNER = 'YOULAI_BOOT'
|
||||
<if test="queryParams.keywords != null and queryParams.keywords.trim() neq ''">
|
||||
|
||||
@@ -2,6 +2,6 @@
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.youlai.boot.platform.codegen.mapper.GenConfigMapper">
|
||||
<mapper namespace="com.youlai.boot.platform.codegen.mapper.GenTableMapper">
|
||||
|
||||
</mapper>
|
||||
|
||||
@@ -2,6 +2,6 @@
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.youlai.boot.platform.generator.mapper.GenFieldConfigMapper">
|
||||
<mapper namespace="com.youlai.boot.platform.codegen.mapper.GenTableColumnMapper">
|
||||
|
||||
</mapper>
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
<?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.youlai.boot.platform.codegen.mapper.GenTableColumnMapper">
|
||||
|
||||
</mapper>
|
||||
7
src/main/resources/mapper/codegen/GenTableMapper.xml
Normal file
7
src/main/resources/mapper/codegen/GenTableMapper.xml
Normal file
@@ -0,0 +1,7 @@
|
||||
<?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.youlai.boot.platform.codegen.mapper.GenTableMapper">
|
||||
|
||||
</mapper>
|
||||
Reference in New Issue
Block a user