项目文件结构变更,修改分组管理页面功能实现

This commit is contained in:
wyt
2025-07-15 17:09:20 +08:00
parent 9c75dc550c
commit 1055b39ea4
18 changed files with 213 additions and 98 deletions

View File

@@ -2,13 +2,15 @@
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.zhyc.module.group_management.mapper.BasSheepGroupMapper">
<mapper namespace="com.zhyc.module.fileManagement.mapper.BasSheepGroupMapper">
<resultMap type="BasSheepGroup" id="BasSheepGroupResult">
<result property="groupId" column="group_id" />
<result property="parentId" column="parent_id" />
<result property="groupName" column="group_name" />
<result property="ancestors" column="ancestors" />
<result property="ancestorNames" column="ancestor_names"/>
<result property="isLeaf" column="is_leaf"/>
<result property="status" column="status" />
<result property="createBy" column="create_by" />
<result property="createTime" column="create_time" />
@@ -16,16 +18,36 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="updateTime" column="update_time" />
</resultMap>
<!-- <sql id="selectBasSheepGroupVo">-->
<!-- select group_id, parent_id, group_name, ancestors, status, create_by, create_time, update_by, update_time from bas_sheep_group-->
<!-- </sql>-->
<!-- 修改基础查询语句 -->
<sql id="selectBasSheepGroupVo">
select group_id, parent_id, group_name, ancestors, status, create_by, create_time, update_by, update_time from bas_sheep_group
SELECT
g.group_id,
g.parent_id,
g.group_name,
g.ancestors,
g.status,
g.create_by,
g.create_time,
g.update_by,
g.update_time,
<!-- 新增祖先名称查询 -->
(SELECT GROUP_CONCAT(parent.group_name ORDER BY FIND_IN_SET(parent.group_id, g.ancestors))
FROM bas_sheep_group parent
WHERE FIND_IN_SET(parent.group_id, g.ancestors) > 0
) AS ancestor_names,
(CASE WHEN (SELECT COUNT(1) FROM bas_sheep_group child WHERE child.parent_id = g.group_id) > 0 THEN 0 ELSE 1 END) AS is_leaf
FROM bas_sheep_group g
</sql>
<select id="selectBasSheepGroupList" parameterType="BasSheepGroup" resultMap="BasSheepGroupResult">
<include refid="selectBasSheepGroupVo"/>
<where>
<where>
<if test="groupName != null and groupName != ''"> and group_name like concat('%', #{groupName}, '%')</if>
<if test="status != null and status != ''"> and status = #{status}</if>
</where>
</where>ORDER BY g.group_id <!-- 确保正确排序 -->
</select>
<select id="selectBasSheepGroupByGroupId" parameterType="Long" resultMap="BasSheepGroupResult">
@@ -77,9 +99,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</delete>
<delete id="deleteBasSheepGroupByGroupIds" parameterType="String">
delete from bas_sheep_group where group_id in
delete from bas_sheep_group where group_id in
<foreach item="groupId" collection="array" open="(" separator="," close=")">
#{groupId}
</foreach>
</delete>
</mapper>

View File

@@ -2,7 +2,7 @@
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.zhyc.module.sheepfold_management.mapper.DaSheepfoldMapper">
<mapper namespace="com.zhyc.module.fileManagement.mapper.DaSheepfoldMapper">
<resultMap type="DaSheepfold" id="DaSheepfoldResult">
<result property="id" column="id" />
@@ -78,4 +78,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
#{id}
</foreach>
</delete>
<select id="selectCount" parameterType="DaSheepfold" resultType="int">
SELECT COUNT(*)
FROM da_sheepfold
WHERE ranch_id = #{ranchId}
AND sheepfold_type_id = #{sheepfoldTypeId}
AND sheepfold_no = #{sheepfoldNo}
</select>
</mapper>

View File

@@ -2,7 +2,7 @@
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.zhyc.module.sheep_file.mapper.SheepFileMapper">
<mapper namespace="com.zhyc.module.fileManagement.mapper.SheepFileMapper">
<resultMap type="SheepFile" id="SheepFileResult">
<result property="id" column="id" />