项目初始化

This commit is contained in:
liuhanqing
2025-12-03 16:09:29 +08:00
commit 68c9100aab
1649 changed files with 303228 additions and 0 deletions

View File

@@ -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.ruoyi.api.mapper.JobStatisticsMapper">
<!-- 查询当日入库数量 -->
<select id="selectDailyInCount" parameterType="String" resultType="Integer">
SELECT COUNT(1)
FROM mydo_job_finish
WHERE CONVERT(varchar(10), create_time, 120) = #{createTime}
AND in_or_out &lt; 20
</select>
<!-- 查询当日出库数量 -->
<select id="selectDailyOutCount" parameterType="String" resultType="Integer">
SELECT COUNT(1)
FROM mydo_job_finish
WHERE CONVERT(varchar(10), create_time, 120) = #{createTime}
AND in_or_out >= 20
</select>
<!-- 查询当月每日入库出库统计 -->
<select id="selectMonthlyStatistics" resultType="java.util.Map">
SELECT
DAY(create_time) as date,
SUM(CASE WHEN in_or_out &lt; 20 THEN 1 ELSE 0 END) as '入库',
SUM(CASE WHEN in_or_out >= 20 THEN 1 ELSE 0 END) as '出库'
FROM mydo_job_finish
WHERE YEAR(create_time) = #{year}
AND MONTH(create_time) = #{month}
GROUP BY DAY(create_time)
ORDER BY date
</select>
</mapper>

View File

@@ -0,0 +1,106 @@
<?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.ruoyi.ai.vector.mapper.KnowledgeFileMapper">
<resultMap type="KnowledgeFile" id="KnowledgeFileResult">
<result property="id" column="id" />
<result property="knowledgeBaseId" column="knowledge_base_id" />
<result property="fileName" column="file_name" />
<result property="filePath" column="file_path" />
<result property="fileSize" column="file_size" />
<result property="fileType" column="file_type" />
<result property="description" column="description" />
<result property="isVectorized" column="is_vectorized" />
<result property="vectorizedTime" column="vectorized_time" />
<result property="uploadTime" column="upload_time" />
<result property="updatedAt" column="updated_at" />
<result property="isDeleted" column="is_deleted" />
</resultMap>
<sql id="selectKnowledgeFileVo">
select id, knowledge_base_id, file_name, file_path, file_size, file_type, description, is_vectorized, vectorized_time, upload_time, updated_at, is_deleted from knowledge_file
</sql>
<select id="selectKnowledgeFileList" parameterType="KnowledgeFile" resultMap="KnowledgeFileResult">
<include refid="selectKnowledgeFileVo"/>
<where>
<if test="knowledgeBaseId != null "> and knowledge_base_id = #{knowledgeBaseId}</if>
<if test="fileName != null and fileName != ''"> and file_name like concat('%', #{fileName}, '%')</if>
<if test="filePath != null and filePath != ''"> and file_path = #{filePath}</if>
<if test="fileSize != null "> and file_size = #{fileSize}</if>
<if test="fileType != null and fileType != ''"> and file_type = #{fileType}</if>
<if test="description != null and description != ''"> and description = #{description}</if>
<if test="isVectorized != null "> and is_vectorized = #{isVectorized}</if>
<if test="vectorizedTime != null "> and vectorized_time = #{vectorizedTime}</if>
<if test="uploadTime != null "> and upload_time = #{uploadTime}</if>
<if test="updatedAt != null "> and updated_at = #{updatedAt}</if>
<if test="isDeleted != null "> and is_deleted = #{isDeleted}</if>
</where>
</select>
<select id="selectKnowledgeFileById" parameterType="Long" resultMap="KnowledgeFileResult">
<include refid="selectKnowledgeFileVo"/>
where id = #{id}
</select>
<insert id="insertKnowledgeFile" parameterType="KnowledgeFile" useGeneratedKeys="true" keyProperty="id">
insert into knowledge_file
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="knowledgeBaseId != null">knowledge_base_id,</if>
<if test="fileName != null and fileName != ''">file_name,</if>
<if test="filePath != null and filePath != ''">file_path,</if>
<if test="fileSize != null">file_size,</if>
<if test="fileType != null">file_type,</if>
<if test="description != null">description,</if>
<if test="isVectorized != null">is_vectorized,</if>
<if test="vectorizedTime != null">vectorized_time,</if>
<if test="uploadTime != null">upload_time,</if>
<if test="updatedAt != null">updated_at,</if>
<if test="isDeleted != null">is_deleted,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="knowledgeBaseId != null">#{knowledgeBaseId},</if>
<if test="fileName != null and fileName != ''">#{fileName},</if>
<if test="filePath != null and filePath != ''">#{filePath},</if>
<if test="fileSize != null">#{fileSize},</if>
<if test="fileType != null">#{fileType},</if>
<if test="description != null">#{description},</if>
<if test="isVectorized != null">#{isVectorized},</if>
<if test="vectorizedTime != null">#{vectorizedTime},</if>
<if test="uploadTime != null">#{uploadTime},</if>
<if test="updatedAt != null">#{updatedAt},</if>
<if test="isDeleted != null">#{isDeleted},</if>
</trim>
</insert>
<update id="updateKnowledgeFile" parameterType="KnowledgeFile">
update knowledge_file
<trim prefix="SET" suffixOverrides=",">
<if test="knowledgeBaseId != null">knowledge_base_id = #{knowledgeBaseId},</if>
<if test="fileName != null and fileName != ''">file_name = #{fileName},</if>
<if test="filePath != null and filePath != ''">file_path = #{filePath},</if>
<if test="fileSize != null">file_size = #{fileSize},</if>
<if test="fileType != null">file_type = #{fileType},</if>
<if test="description != null">description = #{description},</if>
<if test="isVectorized != null">is_vectorized = #{isVectorized},</if>
<if test="vectorizedTime != null">vectorized_time = #{vectorizedTime},</if>
<if test="uploadTime != null">upload_time = #{uploadTime},</if>
<if test="updatedAt != null">updated_at = #{updatedAt},</if>
<if test="isDeleted != null">is_deleted = #{isDeleted},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteKnowledgeFileById" parameterType="Long">
delete from knowledge_file where id = #{id}
</delete>
<delete id="deleteKnowledgeFileByIds" parameterType="String">
delete from knowledge_file where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>