fit:增加航线分类接口计数

This commit is contained in:
gyb 2026-02-11 13:12:13 +08:00
parent 1d25c15369
commit 11336eaea1
3 changed files with 33 additions and 6 deletions

View File

@ -28,6 +28,11 @@ public class AirlineFileGroupEntity extends ExBaseEntity {
*/
private Long userId;
/**
* 航线数量
*/
private Integer airlineCount;
@Override
public String toString() {

View File

@ -36,6 +36,11 @@ public class AirlineFileGroupDTO extends BaseEntity {
*/
private List<AirlineFileDTO> groupInfos;
/**
* 航线数量
*/
private Integer airlineCount;
@Override
public String toString() {
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)

View File

@ -16,6 +16,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="delFlag" column="del_flag" />
<result property="deletedBy" column="deleted_by" />
<result property="deletedTime" column="deleted_time" />
<result property="airlineCount" column="airline_count" />
</resultMap>
<!-- 结果映射 -->
@ -88,18 +89,34 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<!-- 查询分组列表 -->
<select id="selectGroupList" parameterType="com.ruoyi.airline.mapper.entity.AirlineFileGroupEntity" resultMap="AirlineFileGroupResult">
select group_id, group_name, user_id, create_by, create_time, update_by, update_time, del_flag, deleted_by, deleted_time
from airline_file_group
select
afg.group_id,
afg.group_name,
afg.user_id,
afg.create_by,
afg.create_time,
afg.update_by,
afg.update_time,
afg.del_flag,
afg.deleted_by,
afg.deleted_time,
COALESCE(airline_count.count, 0) as airline_count
from airline_file_group afg
left join (
select afgi.group_id, count(afgi.id) as count
from airline_file_group_info afgi
group by afgi.group_id
) airline_count on afg.group_id = airline_count.group_id
<where>
and del_flag = 0
afg.del_flag = 0
<if test="groupName != null and groupName != ''">
and group_name like concat('%', #{groupName}, '%')
and afg.group_name like concat('%', #{groupName}, '%')
</if>
<if test="userId != null">
and user_id = #{userId}
and afg.user_id = #{userId}
</if>
</where>
order by create_time desc
order by afg.create_time desc
</select>