feat(backend):分组 场景 sql fix

This commit is contained in:
junjie 2021-05-19 14:13:14 +08:00
parent 1fb3f2ee3b
commit a5ebc48b99
4 changed files with 10 additions and 8 deletions

View File

@ -20,7 +20,7 @@
and chart_group.id = #{id,jdbcType=VARCHAR}
</if>
<if test="name != null and name != ''">
and chart_group.`name` = CONCAT('%', #{name},'%')
and chart_group.`name` like CONCAT('%', #{name},'%')
</if>
<if test="pid != null">
and chart_group.pid = #{pid,jdbcType=VARCHAR}

View File

@ -20,7 +20,7 @@
and dataset_group.id = #{id,jdbcType=VARCHAR}
</if>
<if test="name != null and name != ''">
and dataset_group.`name` = CONCAT('%', #{name},'%')
and dataset_group.`name` like CONCAT('%', #{name},'%')
</if>
<if test="pid != null">
and dataset_group.pid = #{pid,jdbcType=VARCHAR}

View File

@ -46,8 +46,9 @@ public class ChartGroupService {
}
public void delete(String id) {
ChartGroup cg = chartGroupMapper.selectByPrimaryKey(id);
ChartGroupRequest ChartGroup = new ChartGroupRequest();
ChartGroup.setId(id);
BeanUtils.copyBean(ChartGroup, cg);
List<ChartGroupDTO> tree = tree(ChartGroup);
List<String> ids = new ArrayList<>();
getAllId(tree, ids);
@ -70,7 +71,7 @@ public class ChartGroupService {
public List<ChartGroupDTO> tree(ChartGroupRequest chartGroup) {
chartGroup.setUserId(String.valueOf(AuthUtils.getUser().getUserId()));
if(chartGroup.getLevel() == null){
if (chartGroup.getLevel() == null) {
chartGroup.setLevel(0);
}
List<ChartGroupDTO> treeInfo = extChartGroupMapper.search(chartGroup);

View File

@ -51,9 +51,10 @@ public class DataSetGroupService {
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();
datasetGroup.setId(id);
BeanUtils.copyBean(datasetGroup, dg);
List<DataSetGroupDTO> tree = tree(datasetGroup);
List<String> ids = new ArrayList<>();
getAllId(tree, ids);
@ -68,7 +69,7 @@ public class DataSetGroupService {
return datasetGroupMapper.selectByPrimaryKey(id);
}
public void deleteTableAndField(List<String> sceneIds) throws Exception{
public void deleteTableAndField(List<String> sceneIds) throws Exception {
for (String sceneId : sceneIds) {
DataSetTableRequest dataSetTableRequest = new DataSetTableRequest();
dataSetTableRequest.setSceneId(sceneId);
@ -81,7 +82,7 @@ public class DataSetGroupService {
public List<DataSetGroupDTO> tree(DataSetGroupRequest datasetGroup) {
datasetGroup.setUserId(String.valueOf(AuthUtils.getUser().getUserId()));
if(datasetGroup.getLevel() == null){
if (datasetGroup.getLevel() == null) {
datasetGroup.setLevel(0);
}
List<DataSetGroupDTO> treeInfo = extDataSetGroupMapper.search(datasetGroup);