WXF пре 3 година
родитељ
комит
9d17f0fc7d

+ 3 - 0
simulation-resource-server/src/main/java/com/css/simulation/resource/model/mapper/ConfigMapper.java

@@ -7,6 +7,7 @@ import api.common.pojo.po.model.ConfigSensorPO;
 import api.common.pojo.vo.model.ConfigSensorVO;
 import api.common.pojo.vo.model.ConfigVO;
 import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
 import org.springframework.stereotype.Repository;
 
 import java.util.List;
@@ -33,4 +34,6 @@ public interface ConfigMapper {
     void insertConfigSensors(List<ConfigSensorPO> configSensorPOs);
 
     int delConfigById(ConfigPO po);
+
+    int getConfigTotal(@Param("createUserId") String currentUserId);
 }

+ 4 - 0
simulation-resource-server/src/main/java/com/css/simulation/resource/model/service/ConfigService.java

@@ -190,4 +190,8 @@ public class ConfigService {
         ConfigPO configPO = shareConfigByInfo(configVO);
         return configPO;
     }
+
+    public int getConfigTotal(){
+        return configMapper.getConfigTotal(AuthUtil.getCurrentUserId());
+    }
 }

+ 4 - 0
simulation-resource-server/src/main/resources/mapper/model/ConfigMapper.xml

@@ -217,4 +217,8 @@
           is_deleted = #{isDeleted,jdbcType=VARCHAR}
         where id = #{id,jdbcType=VARCHAR}
     </update>
+
+    <select id="getConfigTotal" parameterType="java.lang.String" resultType="java.lang.Integer">
+        select COUNT(1) from model_config where is_deleted = '0' and share = '0' and create_user_id = #{createUserId,jdbcType=VARCHAR}
+    </select>
 </mapper>