feat: 新增工作台管理功能。

This commit is contained in:
tianyongbao
2025-12-12 23:25:30 +08:00
parent ef2f35a128
commit 2a9fb076bd
16 changed files with 1236 additions and 0 deletions

View File

@@ -0,0 +1,114 @@
<?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.intc.invest.mapper.WorkToolCategoryMapper">
<resultMap type="WorkToolCategoryVo" id="WorkToolCategoryResult">
<result property="id" column="id" />
<result property="categoryKey" column="category_key" />
<result property="categoryTitle" column="category_title" />
<result property="sortOrder" column="sort_order" />
<result property="createBy" column="create_by" />
<result property="createTime" column="create_time" />
<result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" />
<result property="delFlag" column="del_flag" />
<result property="remark" column="remark" />
</resultMap>
<sql id="selectWorkToolCategoryVo">
select
wtc.id,
wtc.category_key,
wtc.category_title,
wtc.sort_order,
wtc.create_by,
wtc.create_time,
wtc.update_by,
wtc.update_time,
wtc.del_flag,
wtc.remark
from work_tool_category wtc
</sql>
<select id="selectWorkToolCategoryList" parameterType="WorkToolCategoryDto" resultMap="WorkToolCategoryResult">
<include refid="selectWorkToolCategoryVo"/>
<where>
wtc.del_flag='0'
<if test="categoryKey != null and categoryKey != ''"> and wtc.category_key like '%'|| #{categoryKey}||'%'</if>
<if test="categoryTitle != null and categoryTitle != ''"> and wtc.category_title like '%'|| #{categoryTitle}||'%'</if>
</where>
<!-- 数据范围过滤 -->
${params.dataScope}
order by wtc.sort_order asc, wtc.create_time desc
</select>
<select id="selectWorkToolCategoryById" parameterType="Long" resultMap="WorkToolCategoryResult">
<include refid="selectWorkToolCategoryVo"/>
where wtc.id = #{id}
</select>
<insert id="insertWorkToolCategory" parameterType="WorkToolCategory">
insert into work_tool_category
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">id,</if>
<if test="categoryKey != null and categoryKey != ''">category_key,</if>
<if test="categoryTitle != null and categoryTitle != ''">category_title,</if>
<if test="sortOrder != null">sort_order,</if>
<if test="createBy != null">create_by,</if>
<if test="createTime != null">create_time,</if>
<if test="updateBy != null">update_by,</if>
<if test="updateTime != null">update_time,</if>
<if test="delFlag != null">del_flag,</if>
<if test="remark != null">remark,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">#{id},</if>
<if test="categoryKey != null and categoryKey != ''">#{categoryKey},</if>
<if test="categoryTitle != null and categoryTitle != ''">#{categoryTitle},</if>
<if test="sortOrder != null">#{sortOrder},</if>
<if test="createBy != null">#{createBy},</if>
<if test="createTime != null">#{createTime},</if>
<if test="updateBy != null">#{updateBy},</if>
<if test="updateTime != null">#{updateTime},</if>
<if test="delFlag != null">#{delFlag},</if>
<if test="remark != null">#{remark},</if>
</trim>
</insert>
<update id="updateWorkToolCategory" parameterType="WorkToolCategory">
update work_tool_category
<trim prefix="SET" suffixOverrides=",">
<if test="categoryKey != null and categoryKey != ''">category_key = #{categoryKey},</if>
<if test="categoryTitle != null and categoryTitle != ''">category_title = #{categoryTitle},</if>
<if test="sortOrder != null">sort_order = #{sortOrder},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
<if test="remark != null">remark = #{remark},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteWorkToolCategoryById" parameterType="Long">
delete from work_tool_category where id = #{id}
</delete>
<delete id="deleteWorkToolCategoryByIds" parameterType="String">
delete from work_tool_category where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
<update id="removeWorkToolCategoryById" parameterType="Long">
update work_tool_category set del_flag='1' where id = #{id}
</update>
<update id="removeWorkToolCategoryByIds" parameterType="String">
update work_tool_category set del_flag='1' where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</update>
</mapper>

View File

