提交 d83cbb70 authored 作者: 吕本才's avatar 吕本才

1、修改查询自定义分组报表顺序错误bug

上级 bf643dd6
......@@ -31,7 +31,10 @@ public class CustomerGroupDaoImpl implements CustomerGroupDao {
Wrapper<CustomerGroup> wraper = new LambdaQueryWrapper<CustomerGroup>()
.eq(ObjectUtil.isNotEmpty(wq.getCreateUserId()), CustomerGroup::getCreateUserId, wq.getCreateUserId())
.eq(ObjectUtil.isNotEmpty(wq.getCategoryName()), CustomerGroup::getCategoryName, wq.getCategoryName())
.in(ObjectUtil.isNotEmpty(wq.getGroupIds()), CustomerGroup::getId, wq.getGroupIds());
.in(ObjectUtil.isNotEmpty(wq.getGroupIds()), CustomerGroup::getId, wq.getGroupIds())
.orderBy(true,true,CustomerGroup::getCreateTime)
.orderBy(true,true,CustomerGroup::getId)
;
List<CustomerGroup> customerGroups = groupMapper.selectList(wraper);
List<CustomerGroupDto> result = new ArrayList<>();
for (CustomerGroup customerGroup : customerGroups) {
......
......@@ -6,6 +6,7 @@ import lombok.Data;
public class CustomerReportGroupQueryListDto {
private String groupId;
private String groupName;
private String categoryName;
private String reportId;
private String reportName;
private Integer reportType;
......
......@@ -13,5 +13,6 @@ import java.util.List;
public class CustomerReportGroupResDto {
private String groupId;
private String groupName;
private String categoryName;
private List<ReportItemsDto> items;
}
......@@ -14,4 +14,5 @@ public class ReportItemsDto {
private String reportName;
// 报表类型,0自定义报表 1 积木报表
private Integer reportType;
}
......@@ -98,7 +98,7 @@ public class CustomerReportGroupServiceImpl implements CustomerReportGroupServic
items.add(dto);
}
}
if(ObjectUtil.isNotEmpty(items)){
if (ObjectUtil.isNotEmpty(items)) {
customerReportGroupDao.batchInsert(items);
}
}
......
......@@ -11,10 +11,10 @@
group_id,
create_by,
create_user_id,
create_time,
update_by,
update_user_id,
update_time,
del_flag,
tenant_id,
update_count
......@@ -27,10 +27,10 @@
#{item.groupId},
#{item.createBy},
#{item.createUserId},
#{item.createTime},
#{item.updateBy},
#{item.updateUserId},
#{item.updateTime},
#{item.delFlag},
#{item.tenantId},
#{item.updateCount}
......@@ -41,14 +41,18 @@
<select id="queryReportGroupList" resultType="com.link.report.pojo.response.CustomerReportGroupQueryListDto">
<!-- 自定义报表关联 -->
select distinct groupId ,groupName,reportId,reportName,previewUrl,reportType from (
select groupId ,groupName,reportId,reportName,previewUrl,reportType,categoryName,createTime,crgId from (
SELECT
cg.id as groupId,
cg.name as groupName,
crg.report_type as reportType,
crg.report_id as reportId,
cr.name as reportName,
cr.preview_url as previewUrl
cr.preview_url as previewUrl,
cg.category_name as categoryName,
crg.create_time as createTime,
crg.id as crgId
FROM
customer_group cg
join customer_report_group crg on crg.group_id = cg.id and crg.report_type = 0
......@@ -68,7 +72,10 @@
crg.report_type as reportType,
jr.id as reportId,
jr.name as reportName,
jrs.preview_url as previewUrl
jrs.preview_url as previewUrl,
cg.category_name as categoryName,
crg.create_time as createTime,
crg.id as crgId
FROM
customer_group cg
......@@ -82,5 +89,7 @@
</if>
</where>
) tmp
order by crgId, createTime
</select>
</mapper>
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论