EsMapper.java 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151
  1. package com.miniframe.mappers.es.dao;
  2. import com.miniframe.mappers.es.model.ProComAttDto;
  3. import com.miniframe.model.es.EsDataAtt;
  4. import com.miniframe.model.system.SysUser;
  5. import com.miniframe.system.MiniserviceBaseDao;
  6. import org.apache.ibatis.annotations.Delete;
  7. import org.apache.ibatis.annotations.Select;
  8. import java.util.List;
  9. public interface EsMapper extends MiniserviceBaseDao {
  10. /**
  11. * 删除 连线
  12. * @param pid
  13. * @return
  14. */
  15. @Delete("delete from es_pro_com_con where pid =#{pid}")
  16. void deleteEsProComCon(String pid);
  17. /**
  18. * 删除 组件属性值
  19. * @param pid
  20. * @return
  21. */
  22. @Delete("delete from es_pro_com_att_data where pid =#{pid}")
  23. Integer deleteEsProComAttData(String pid);
  24. /**
  25. * 删除 组件属性
  26. * @param pid
  27. * @return
  28. */
  29. @Delete("delete from es_pro_com_att where pid =#{pid}")
  30. Integer deleteEsProComAtt(String pid);
  31. /**
  32. * 删除 组件
  33. * @param pid
  34. * @return
  35. */
  36. @Delete("delete from es_pro_com where pid =#{pid}")
  37. Integer deletEsProCom(String pid);
  38. /**
  39. * 项目组件 获取最大编号
  40. * @param pid
  41. * @param idCode
  42. * @return
  43. */
  44. @Select("select max(ser) from es_pro_com where pid =#{pid} and id_code=#{idCode}")
  45. Integer getProComSer(String pid,String idCode);
  46. /**
  47. * 项目组件属性值数据
  48. * @param pcId
  49. * @return
  50. */
  51. @Select("select a.pca_id as pcaId," +
  52. "a.value as value," +
  53. "a.unit as unit," +
  54. "b.unit_type as unitType," +
  55. "b.name as name," +
  56. "b.code as code," +
  57. "b.value_def as valueDef," +
  58. "b.value_type as valueType, " +
  59. "(select max(c.type) from es_data as c where c.cd_id = b.value_def) as dataType " +
  60. "from es_pro_com_att a,es_att b where a.att_id=b.att_id and pc_id=#{pcId} ORDER BY ser asc;")
  61. List<ProComAttDto> selectPrComAttList(String pcId);
  62. /**
  63. * 项目组件属性值数据 排除数列数据
  64. * @param pcId
  65. * @return
  66. */
  67. @Select("select a.pca_id as pcaId," +
  68. "a.value as value," +
  69. "a.unit as unit," +
  70. "b.unit_type as unitType," +
  71. "b.name as name," +
  72. "b.code as code," +
  73. "b.value_def as valueDef," +
  74. "b.value_type as valueType, " +
  75. "(select max(c.type) from es_data as c where c.cd_id = b.value_def) as dataType " +
  76. "from es_pro_com_att a,es_att b " +
  77. "where a.att_id=b.att_id " +
  78. "and value_type in(0,1,2) " +
  79. "and pc_id=#{pcId} " +
  80. "ORDER BY b.ser asc;")
  81. List<ProComAttDto> selectPrComAttListNoData(String pcId);
  82. /**
  83. * 项目组件属性值数据查询
  84. * @param pcId 项目组件ID
  85. * @return
  86. */
  87. @Select("select DISTINCT cd_id from es_pro_com_att_data where pc_id = #{pcId} order by cd_id asc")
  88. List<String> selectAttDataCdIds(String pcId);
  89. /**
  90. * 项目组件属性值数据查询
  91. * @param pcId
  92. * @return
  93. */
  94. @Select("select a.value as value, " +
  95. "a.unit as unit, " +
  96. "b.unit_type as unitType, " +
  97. "b.name as name, " +
  98. "b.code as code, " +
  99. "b.value_def as valueDef, " +
  100. "b.value_type as valueType,0 as dataType " +
  101. "from es_pro_com_att_data a,es_data_att b " +
  102. "where a.cdv_id = b.cdv_id and a.pc_id= #{pcId} " +
  103. "and a.cd_id=#{cdId} " +
  104. "ORDER BY b.ser asc;")
  105. List<ProComAttDto> selectPrComAttDataList(String pcId,String cdId);
  106. /**
  107. * 获取组件连接的节点IdCode+Ser 如:N1 N2
  108. * @param pcId
  109. * @return
  110. */
  111. @Select("select DISTINCT concat(a.id_code,a.ser) from es_pro_com a ,es_pro_com_con b where a.pc_id = b.npc_id and b.pc_id =#{pcId}")
  112. List<String> selectComconNodeIdcodeSer(String pcId);
  113. /**
  114. * 模拟属性查询
  115. * @param pcId
  116. * @return
  117. */
  118. @Select("select a.pca_id as pcaId," +
  119. "a.value as value," +
  120. "a.unit as unit," +
  121. "b.unit_type as unitType," +
  122. "b.name as name," +
  123. "b.code as code," +
  124. "b.value_def as valueDef," +
  125. "b.value_type as valueType, " +
  126. "0 as dataType " +
  127. "from es_pro_com_att a,es_att b " +
  128. "where a.att_id=b.att_id " +
  129. "and a.com_id='-1' " +
  130. "and pid=#{pcId} ORDER BY ser asc;")
  131. List<ProComAttDto> selectSimulationsPrComAttDataList(String pcId);
  132. }