Beispiel #1
0
        /// <summary>
        /// 添加充电桩
        /// </summary>
        /// <param name="bean"></param>
        public void AddChargPile(ChargPile bean)
        {
            Log.Debug("Add方法参数:" + bean.ToString());
            var sql1 = new StringBuilder();
            var sql2 = new StringBuilder();
            var i    = 0;
            var list = new List <object>();

            if (bean.DEV_CHARGPILE != null)
            {
                sql1.Append(" DEV_CHARGPILE,");
                sql2.Append(" {" + i++ + "},");
                list.Add(bean.DEV_CHARGPILE);
            }
            if (bean.BOX_ID != null)
            {
                sql1.Append(" BOX_ID,");
                sql2.Append(" {" + i++ + "},");
                list.Add(bean.BOX_ID);
            }
            if (!string.IsNullOrEmpty(bean.PILETYPEID))
            {
                sql1.Append(" PILETYPEID,");
                sql2.Append(" {" + i++ + "},");
                list.Add(bean.PILETYPEID);
            }
            if (!string.IsNullOrEmpty(bean.ZHUANGTAI))
            {
                sql1.Append(" ZHUANGTAI,");
                sql2.Append(" {" + i++ + "},");
                list.Add(bean.ZHUANGTAI);
            }
            if (bean.CREATEDT != null)
            {
                sql1.Append(" CREATEDT,");
                sql2.Append(" {" + i++ + "},");
                list.Add(bean.CREATEDT);
            }
            if (sql1.Length > 0)
            {
                sql1 = sql1.Remove(sql1.Length - 1, 1);
                sql2 = sql2.Remove(sql2.Length - 1, 1);
            }
            var sql = "insert into DEV_CHARGPILE(" + sql1 + ") values(" + sql2 + ")";

            Oop.Execute(sql, list.ToArray());
        }
Beispiel #2
0
        /// <summary>
        /// 添加充电桩
        /// </summary>
        /// <param name="chargpile"></param>
        public void AddPile(ChargPile bean)
        {
            Log.Debug("Add方法参数:" + bean.ToString());
            var sql1 = new StringBuilder();
            var sql2 = new StringBuilder();
            var i    = 0;
            var list = new List <object>();

            if (bean.DEV_CHARGPILE != null)
            {
                sql1.Append(" DEV_CHARGPILE,");
                sql2.Append(" {" + i++ + "},");
                list.Add(bean.DEV_CHARGPILE);
            }
            if (bean.BOX_ID != null)
            {
                sql1.Append(" BOX_ID,");
                sql2.Append(" {" + i++ + "},");
                list.Add(bean.BOX_ID);
            }
            if (bean.ZONGXIAN_DZ != null)
            {
                sql1.Append(" ZONGXIAN_DZ,");
                sql2.Append(" {" + i++ + "},");
                list.Add(bean.ZONGXIAN_DZ);
            }
            if (!string.IsNullOrEmpty(bean.DTU_ID))
            {
                sql1.Append(" DTU_ID,");
                sql2.Append(" {" + i++ + "},");
                list.Add(bean.DTU_ID);
            }
            if (!string.IsNullOrEmpty(bean.PILETYPEID))
            {
                sql1.Append(" PILETYPEID,");
                sql2.Append(" {" + i++ + "},");
                list.Add(bean.PILETYPEID);
            }
            if (!string.IsNullOrEmpty(bean.CHANGJIAO_BH))
            {
                sql1.Append(" CHANGJIAO_BH,");
                sql2.Append(" {" + i++ + "},");
                list.Add(bean.CHANGJIAO_BH);
            }
            if (!string.IsNullOrEmpty(bean.YUNXING_BH))
            {
                sql1.Append(" YUNXING_BH,");
                sql2.Append(" {" + i++ + "},");
                list.Add(bean.YUNXING_BH);
            }
            if (bean.TOUYOU_SJ != new DateTime())
            {
                sql1.Append(" TOUYOU_SJ,");
                sql2.Append(" {" + i++ + "},");
                list.Add(bean.TOUYOU_SJ);
            }
            else
            {
                sql1.Append(" TOUYOU_SJ,");
                sql2.Append(" null,");
            }
            if (!string.IsNullOrEmpty(bean.ZHUANGTAI))
            {
                sql1.Append(" ZHUANGTAI,");
                sql2.Append(" {" + i++ + "},");
                list.Add(bean.ZHUANGTAI);
            }
            if (!string.IsNullOrEmpty(bean.ZHICHAN_BH))
            {
                sql1.Append(" ZHICHAN_BH,");
                sql2.Append(" {" + i++ + "},");
                list.Add(bean.ZHICHAN_BH);
            }
            if (!string.IsNullOrEmpty(bean.YUNWEI_DW))
            {
                sql1.Append(" YUNWEI_DW,");
                sql2.Append(" {" + i++ + "},");
                list.Add(bean.YUNWEI_DW);
            }
            if (!string.IsNullOrEmpty(bean.REMARK))
            {
                sql1.Append(" REMARK,");
                sql2.Append(" {" + i++ + "},");
                list.Add(bean.REMARK);
            }
            if (sql1.Length > 0)
            {
                sql1 = sql1.Remove(sql1.Length - 1, 1);
                sql2 = sql2.Remove(sql2.Length - 1, 1);
            }
            var sql = "insert into dev_chargpile(" + sql1 + ",CREATEDT) values(" + sql2 + ",sysdate)";

            Oop.Execute(sql, list.ToArray());
        }