管道基础大数据平台系统开发-【CS】-ExportMap
1
13693261870
2023-03-17 32116a7558911bce361da74ae0ac1b2e4900fb8c
1
已修改1个文件
27 ■■■■■ 文件已修改
ExportMap/db/PubDBHelper.cs 27 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ExportMap/db/PubDBHelper.cs
@@ -17,6 +17,33 @@
        private static string insertMetaPubSql = "insert into lf.sys_meta_pub (metaid, pubid) select {0}, {1} from (select 1) temp where not exists (select 1 from lf.sys_meta_pub where metaid = {0} and pubid = {1})";
        /// <summary>
        /// 是/否发布过
        /// </summary>
        public static bool IsPublish(int metaid)
        {
            string sql = "select count(*) from lf.sys_meta_pub a inner join lf.sys_publish b on a.pubid = b.id where a.metaid = " + metaid;
            object obj = Tool.DBHelper.GetScalar(sql);
            int count = obj == null ? 0 : Convert.ToInt32(obj);
            return count > 0;
        }
        /// <summary>
        /// 是/否发布过
        /// </summary>
        public static bool IsPublish(string dirid)
        {
            string sql = "select count(*) from lf.sys_meta_pub a inner join lf.sys_publish b on a.pubid = b.id where b.dirid = @dirid";
            DbParameter dp = new NpgsqlParameter("@dirid", dirid);
            object obj = Tool.DBHelper.GetScalar(sql, dp);
            int count = obj == null ? 0 : Convert.ToInt32(obj);
            return count > 0;
        }
        /// <summary>
        /// 插入元数据-数据发布表记录
        /// </summary>
        public static int InsertMetaPub(int metaid, int pubid)