提交 a5ebc48b authored 作者: junjie's avatar junjie

feat(backend):分组 场景 sql fix

上级 1fb3f2ee
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
and chart_group.id = #{id,jdbcType=VARCHAR} and chart_group.id = #{id,jdbcType=VARCHAR}
</if> </if>
<if test="name != null and name != ''"> <if test="name != null and name != ''">
and chart_group.`name` = CONCAT('%', #{name},'%') and chart_group.`name` like CONCAT('%', #{name},'%')
</if> </if>
<if test="pid != null"> <if test="pid != null">
and chart_group.pid = #{pid,jdbcType=VARCHAR} and chart_group.pid = #{pid,jdbcType=VARCHAR}
......
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
and dataset_group.id = #{id,jdbcType=VARCHAR} and dataset_group.id = #{id,jdbcType=VARCHAR}
</if> </if>
<if test="name != null and name != ''"> <if test="name != null and name != ''">
and dataset_group.`name` = CONCAT('%', #{name},'%') and dataset_group.`name` like CONCAT('%', #{name},'%')
</if> </if>
<if test="pid != null"> <if test="pid != null">
and dataset_group.pid = #{pid,jdbcType=VARCHAR} and dataset_group.pid = #{pid,jdbcType=VARCHAR}
......
...@@ -46,8 +46,9 @@ public class ChartGroupService { ...@@ -46,8 +46,9 @@ public class ChartGroupService {
} }
public void delete(String id) { public void delete(String id) {
ChartGroup cg = chartGroupMapper.selectByPrimaryKey(id);
ChartGroupRequest ChartGroup = new ChartGroupRequest(); ChartGroupRequest ChartGroup = new ChartGroupRequest();
ChartGroup.setId(id); BeanUtils.copyBean(ChartGroup, cg);
List<ChartGroupDTO> tree = tree(ChartGroup); List<ChartGroupDTO> tree = tree(ChartGroup);
List<String> ids = new ArrayList<>(); List<String> ids = new ArrayList<>();
getAllId(tree, ids); getAllId(tree, ids);
...@@ -70,7 +71,7 @@ public class ChartGroupService { ...@@ -70,7 +71,7 @@ public class ChartGroupService {
public List<ChartGroupDTO> tree(ChartGroupRequest chartGroup) { public List<ChartGroupDTO> tree(ChartGroupRequest chartGroup) {
chartGroup.setUserId(String.valueOf(AuthUtils.getUser().getUserId())); chartGroup.setUserId(String.valueOf(AuthUtils.getUser().getUserId()));
if(chartGroup.getLevel() == null){ if (chartGroup.getLevel() == null) {
chartGroup.setLevel(0); chartGroup.setLevel(0);
} }
List<ChartGroupDTO> treeInfo = extChartGroupMapper.search(chartGroup); List<ChartGroupDTO> treeInfo = extChartGroupMapper.search(chartGroup);
......
...@@ -51,9 +51,10 @@ public class DataSetGroupService { ...@@ -51,9 +51,10 @@ public class DataSetGroupService {
return dataSetGroupDTO; return dataSetGroupDTO;
} }
public void delete(String id) throws Exception{ public void delete(String id) throws Exception {
DatasetGroup dg = datasetGroupMapper.selectByPrimaryKey(id);
DataSetGroupRequest datasetGroup = new DataSetGroupRequest(); DataSetGroupRequest datasetGroup = new DataSetGroupRequest();
datasetGroup.setId(id); BeanUtils.copyBean(datasetGroup, dg);
List<DataSetGroupDTO> tree = tree(datasetGroup); List<DataSetGroupDTO> tree = tree(datasetGroup);
List<String> ids = new ArrayList<>(); List<String> ids = new ArrayList<>();
getAllId(tree, ids); getAllId(tree, ids);
...@@ -68,7 +69,7 @@ public class DataSetGroupService { ...@@ -68,7 +69,7 @@ public class DataSetGroupService {
return datasetGroupMapper.selectByPrimaryKey(id); return datasetGroupMapper.selectByPrimaryKey(id);
} }
public void deleteTableAndField(List<String> sceneIds) throws Exception{ public void deleteTableAndField(List<String> sceneIds) throws Exception {
for (String sceneId : sceneIds) { for (String sceneId : sceneIds) {
DataSetTableRequest dataSetTableRequest = new DataSetTableRequest(); DataSetTableRequest dataSetTableRequest = new DataSetTableRequest();
dataSetTableRequest.setSceneId(sceneId); dataSetTableRequest.setSceneId(sceneId);
...@@ -81,7 +82,7 @@ public class DataSetGroupService { ...@@ -81,7 +82,7 @@ public class DataSetGroupService {
public List<DataSetGroupDTO> tree(DataSetGroupRequest datasetGroup) { public List<DataSetGroupDTO> tree(DataSetGroupRequest datasetGroup) {
datasetGroup.setUserId(String.valueOf(AuthUtils.getUser().getUserId())); datasetGroup.setUserId(String.valueOf(AuthUtils.getUser().getUserId()));
if(datasetGroup.getLevel() == null){ if (datasetGroup.getLevel() == null) {
datasetGroup.setLevel(0); datasetGroup.setLevel(0);
} }
List<DataSetGroupDTO> treeInfo = extDataSetGroupMapper.search(datasetGroup); List<DataSetGroupDTO> treeInfo = extDataSetGroupMapper.search(datasetGroup);
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论