@@ -0,0 +1,145 @@
<?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.intc.invest.mapper.WorkToolMapper">
<resultMap type="WorkToolVo" id="WorkToolResult">
<result property="id" column="id" />
<result property="categoryId" column="category_id" />
<result property="name" column="name" />
<result property="description" column="description" />
<result property="url" column="url" />
<result property="displayUrl" column="display_url" />
<result property="icon" column="icon" />
<result property="color" column="color" />
<result property="sortOrder" column="sort_order" />
<result property="createBy" column="create_by" />
<result property="createTime" column="create_time" />
<result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" />
<result property="delFlag" column="del_flag" />
<result property="remark" column="remark" />
<result property="categoryKey" column="category_key" />
<result property="categoryTitle" column="category_title" />
</resultMap>
<sql id="selectWorkToolVo">
select
wt.id,
wt.category_id,
wt.name,
wt.description,
wt.url,
wt.display_url,
wt.icon,
wt.color,
wt.sort_order,
wt.create_by,
wt.create_time,
wt.update_by,
wt.update_time,
wt.del_flag,
wt.remark,
wtc.category_key,
wtc.category_title
from work_tool wt
left join work_tool_category wtc on wt.category_id = wtc.id
</sql>
<select id="selectWorkToolList" parameterType="WorkToolDto" resultMap="WorkToolResult">
<include refid="selectWorkToolVo"/>
<where>
wt.del_flag='0'
<if test="categoryId != null"> and wt.category_id = #{categoryId}</if>
<if test="name != null and name != ''"> and wt.name like '%'|| #{name}||'%'</if>
<if test="categoryKey != null and categoryKey != ''"> and wtc.category_key = #{categoryKey}</if>
</where>
<!-- 数据范围过滤 -->
${params.dataScope}
order by wt.category_id asc, wt.sort_order asc, wt.create_time desc
</select>
<select id="selectWorkToolById" parameterType="Long" resultMap="WorkToolResult">
<include refid="selectWorkToolVo"/>
where wt.id = #{id}
</select>
<insert id="insertWorkTool" parameterType="WorkTool">
insert into work_tool
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">id,</if>
<if test="categoryId != null">category_id,</if>
<if test="name != null and name != ''">name,</if>
<if test="description != null">description,</if>
<if test="url != null and url != ''">url,</if>
<if test="displayUrl != null">display_url,</if>
<if test="icon != null">icon,</if>
<if test="color != null">color,</if>
<if test="sortOrder != null">sort_order,</if>
<if test="createBy != null">create_by,</if>
<if test="createTime != null">create_time,</if>
<if test="updateBy != null">update_by,</if>
<if test="updateTime != null">update_time,</if>
<if test="delFlag != null">del_flag,</if>
<if test="remark != null">remark,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">#{id},</if>
<if test="categoryId != null">#{categoryId},</if>
<if test="name != null and name != ''">#{name},</if>
<if test="description != null">#{description},</if>
<if test="url != null and url != ''">#{url},</if>
<if test="displayUrl != null">#{displayUrl},</if>
<if test="icon != null">#{icon},</if>
<if test="color != null">#{color},</if>
<if test="sortOrder != null">#{sortOrder},</if>
<if test="createBy != null">#{createBy},</if>
<if test="createTime != null">#{createTime},</if>
<if test="updateBy != null">#{updateBy},</if>
<if test="updateTime != null">#{updateTime},</if>
<if test="delFlag != null">#{delFlag},</if>
<if test="remark != null">#{remark},</if>
</trim>
</insert>
<update id="updateWorkTool" parameterType="WorkTool">
update work_tool
<trim prefix="SET" suffixOverrides=",">
<if test="categoryId != null">category_id = #{categoryId},</if>
<if test="name != null and name != ''">name = #{name},</if>
<if test="description != null">description = #{description},</if>
<if test="url != null and url != ''">url = #{url},</if>
<if test="displayUrl != null">display_url = #{displayUrl},</if>
<if test="icon != null">icon = #{icon},</if>
<if test="color != null">color = #{color},</if>
<if test="sortOrder != null">sort_order = #{sortOrder},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
<if test="remark != null">remark = #{remark},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteWorkToolById" parameterType="Long">
delete from work_tool where id = #{id}
</delete>
<delete id="deleteWorkToolByIds" parameterType="String">
delete from work_tool where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
<update id="removeWorkToolById" parameterType="Long">
update work_tool set del_flag='1' where id = #{id}
</update>
<update id="removeWorkToolByIds" parameterType="String">
update work_tool set del_flag='1' where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</update>
</mapper>