代码调整
This commit is contained in:
@@ -3,6 +3,7 @@ package com.njcn.csdevice.mapper;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.njcn.csdevice.pojo.dto.DataArrayDTO;
|
||||
import com.njcn.csdevice.pojo.po.CsDataArray;
|
||||
import com.njcn.csdevice.pojo.vo.EnergyTemplateVO;
|
||||
import com.njcn.csdevice.pojo.vo.LineTargetVO;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
@@ -26,4 +27,5 @@ public interface CsDataArrayMapper extends BaseMapper<CsDataArray> {
|
||||
|
||||
List<CsDataArray> getGroupData(@Param("id") String id);
|
||||
|
||||
List<EnergyTemplateVO> getArrayByGroup(@Param("list") List<String> list);
|
||||
}
|
||||
|
||||
@@ -1,8 +1,11 @@
|
||||
package com.njcn.csdevice.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.njcn.csdevice.pojo.po.CsGroup;
|
||||
import com.njcn.csdevice.pojo.vo.CsGroupVO;
|
||||
import com.njcn.csdevice.pojo.vo.DataGroupTemplateVO;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
@@ -24,4 +27,6 @@ public interface CsGroupMapper extends BaseMapper<CsGroup> {
|
||||
List<CsGroupVO> getArrayData(@Param("list") List<String> list);
|
||||
|
||||
void insertList(@Param("list") List<CsGroup> list);
|
||||
|
||||
Page<DataGroupTemplateVO> getGroupDataList(IPage<DataGroupTemplateVO> page, @Param("id") String id);
|
||||
}
|
||||
|
||||
@@ -65,4 +65,28 @@
|
||||
phase
|
||||
order by min(sort)
|
||||
</select>
|
||||
|
||||
<select id="getArrayByGroup" resultType="EnergyTemplateVO">
|
||||
select
|
||||
t1.id,
|
||||
t0.group_id pid,
|
||||
t1.data_id dataId,
|
||||
t1.name,
|
||||
case when t1.phase in ('A', 'B', 'C') then concat(t1.phase, "相", t1.another_name)
|
||||
when t1.phase in ('M', 'T') then t1.another_name
|
||||
else concat(t1.phase, t1.another_name)
|
||||
end anotherName,
|
||||
t1.stat_method statMethod,
|
||||
t1.phase
|
||||
from
|
||||
cs_gro_arr t0
|
||||
left join cs_data_array t1 on
|
||||
t0.array_id = t1.id
|
||||
where
|
||||
t0.group_id in
|
||||
<foreach collection='list' item='item' index="index" open='(' separator=',' close=')'>
|
||||
#{item}
|
||||
</foreach>
|
||||
order by t1.sort
|
||||
</select>
|
||||
</mapper>
|
||||
@@ -71,4 +71,19 @@
|
||||
</foreach>
|
||||
</insert>
|
||||
|
||||
|
||||
<select id="getGroupDataList" resultType="DataGroupTemplateVO">
|
||||
select
|
||||
id,
|
||||
data_set_id pid,
|
||||
group_name name,
|
||||
sort
|
||||
from
|
||||
cs_group
|
||||
where
|
||||
data_set_id = #{id} and is_show = 1
|
||||
order by
|
||||
sort
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
Reference in New Issue
Block a user