zhaowenyu
2026-03-07 d7fef91a4cbb702988dc820bcde82c166253ceec
ard-inspection/src/main/resources/mapper/ArdInspectionGroupMapper.xml
@@ -14,6 +14,7 @@
        <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="parentName" column="parent_name" />
    </resultMap>
@@ -26,13 +27,15 @@
               create_by,
               create_time,
               update_by,
               update_time
               update_time,
               del_flag
        from ard_inspection_group
    </sql>
    <select id="selectArdInspectionGroupList" parameterType="ArdInspectionGroup" resultMap="ArdInspectionGroupResult">
        <include refid="selectArdInspectionGroupVo"/>
        <where>
            del_flag = '0'
            <if test="groupId != null ">
                and group_id = #{groupId}
            </if>
@@ -107,21 +110,27 @@
        where group_id = #{groupId}
    </update>
    <delete id="deleteArdInspectionGroupByGroupId" parameterType="Long">
        delete from ard_inspection_group where group_id = #{groupId}
    </delete>
    <update id="deleteArdInspectionGroupByGroupId" parameterType="Long">
        update ard_inspection_group set del_flag = '2' where group_id = #{groupId}
    </update>
    <delete id="deleteArdInspectionGroupByGroupIds" parameterType="String">
        delete from ard_inspection_group where group_id in
    <update id="deleteArdInspectionGroupByGroupIds" parameterType="String">
        update ard_inspection_group set del_flag = '2' where group_id in
        <foreach item="groupId" collection="array" open="(" separator="," close=")">
            #{groupId}
        </foreach>
    </delete>
    </update>
    <select id="checkInspectionGroupNameUnique" resultMap="ArdInspectionGroupResult">
    <select id="checkInspectionGroupNameUniqueA" resultMap="ArdInspectionGroupResult">
        <include refid="selectArdInspectionGroupVo"/>
        where group_name=#{groupName}
        and group_parent_id = #{groupParentId} limit 1
    </select>
    <select id="checkInspectionGroupNameUniqueB" resultMap="ArdInspectionGroupResult">
        <include refid="selectArdInspectionGroupVo"/>
        where del_flag = '0'
        and group_name=#{groupName} limit 1
    </select>
    <select id="selectChildrenInspectionGroupById" parameterType="Long" resultMap="ArdInspectionGroupResult">
@@ -143,11 +152,17 @@
    <select id="hasChildByInspectionGroupId" parameterType="Long" resultType="int">
        select count(1) from ard_inspection_group
        where group_parent_id = #{groupId} limit 1
        where del_flag = '0' and group_parent_id = #{groupId} limit 1
    </select>
    <select id="checkInspectionGroupExistUser" parameterType="Long" resultType="int">
        select count(1) from sys_user where group_id = #{groupId} and del_flag = '0'
    </select>
    <select id="selectMaxGroupId" resultType="int">
        SELECT group_id FROM ard_inspection_group
        WHERE group_parent_id = 0 AND ancestors = 0
        ORDER BY group_id DESC LIMIT 1
    </select>
</mapper>