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

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

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