package com.miniframe.mappers.es.dao; import com.miniframe.mappers.es.model.ProComAttDto; import com.miniframe.model.es.EsDataAtt; import com.miniframe.model.system.SysUser; import com.miniframe.system.MiniserviceBaseDao; import org.apache.ibatis.annotations.Delete; import org.apache.ibatis.annotations.Select; import java.util.List; public interface EsMapper extends MiniserviceBaseDao { /** * 删除 连线 * @param pid * @return */ @Delete("delete from es_pro_com_con where pid =#{pid}") void deleteEsProComCon(String pid); /** * 删除 组件属性值 * @param pid * @return */ @Delete("delete from es_pro_com_att_data where pid =#{pid}") Integer deleteEsProComAttData(String pid); /** * 删除 组件属性 * @param pid * @return */ @Delete("delete from es_pro_com_att where pid =#{pid}") Integer deleteEsProComAtt(String pid); /** * 删除 组件 * @param pid * @return */ @Delete("delete from es_pro_com where pid =#{pid}") Integer deletEsProCom(String pid); /** * 项目组件 获取最大编号 * @param pid * @param idCode * @return */ @Select("select max(ser) from es_pro_com where pid =#{pid} and id_code=#{idCode}") Integer getProComSer(String pid,String idCode); /** * 项目组件属性值数据 * @param pcId * @return */ @Select("select a.pca_id as pcaId," + "a.value as value," + "a.unit as unit," + "b.unit_type as unitType," + "b.name as name," + "b.code as code," + "b.value_def as valueDef," + "b.value_type as valueType, " + "(select max(c.type) from es_data as c where c.cd_id = b.value_def) as dataType " + "from es_pro_com_att a,es_att b where a.att_id=b.att_id and pc_id=#{pcId} ORDER BY ser asc;") List selectPrComAttList(String pcId); /** * 项目组件属性值数据 排除数列数据 * @param pcId * @return */ @Select("select a.pca_id as pcaId," + "a.value as value," + "a.unit as unit," + "b.unit_type as unitType," + "b.name as name," + "b.code as code," + "b.value_def as valueDef," + "b.value_type as valueType, " + "(select max(c.type) from es_data as c where c.cd_id = b.value_def) as dataType " + "from es_pro_com_att a,es_att b " + "where a.att_id=b.att_id " + "and value_type in(0,1,2) " + "and pc_id=#{pcId} " + "ORDER BY b.ser asc;") List selectPrComAttListNoData(String pcId); /** * 项目组件属性值数据查询 * @param pcId 项目组件ID * @return */ @Select("select DISTINCT cd_id from es_pro_com_att_data where pc_id = #{pcId} order by cd_id asc") List selectAttDataCdIds(String pcId); /** * 项目组件属性值数据查询 * @param pcId * @return */ @Select("select a.value as value, " + "a.unit as unit, " + "b.unit_type as unitType, " + "b.name as name, " + "b.code as code, " + "b.value_def as valueDef, " + "b.value_type as valueType,0 as dataType " + "from es_pro_com_att_data a,es_data_att b " + "where a.cdv_id = b.cdv_id and a.pc_id= #{pcId} " + "and a.cd_id=#{cdId} " + "ORDER BY b.ser asc;") List selectPrComAttDataList(String pcId,String cdId); /** * 获取组件连接的节点IdCode+Ser 如:N1 N2 * @param pcId * @return */ @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}") List selectComconNodeIdcodeSer(String pcId); /** * 模拟属性查询 * @param pcId * @return */ @Select("select a.pca_id as pcaId," + "a.value as value," + "a.unit as unit," + "b.unit_type as unitType," + "b.name as name," + "b.code as code," + "b.value_def as valueDef," + "b.value_type as valueType, " + "0 as dataType " + "from es_pro_com_att a,es_att b " + "where a.att_id=b.att_id " + "and a.com_id='-1' " + "and pid=#{pcId} ORDER BY ser asc;") List selectSimulationsPrComAttDataList(String pcId); }