Commit 5f87b00e authored by jichao's avatar jichao

模板按照项目分开,团队维护不显示的bug

parent b406d747
......@@ -32,9 +32,10 @@ public interface ReportRepository {
* @param params
* @return
*/
@Select("<script>select t.DEV_NUM,t.TM,t.ORIGINAL_STR,s.SENSOR_JSON,m.ELEC,m.GAS from total_original t,total_sensor s," +
"(select d.DEV_NUM,m.CREATE_TIME TM,m.ELEC,m.GAS from energy_count_m m,bus_device_meter d where m.PRO_ID=d.PRO_ID and m.MET_NUM=d.MET_NUM) m " +
"where t.TM=s.TM and t.PRO_ID=s.PRO_ID and t.TM=m.TM and t.DEV_NUM=m.DEV_NUM and t.WATER_V is null and t.ELEC_V is null and t.GAS_V is null " +
@Select("<script>select t.DEV_NUM,t.TM,t.ORIGINAL_STR,s.SENSOR_JSON,m.ELEC,m.GAS from total_original t " +
"left join (select d.DEV_NUM,m.CREATE_TIME TM,m.ELEC,m.GAS from energy_count_m m,bus_device_meter d where m.PRO_ID=d.PRO_ID and m.MET_NUM=d.MET_NUM) m on t.TM=m.TM and t.DEV_NUM=m.DEV_NUM " +
"left join total_sensor s on t.TM=s.TM and t.PRO_ID=s.PRO_ID " +
"where t.WATER_V is null and t.ELEC_V is null and t.GAS_V is null " +
"and t.PRO_ID=#{proId} and date_format(t.TM, '%Y-%c-%e')=#{time} " +
"order by t.DEV_NUM,t.TM</script>")
@ResultMap(value = "original")
......
......@@ -34,8 +34,8 @@ public interface BusTeamRepository extends BaseMapper<BusTeam>{
* 分页查询 busTeam
*
*/
@Select("<script>select a.*,b.* from bus_team a,sys_principal b where a.pri_id =b.pri_id " +
" and team_type = #{teamType} order by a.CREATE_DATE desc"
@Select("<script>select * from bus_team a left join sys_principal b on a.pri_id =b.pri_id " +
"where a.team_type = #{teamType} order by a.CREATE_DATE desc"
+ "</script>")
List<Map<String,Object>> queryBusTeams(@Param("teamType") String teamType);
......
......@@ -104,11 +104,11 @@ public class BusEnergyPlanController extends PaginationController<BusEnergyPlan>
@ApiOperation(value="查询设备类型", notes="查询设备类型")
@GetMapping(value = "/queryDeviceTp")
public Result queryDeviceTp(){
public Result queryDeviceTp(@RequestParam String proId){
return Result.builder(new PersistModel(1),
MessageConstant.MESSAGE_ALERT_SUCCESS,
MessageConstant.MESSAGE_ALERT_ERROR,
busEnergyPlanServiceImpl.queryDeviceTp());
busEnergyPlanServiceImpl.queryDeviceTp(proId));
}
@ApiOperation(value="根据设备类型查询设备", notes="根据设备类型查询设备")
......
......@@ -56,9 +56,9 @@ public interface BusEnergyPlanRepository extends BaseMapper<BusEnergyPlan> {
* 获取设备类型
* @return
*/
@Select("<script>select * from bus_device_tp "
@Select("<script>select * from bus_device_tp where PRO_ID=#{proId}"
+ "</script>")
List<Map<String,Object>> queryDeviceTp();
List<Map<String,Object>> queryDeviceTp(@Param("proId") String proId);
/**
* 根据设备类型获取设备
......
......@@ -56,7 +56,7 @@ public interface BusEnergyPlanService {
* 获取设备类型
* @return
*/
List<Map<String,Object>> queryDeviceTp();
List<Map<String,Object>> queryDeviceTp(String proId);
/**
* 根据设备类型获取设备
......
......@@ -238,9 +238,9 @@ public class BusEnergyPlanServiceImpl implements BusEnergyPlanService {
}
@Override
public List<Map<String, Object>> queryDeviceTp() {
List<Map<String, Object>> list = busEnergyPlanRepository.queryDeviceTp();
for(Map<String, Object> m : list){
public List<Map<String, Object>> queryDeviceTp(String proId) {
List<Map<String, Object>> list = busEnergyPlanRepository.queryDeviceTp(proId);
// for(Map<String, Object> m : list){
/*if(m.get("DEV_TP_IMG")!=null && !m.get("DEV_TP_IMG").toString().equals("") && !m.get("DEV_TP_IMG").toString().equals("null")){
String type = "";
String img = UploadUtil.GetImageStr(m.get("DEV_TP_IMG").toString());
......@@ -248,7 +248,7 @@ public class BusEnergyPlanServiceImpl implements BusEnergyPlanService {
}else{
m.put("IMG","");
}*/
}
// }
return list;
}
......
......@@ -26,8 +26,8 @@ public class TopologyNodeController extends PaginationController<TopologyNode> {
@ApiOperation(value="添加", notes="添加")
@PostMapping(value = "/add")
public Result add(@RequestParam MultipartFile file) {
return Result.builder(topologyNodeServiceImpl.save(file),
public Result add(@RequestParam MultipartFile file, @RequestParam String proId) {
return Result.builder(topologyNodeServiceImpl.save(file, proId),
MessageConstant.MESSAGE_ALERT_SUCCESS,
MessageConstant.MESSAGE_ALERT_ERROR,
null);
......@@ -41,10 +41,10 @@ public class TopologyNodeController extends PaginationController<TopologyNode> {
@ApiOperation(value="拓扑图节点图片列表", notes="拓扑图节点图片列表")
@GetMapping("/query")
public Result query() {
public Result query(@RequestParam String proId) {
return Result.builder(new PersistModel(1),
MessageConstant.MESSAGE_ALERT_SUCCESS,
MessageConstant.MESSAGE_ALERT_ERROR,
topologyNodeServiceImpl.queryTopologyNodes());
topologyNodeServiceImpl.queryTopologyNodes(proId));
}
}
package org.rcisoft.business.manage.dao;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.ResultMap;
import org.apache.ibatis.annotations.Select;
import org.rcisoft.business.manage.entity.BusDeviceTp;
......@@ -19,9 +20,9 @@ public interface BusDeviceTpRepository extends BaseMapper<BusDeviceTp> {
* 设备类型列表
*
*/
@Select("<script>select * from bus_device_tp where 1=1 "
@Select("<script>select * from bus_device_tp where PRO_ID=#{proId} "
+ "</script>")
List<Map<String,Object>> queryBusDeviceTps();
List<Map<String,Object>> queryBusDeviceTps(@Param("proId") String proId);
/**
* 查看该设备类型是否配置模板
......
package org.rcisoft.business.manage.dao;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.rcisoft.business.manage.entity.TopologyNode;
import org.rcisoft.core.base.BaseMapper;
......@@ -14,7 +15,7 @@ import java.util.Map;
@Repository
public interface TopologyNodeRepository extends BaseMapper<TopologyNode> {
@Select("<script>select * from topology_node</script>")
List<Map<String,Object>> queryTopologyNodes();
@Select("<script>select * from topology_node where PRO_ID=#{proId}</script>")
List<Map<String,Object>> queryTopologyNodes(@Param("proId") String proId);
}
......@@ -26,6 +26,9 @@ public class BusDeviceTp{
private String devTpImg;
/** 新增加的参数,每个项目需要有独立的模板,互不影响 */
private String proId;
}
......@@ -28,6 +28,9 @@ public class TopologyNode{
private String url;
/** 图片需要区分项目 */
private String proId;
}
......@@ -15,7 +15,7 @@ public interface TopologyNodeService {
* 保存
* @return
*/
PersistModel save(MultipartFile file);
PersistModel save(MultipartFile file, String proId);
/**
* 删除
......@@ -23,7 +23,7 @@ public interface TopologyNodeService {
*/
PersistModel remove(String id);
List<Map<String,Object>> queryTopologyNodes();
List<Map<String,Object>> queryTopologyNodes(String proId);
......
......@@ -107,7 +107,7 @@ public class BusDeviceTpServiceImpl implements BusDeviceTpService {
@Override
public List<Map<String,Object>> queryBusDeviceTpList(String proId) {
List<Map<String,Object>> list = busDeviceTpRepository.queryBusDeviceTps();
List<Map<String,Object>> list = busDeviceTpRepository.queryBusDeviceTps(proId);
for(Map<String,Object> tmap : list){
BusDevicetpParam bdp = new BusDevicetpParam();
bdp.setDevTpId(tmap.get("DEV_TP_ID").toString());
......
......@@ -40,7 +40,7 @@ public class TopologyNodeServiceImpl implements TopologyNodeService {
*/
@Transactional(propagation = Propagation.REQUIRED,isolation = Isolation.DEFAULT)
@Override
public PersistModel save(MultipartFile file){
public PersistModel save(MultipartFile file, String proId){
int line = 1;
String fileName = file.getOriginalFilename();
String suffixName = fileName.substring(fileName.lastIndexOf("."));
......@@ -56,6 +56,7 @@ public class TopologyNodeServiceImpl implements TopologyNodeService {
TopologyNode tn = new TopologyNode();
tn.setId(id);
tn.setUrl(id + suffixName);
tn.setProId(proId);
topologyNodeRepository.insertSelective(tn);
line = 1;
}catch(Exception e){
......@@ -86,8 +87,8 @@ public class TopologyNodeServiceImpl implements TopologyNodeService {
}
@Override
public List<Map<String, Object>> queryTopologyNodes() {
return topologyNodeRepository.queryTopologyNodes();
public List<Map<String, Object>> queryTopologyNodes(String proId) {
return topologyNodeRepository.queryTopologyNodes(proId);
}
......
......@@ -5,6 +5,7 @@
<id column="DEV_TP_ID" jdbcType="VARCHAR" property="devTpId"/>
<result column="DEV_TP_NM" jdbcType="VARCHAR" property="devTpNm"/>
<result column="DEV_TP_IMG" jdbcType="VARCHAR" property="devTpImg"/>
<result column="PRO_ID" jdbcType="VARCHAR" property="proId"/>
</resultMap>
<!--<cache type="${corePackag!}.util.RedisCache"/>-->
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment