using Sugar.Enties;
using SqlSugar;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
using Utils;
public class DbContext<T> where T : class, new()
{
    public DbContext()
    {
        Db = new SqlSugarClient(new ConnectionConfig()
        {
            ConnectionString = AppSettingsHelper.Configuration["AppSettings:ConnectionString"],
            DbType = DbType.SqlServer,
            InitKeyType = InitKeyType.Attribute,//从特性读取主键和自增列信息
            IsAutoCloseConnection = true,//开启自动释放模式和EF原理一样我就不多解释了

        });
        //调式代码 用来打印SQL
        Db.Aop.OnLogExecuting = (sql, pars) =>
        {
            Console.WriteLine(sql + "\r\n" +
                Db.Utilities.SerializeObject(pars.ToDictionary(it => it.ParameterName, it => it.Value)));
            NlogHelper.sqlLogger.Debug(sql + "\r\n" +
                Db.Utilities.SerializeObject(pars.ToDictionary(it => it.ParameterName, it => it.Value)));
            Console.WriteLine();
        };

    }
    //注意：不能写成静态的
    public SqlSugarClient Db;//用来处理事务多表查询和复杂的操作
    public SimpleClient<T> CurrentDb { get { return Db.GetSimpleClient<T>(); } }//用来操作当前表的数据

   public SimpleClient<fdc_pm_occupation> fdc_pm_occupationDb { get { return Db.GetSimpleClient<fdc_pm_occupation>(); } }//用来处理fdc_pm_occupation表的常用操作
   public SimpleClient<fdc_pmzsystemUser> fdc_pmzsystemUserDb { get { return Db.GetSimpleClient<fdc_pmzsystemUser>(); } }//用来处理fdc_pmzsystemUser表的常用操作
   public SimpleClient<fdc_pm_vownerbalance> fdc_pm_vownerbalanceDb { get { return Db.GetSimpleClient<fdc_pm_vownerbalance>(); } }//用来处理fdc_pm_vownerbalance表的常用操作
   public SimpleClient<fdc_pm_billsitem> fdc_pm_billsitemDb { get { return Db.GetSimpleClient<fdc_pm_billsitem>(); } }//用来处理fdc_pm_billsitem表的常用操作
   public SimpleClient<fdc_pm_vownerhouse> fdc_pm_vownerhouseDb { get { return Db.GetSimpleClient<fdc_pm_vownerhouse>(); } }//用来处理fdc_pm_vownerhouse表的常用操作
   public SimpleClient<fdc_pm_firearea> fdc_pm_fireareaDb { get { return Db.GetSimpleClient<fdc_pm_firearea>(); } }//用来处理fdc_pm_firearea表的常用操作
   public SimpleClient<fdc_sa_paymodel_b> fdc_sa_paymodel_bDb { get { return Db.GetSimpleClient<fdc_sa_paymodel_b>(); } }//用来处理fdc_sa_paymodel_b表的常用操作
   public SimpleClient<fdc_pm_vownermny> fdc_pm_vownermnyDb { get { return Db.GetSimpleClient<fdc_pm_vownermny>(); } }//用来处理fdc_pm_vownermny表的常用操作
   public SimpleClient<fdc_pm_revfare_bak> fdc_pm_revfare_bakDb { get { return Db.GetSimpleClient<fdc_pm_revfare_bak>(); } }//用来处理fdc_pm_revfare_bak表的常用操作
   public SimpleClient<fdc_pm_fireevent> fdc_pm_fireeventDb { get { return Db.GetSimpleClient<fdc_pm_fireevent>(); } }//用来处理fdc_pm_fireevent表的常用操作
   public SimpleClient<fdc_pm_revfare_b_bak> fdc_pm_revfare_b_bakDb { get { return Db.GetSimpleClient<fdc_pm_revfare_b_bak>(); } }//用来处理fdc_pm_revfare_b_bak表的常用操作
   public SimpleClient<fdc_pm_ownerlog> fdc_pm_ownerlogDb { get { return Db.GetSimpleClient<fdc_pm_ownerlog>(); } }//用来处理fdc_pm_ownerlog表的常用操作
   public SimpleClient<fdc_pm_occupationbill_c> fdc_pm_occupationbill_cDb { get { return Db.GetSimpleClient<fdc_pm_occupationbill_c>(); } }//用来处理fdc_pm_occupationbill_c表的常用操作
   public SimpleClient<fdc_pm_file> fdc_pm_fileDb { get { return Db.GetSimpleClient<fdc_pm_file>(); } }//用来处理fdc_pm_file表的常用操作
   public SimpleClient<fdc_pm_meter_b> fdc_pm_meter_bDb { get { return Db.GetSimpleClient<fdc_pm_meter_b>(); } }//用来处理fdc_pm_meter_b表的常用操作
   public SimpleClient<fdc_pm_envirtype> fdc_pm_envirtypeDb { get { return Db.GetSimpleClient<fdc_pm_envirtype>(); } }//用来处理fdc_pm_envirtype表的常用操作
   public SimpleClient<fdc_pm_rentcontractss> fdc_pm_rentcontractssDb { get { return Db.GetSimpleClient<fdc_pm_rentcontractss>(); } }//用来处理fdc_pm_rentcontractss表的常用操作
   public SimpleClient<fdc_pm_renovaterecord_fare> fdc_pm_renovaterecord_fareDb { get { return Db.GetSimpleClient<fdc_pm_renovaterecord_fare>(); } }//用来处理fdc_pm_renovaterecord_fare表的常用操作
   public SimpleClient<fdc_pm_planttype> fdc_pm_planttypeDb { get { return Db.GetSimpleClient<fdc_pm_planttype>(); } }//用来处理fdc_pm_planttype表的常用操作
   public SimpleClient<fdc_pm_repairapply_fare> fdc_pm_repairapply_fareDb { get { return Db.GetSimpleClient<fdc_pm_repairapply_fare>(); } }//用来处理fdc_pm_repairapply_fare表的常用操作
   public SimpleClient<fdc_pm_ownerinthouse> fdc_pm_ownerinthouseDb { get { return Db.GetSimpleClient<fdc_pm_ownerinthouse>(); } }//用来处理fdc_pm_ownerinthouse表的常用操作
   public SimpleClient<fdc_pm_billsitemstand_b> fdc_pm_billsitemstand_bDb { get { return Db.GetSimpleClient<fdc_pm_billsitemstand_b>(); } }//用来处理fdc_pm_billsitemstand_b表的常用操作
   public SimpleClient<log> logDb { get { return Db.GetSimpleClient<log>(); } }//用来处理log表的常用操作
   public SimpleClient<fdc_pm_houses> fdc_pm_housesDb { get { return Db.GetSimpleClient<fdc_pm_houses>(); } }//用来处理fdc_pm_houses表的常用操作
   public SimpleClient<fdc_pm_ownerremain> fdc_pm_ownerremainDb { get { return Db.GetSimpleClient<fdc_pm_ownerremain>(); } }//用来处理fdc_pm_ownerremain表的常用操作
   public SimpleClient<corps> corpsDb { get { return Db.GetSimpleClient<corps>(); } }//用来处理corps表的常用操作
   public SimpleClient<fdc_pm_occupationbill_g> fdc_pm_occupationbill_gDb { get { return Db.GetSimpleClient<fdc_pm_occupationbill_g>(); } }//用来处理fdc_pm_occupationbill_g表的常用操作
   public SimpleClient<fdc_pm_fireeventtrec> fdc_pm_fireeventtrecDb { get { return Db.GetSimpleClient<fdc_pm_fireeventtrec>(); } }//用来处理fdc_pm_fireeventtrec表的常用操作
   public SimpleClient<dutytype> dutytypeDb { get { return Db.GetSimpleClient<dutytype>(); } }//用来处理dutytype表的常用操作
   public SimpleClient<fdc_pm_renovaterecord> fdc_pm_renovaterecordDb { get { return Db.GetSimpleClient<fdc_pm_renovaterecord>(); } }//用来处理fdc_pm_renovaterecord表的常用操作
   public SimpleClient<fdc_pm_bustype> fdc_pm_bustypeDb { get { return Db.GetSimpleClient<fdc_pm_bustype>(); } }//用来处理fdc_pm_bustype表的常用操作
   public SimpleClient<duty> dutyDb { get { return Db.GetSimpleClient<duty>(); } }//用来处理duty表的常用操作
   public SimpleClient<usersconsole> usersconsoleDb { get { return Db.GetSimpleClient<usersconsole>(); } }//用来处理usersconsole表的常用操作
   public SimpleClient<job> jobDb { get { return Db.GetSimpleClient<job>(); } }//用来处理job表的常用操作
   public SimpleClient<fdc_pm_securityeventtrec> fdc_pm_securityeventtrecDb { get { return Db.GetSimpleClient<fdc_pm_securityeventtrec>(); } }//用来处理fdc_pm_securityeventtrec表的常用操作
   public SimpleClient<fdc_sa_content> fdc_sa_contentDb { get { return Db.GetSimpleClient<fdc_sa_content>(); } }//用来处理fdc_sa_content表的常用操作
   public SimpleClient<fdc_pm_ownerafterrecord> fdc_pm_ownerafterrecordDb { get { return Db.GetSimpleClient<fdc_pm_ownerafterrecord>(); } }//用来处理fdc_pm_ownerafterrecord表的常用操作
   public SimpleClient<fdc_pm_parkcontract> fdc_pm_parkcontractDb { get { return Db.GetSimpleClient<fdc_pm_parkcontract>(); } }//用来处理fdc_pm_parkcontract表的常用操作
   public SimpleClient<fdc_pm_devicetype> fdc_pm_devicetypeDb { get { return Db.GetSimpleClient<fdc_pm_devicetype>(); } }//用来处理fdc_pm_devicetype表的常用操作
   public SimpleClient<fdc_pm_housebillsitemstand> fdc_pm_housebillsitemstandDb { get { return Db.GetSimpleClient<fdc_pm_housebillsitemstand>(); } }//用来处理fdc_pm_housebillsitemstand表的常用操作
   public SimpleClient<inventory> inventoryDb { get { return Db.GetSimpleClient<inventory>(); } }//用来处理inventory表的常用操作
   public SimpleClient<fdc_pm_plant> fdc_pm_plantDb { get { return Db.GetSimpleClient<fdc_pm_plant>(); } }//用来处理fdc_pm_plant表的常用操作
   public SimpleClient<fdc_pm_rentcontract_house> fdc_pm_rentcontract_houseDb { get { return Db.GetSimpleClient<fdc_pm_rentcontract_house>(); } }//用来处理fdc_pm_rentcontract_house表的常用操作
   public SimpleClient<fdc_pm_repairapply_b> fdc_pm_repairapply_bDb { get { return Db.GetSimpleClient<fdc_pm_repairapply_b>(); } }//用来处理fdc_pm_repairapply_b表的常用操作
   public SimpleClient<fdc_pm_device> fdc_pm_deviceDb { get { return Db.GetSimpleClient<fdc_pm_device>(); } }//用来处理fdc_pm_device表的常用操作
   public SimpleClient<fdc_pm_project> fdc_pm_projectDb { get { return Db.GetSimpleClient<fdc_pm_project>(); } }//用来处理fdc_pm_project表的常用操作
   public SimpleClient<nationinfo> nationinfoDb { get { return Db.GetSimpleClient<nationinfo>(); } }//用来处理nationinfo表的常用操作
   public SimpleClient<fdc_pm_reptype> fdc_pm_reptypeDb { get { return Db.GetSimpleClient<fdc_pm_reptype>(); } }//用来处理fdc_pm_reptype表的常用操作
   public SimpleClient<fdc_pm_planttrec> fdc_pm_planttrecDb { get { return Db.GetSimpleClient<fdc_pm_planttrec>(); } }//用来处理fdc_pm_planttrec表的常用操作
   public SimpleClient<settletype> settletypeDb { get { return Db.GetSimpleClient<settletype>(); } }//用来处理settletype表的常用操作
   public SimpleClient<roles> rolesDb { get { return Db.GetSimpleClient<roles>(); } }//用来处理roles表的常用操作
   public SimpleClient<fdc_pm_voucher> fdc_pm_voucherDb { get { return Db.GetSimpleClient<fdc_pm_voucher>(); } }//用来处理fdc_pm_voucher表的常用操作
   public SimpleClient<fdc_pm_renovaterecord_card> fdc_pm_renovaterecord_cardDb { get { return Db.GetSimpleClient<fdc_pm_renovaterecord_card>(); } }//用来处理fdc_pm_renovaterecord_card表的常用操作
   public SimpleClient<fdc_pm_fare_income> fdc_pm_fare_incomeDb { get { return Db.GetSimpleClient<fdc_pm_fare_income>(); } }//用来处理fdc_pm_fare_income表的常用操作
   public SimpleClient<educationinfo> educationinfoDb { get { return Db.GetSimpleClient<educationinfo>(); } }//用来处理educationinfo表的常用操作
   public SimpleClient<fdc_pm_paymode> fdc_pm_paymodeDb { get { return Db.GetSimpleClient<fdc_pm_paymode>(); } }//用来处理fdc_pm_paymode表的常用操作
   public SimpleClient<fdc_pm_paymode_b> fdc_pm_paymode_bDb { get { return Db.GetSimpleClient<fdc_pm_paymode_b>(); } }//用来处理fdc_pm_paymode_b表的常用操作
   public SimpleClient<fdc_pm_meterrecord> fdc_pm_meterrecordDb { get { return Db.GetSimpleClient<fdc_pm_meterrecord>(); } }//用来处理fdc_pm_meterrecord表的常用操作
   public SimpleClient<fdc_pm_appealrecord> fdc_pm_appealrecordDb { get { return Db.GetSimpleClient<fdc_pm_appealrecord>(); } }//用来处理fdc_pm_appealrecord表的常用操作
   public SimpleClient<politystatusinfo> politystatusinfoDb { get { return Db.GetSimpleClient<politystatusinfo>(); } }//用来处理politystatusinfo表的常用操作
   public SimpleClient<rolesInfuncs> rolesInfuncsDb { get { return Db.GetSimpleClient<rolesInfuncs>(); } }//用来处理rolesInfuncs表的常用操作
   public SimpleClient<fdc_pm_calfare> fdc_pm_calfareDb { get { return Db.GetSimpleClient<fdc_pm_calfare>(); } }//用来处理fdc_pm_calfare表的常用操作
   public SimpleClient<fdc_pm_park> fdc_pm_parkDb { get { return Db.GetSimpleClient<fdc_pm_park>(); } }//用来处理fdc_pm_park表的常用操作
   public SimpleClient<NoteMsg> NoteMsgDb { get { return Db.GetSimpleClient<NoteMsg>(); } }//用来处理NoteMsg表的常用操作
   public SimpleClient<fdc_pm_renovaterecord_b> fdc_pm_renovaterecord_bDb { get { return Db.GetSimpleClient<fdc_pm_renovaterecord_b>(); } }//用来处理fdc_pm_renovaterecord_b表的常用操作
   public SimpleClient<fdc_pm_managementsec> fdc_pm_managementsecDb { get { return Db.GetSimpleClient<fdc_pm_managementsec>(); } }//用来处理fdc_pm_managementsec表的常用操作
   public SimpleClient<usersinroles> usersinrolesDb { get { return Db.GetSimpleClient<usersinroles>(); } }//用来处理usersinroles表的常用操作
   public SimpleClient<fdc_pm_revfare_income> fdc_pm_revfare_incomeDb { get { return Db.GetSimpleClient<fdc_pm_revfare_income>(); } }//用来处理fdc_pm_revfare_income表的常用操作
   public SimpleClient<license> licenseDb { get { return Db.GetSimpleClient<license>(); } }//用来处理license表的常用操作
   public SimpleClient<fdc_pm_userinmanagementsec> fdc_pm_userinmanagementsecDb { get { return Db.GetSimpleClient<fdc_pm_userinmanagementsec>(); } }//用来处理fdc_pm_userinmanagementsec表的常用操作
   public SimpleClient<areaInfo> areaInfoDb { get { return Db.GetSimpleClient<areaInfo>(); } }//用来处理areaInfo表的常用操作
   public SimpleClient<fdc_crm_customer_set> fdc_crm_customer_setDb { get { return Db.GetSimpleClient<fdc_crm_customer_set>(); } }//用来处理fdc_crm_customer_set表的常用操作
   public SimpleClient<maxbillcode> maxbillcodeDb { get { return Db.GetSimpleClient<maxbillcode>(); } }//用来处理maxbillcode表的常用操作
   public SimpleClient<fdc_pm_rentin_house> fdc_pm_rentin_houseDb { get { return Db.GetSimpleClient<fdc_pm_rentin_house>(); } }//用来处理fdc_pm_rentin_house表的常用操作
   public SimpleClient<fdc_pm_renovaterecord_ck> fdc_pm_renovaterecord_ckDb { get { return Db.GetSimpleClient<fdc_pm_renovaterecord_ck>(); } }//用来处理fdc_pm_renovaterecord_ck表的常用操作
   public SimpleClient<fdc_pm_billsitemstand> fdc_pm_billsitemstandDb { get { return Db.GetSimpleClient<fdc_pm_billsitemstand>(); } }//用来处理fdc_pm_billsitemstand表的常用操作
   public SimpleClient<vouchernumber> vouchernumberDb { get { return Db.GetSimpleClient<vouchernumber>(); } }//用来处理vouchernumber表的常用操作
   public SimpleClient<itemDictionarytype> itemDictionarytypeDb { get { return Db.GetSimpleClient<itemDictionarytype>(); } }//用来处理itemDictionarytype表的常用操作
   public SimpleClient<itemdictionary> itemdictionaryDb { get { return Db.GetSimpleClient<itemdictionary>(); } }//用来处理itemdictionary表的常用操作
   public SimpleClient<fdc_pm_ownerhouse> fdc_pm_ownerhouseDb { get { return Db.GetSimpleClient<fdc_pm_ownerhouse>(); } }//用来处理fdc_pm_ownerhouse表的常用操作
   public SimpleClient<fdc_pm_debitnote> fdc_pm_debitnoteDb { get { return Db.GetSimpleClient<fdc_pm_debitnote>(); } }//用来处理fdc_pm_debitnote表的常用操作
   public SimpleClient<fdc_pm_fare_b> fdc_pm_fare_bDb { get { return Db.GetSimpleClient<fdc_pm_fare_b>(); } }//用来处理fdc_pm_fare_b表的常用操作
   public SimpleClient<fdc_pm_rentin> fdc_pm_rentinDb { get { return Db.GetSimpleClient<fdc_pm_rentin>(); } }//用来处理fdc_pm_rentin表的常用操作
   public SimpleClient<message> messageDb { get { return Db.GetSimpleClient<message>(); } }//用来处理message表的常用操作
   public SimpleClient<fdc_pm_operstate> fdc_pm_operstateDb { get { return Db.GetSimpleClient<fdc_pm_operstate>(); } }//用来处理fdc_pm_operstate表的常用操作
   public SimpleClient<fdc_pm_metertype> fdc_pm_metertypeDb { get { return Db.GetSimpleClient<fdc_pm_metertype>(); } }//用来处理fdc_pm_metertype表的常用操作
   public SimpleClient<fdc_pm_rentout> fdc_pm_rentoutDb { get { return Db.GetSimpleClient<fdc_pm_rentout>(); } }//用来处理fdc_pm_rentout表的常用操作
   public SimpleClient<actions> actionsDb { get { return Db.GetSimpleClient<actions>(); } }//用来处理actions表的常用操作
   public SimpleClient<usersinfuncs> usersinfuncsDb { get { return Db.GetSimpleClient<usersinfuncs>(); } }//用来处理usersinfuncs表的常用操作
   public SimpleClient<fdc_pm_rentcontract_fare> fdc_pm_rentcontract_fareDb { get { return Db.GetSimpleClient<fdc_pm_rentcontract_fare>(); } }//用来处理fdc_pm_rentcontract_fare表的常用操作
   public SimpleClient<fdc_pm_owner> fdc_pm_ownerDb { get { return Db.GetSimpleClient<fdc_pm_owner>(); } }//用来处理fdc_pm_owner表的常用操作
   public SimpleClient<warehouse> warehouseDb { get { return Db.GetSimpleClient<warehouse>(); } }//用来处理warehouse表的常用操作
   public SimpleClient<fdc_pm_billitemaccount> fdc_pm_billitemaccountDb { get { return Db.GetSimpleClient<fdc_pm_billitemaccount>(); } }//用来处理fdc_pm_billitemaccount表的常用操作
   public SimpleClient<fdc_pm_occupationbill_i> fdc_pm_occupationbill_iDb { get { return Db.GetSimpleClient<fdc_pm_occupationbill_i>(); } }//用来处理fdc_pm_occupationbill_i表的常用操作
   public SimpleClient<fdc_pm_countfare> fdc_pm_countfareDb { get { return Db.GetSimpleClient<fdc_pm_countfare>(); } }//用来处理fdc_pm_countfare表的常用操作
   public SimpleClient<usersindepts> usersindeptsDb { get { return Db.GetSimpleClient<usersindepts>(); } }//用来处理usersindepts表的常用操作
   public SimpleClient<customerclass> customerclassDb { get { return Db.GetSimpleClient<customerclass>(); } }//用来处理customerclass表的常用操作
   public SimpleClient<fdc_pm_housemeter> fdc_pm_housemeterDb { get { return Db.GetSimpleClient<fdc_pm_housemeter>(); } }//用来处理fdc_pm_housemeter表的常用操作
   public SimpleClient<users> usersDb { get { return Db.GetSimpleClient<users>(); } }//用来处理users表的常用操作
   public SimpleClient<depts> deptsDb { get { return Db.GetSimpleClient<depts>(); } }//用来处理depts表的常用操作
   public SimpleClient<fdc_pm_device_repair_b> fdc_pm_device_repair_bDb { get { return Db.GetSimpleClient<fdc_pm_device_repair_b>(); } }//用来处理fdc_pm_device_repair_b表的常用操作
   public SimpleClient<fdc_pm_rentcontract_stand> fdc_pm_rentcontract_standDb { get { return Db.GetSimpleClient<fdc_pm_rentcontract_stand>(); } }//用来处理fdc_pm_rentcontract_stand表的常用操作
   public SimpleClient<fdc_pm_countfare_house> fdc_pm_countfare_houseDb { get { return Db.GetSimpleClient<fdc_pm_countfare_house>(); } }//用来处理fdc_pm_countfare_house表的常用操作
   public SimpleClient<fdc_pm_revfare> fdc_pm_revfareDb { get { return Db.GetSimpleClient<fdc_pm_revfare>(); } }//用来处理fdc_pm_revfare表的常用操作
   public SimpleClient<fdc_pm_repairtype> fdc_pm_repairtypeDb { get { return Db.GetSimpleClient<fdc_pm_repairtype>(); } }//用来处理fdc_pm_repairtype表的常用操作
   public SimpleClient<fdc_pm_revfare_b> fdc_pm_revfare_bDb { get { return Db.GetSimpleClient<fdc_pm_revfare_b>(); } }//用来处理fdc_pm_revfare_b表的常用操作
   public SimpleClient<fdc_pm_fare> fdc_pm_fareDb { get { return Db.GetSimpleClient<fdc_pm_fare>(); } }//用来处理fdc_pm_fare表的常用操作
   public SimpleClient<vendor> vendorDb { get { return Db.GetSimpleClient<vendor>(); } }//用来处理vendor表的常用操作
   public SimpleClient<fdc_pm_rentin_goods> fdc_pm_rentin_goodsDb { get { return Db.GetSimpleClient<fdc_pm_rentin_goods>(); } }//用来处理fdc_pm_rentin_goods表的常用操作
   public SimpleClient<fdc_pm_repairapply> fdc_pm_repairapplyDb { get { return Db.GetSimpleClient<fdc_pm_repairapply>(); } }//用来处理fdc_pm_repairapply表的常用操作
   public SimpleClient<fdc_pm_rentin_check> fdc_pm_rentin_checkDb { get { return Db.GetSimpleClient<fdc_pm_rentin_check>(); } }//用来处理fdc_pm_rentin_check表的常用操作
   public SimpleClient<rdrecords> rdrecordsDb { get { return Db.GetSimpleClient<rdrecords>(); } }//用来处理rdrecords表的常用操作
   public SimpleClient<fdc_pm_devicemainplanem> fdc_pm_devicemainplanemDb { get { return Db.GetSimpleClient<fdc_pm_devicemainplanem>(); } }//用来处理fdc_pm_devicemainplanem表的常用操作
   public SimpleClient<fa_alter> fa_alterDb { get { return Db.GetSimpleClient<fa_alter>(); } }//用来处理fa_alter表的常用操作
   public SimpleClient<fdc_pm_devicemainplanem_b> fdc_pm_devicemainplanem_bDb { get { return Db.GetSimpleClient<fdc_pm_devicemainplanem_b>(); } }//用来处理fdc_pm_devicemainplanem_b表的常用操作
   public SimpleClient<fa_alter_b> fa_alter_bDb { get { return Db.GetSimpleClient<fa_alter_b>(); } }//用来处理fa_alter_b表的常用操作
   public SimpleClient<fdc_pm_meterrecord_b> fdc_pm_meterrecord_bDb { get { return Db.GetSimpleClient<fdc_pm_meterrecord_b>(); } }//用来处理fdc_pm_meterrecord_b表的常用操作
   public SimpleClient<fdc_pm_rentout_retgoods> fdc_pm_rentout_retgoodsDb { get { return Db.GetSimpleClient<fdc_pm_rentout_retgoods>(); } }//用来处理fdc_pm_rentout_retgoods表的常用操作
   public SimpleClient<fdc_pm_devicemainplaney> fdc_pm_devicemainplaneyDb { get { return Db.GetSimpleClient<fdc_pm_devicemainplaney>(); } }//用来处理fdc_pm_devicemainplaney表的常用操作
   public SimpleClient<fa_assettype> fa_assettypeDb { get { return Db.GetSimpleClient<fa_assettype>(); } }//用来处理fa_assettype表的常用操作
   public SimpleClient<fdc_pm_devicemainplaney_b> fdc_pm_devicemainplaney_bDb { get { return Db.GetSimpleClient<fdc_pm_devicemainplaney_b>(); } }//用来处理fdc_pm_devicemainplaney_b表的常用操作
   public SimpleClient<fa_cards> fa_cardsDb { get { return Db.GetSimpleClient<fa_cards>(); } }//用来处理fa_cards表的常用操作
   public SimpleClient<fdc_pm_owneritem> fdc_pm_owneritemDb { get { return Db.GetSimpleClient<fdc_pm_owneritem>(); } }//用来处理fdc_pm_owneritem表的常用操作
   public SimpleClient<fdc_pm_paybill> fdc_pm_paybillDb { get { return Db.GetSimpleClient<fdc_pm_paybill>(); } }//用来处理fdc_pm_paybill表的常用操作
   public SimpleClient<fdc_pm_receiadjust> fdc_pm_receiadjustDb { get { return Db.GetSimpleClient<fdc_pm_receiadjust>(); } }//用来处理fdc_pm_receiadjust表的常用操作
   public SimpleClient<customer> customerDb { get { return Db.GetSimpleClient<customer>(); } }//用来处理customer表的常用操作
   public SimpleClient<fa_origins> fa_originsDb { get { return Db.GetSimpleClient<fa_origins>(); } }//用来处理fa_origins表的常用操作
   public SimpleClient<rdrecord> rdrecordDb { get { return Db.GetSimpleClient<rdrecord>(); } }//用来处理rdrecord表的常用操作
   public SimpleClient<fa_position> fa_positionDb { get { return Db.GetSimpleClient<fa_position>(); } }//用来处理fa_position表的常用操作
   public SimpleClient<fdc_pm_renovateitem> fdc_pm_renovateitemDb { get { return Db.GetSimpleClient<fdc_pm_renovateitem>(); } }//用来处理fdc_pm_renovateitem表的常用操作
   public SimpleClient<fa_redeploy> fa_redeployDb { get { return Db.GetSimpleClient<fa_redeploy>(); } }//用来处理fa_redeploy表的常用操作
   public SimpleClient<fdc_pm_vehicle> fdc_pm_vehicleDb { get { return Db.GetSimpleClient<fdc_pm_vehicle>(); } }//用来处理fdc_pm_vehicle表的常用操作
   public SimpleClient<fdc_pm_revfare_b_del> fdc_pm_revfare_b_delDb { get { return Db.GetSimpleClient<fdc_pm_revfare_b_del>(); } }//用来处理fdc_pm_revfare_b_del表的常用操作
   public SimpleClient<fa_redeploy_b> fa_redeploy_bDb { get { return Db.GetSimpleClient<fa_redeploy_b>(); } }//用来处理fa_redeploy_b表的常用操作
   public SimpleClient<vendorclass> vendorclassDb { get { return Db.GetSimpleClient<vendorclass>(); } }//用来处理vendorclass表的常用操作
   public SimpleClient<fa_status> fa_statusDb { get { return Db.GetSimpleClient<fa_status>(); } }//用来处理fa_status表的常用操作
   public SimpleClient<fdc_pm_note> fdc_pm_noteDb { get { return Db.GetSimpleClient<fdc_pm_note>(); } }//用来处理fdc_pm_note表的常用操作
   public SimpleClient<fdc_pm_adjust> fdc_pm_adjustDb { get { return Db.GetSimpleClient<fdc_pm_adjust>(); } }//用来处理fdc_pm_adjust表的常用操作
   public SimpleClient<fdc_pm_rentcontract> fdc_pm_rentcontractDb { get { return Db.GetSimpleClient<fdc_pm_rentcontract>(); } }//用来处理fdc_pm_rentcontract表的常用操作
   public SimpleClient<dtproperties> dtpropertiesDb { get { return Db.GetSimpleClient<dtproperties>(); } }//用来处理dtproperties表的常用操作
   public SimpleClient<inventoryclass> inventoryclassDb { get { return Db.GetSimpleClient<inventoryclass>(); } }//用来处理inventoryclass表的常用操作
   public SimpleClient<fdc_pm_devicemain_b> fdc_pm_devicemain_bDb { get { return Db.GetSimpleClient<fdc_pm_devicemain_b>(); } }//用来处理fdc_pm_devicemain_b表的常用操作
   public SimpleClient<fdc_pm_rentout_rethouse> fdc_pm_rentout_rethouseDb { get { return Db.GetSimpleClient<fdc_pm_rentout_rethouse>(); } }//用来处理fdc_pm_rentout_rethouse表的常用操作
   public SimpleClient<fdc_pm_rentout_retcheck> fdc_pm_rentout_retcheckDb { get { return Db.GetSimpleClient<fdc_pm_rentout_retcheck>(); } }//用来处理fdc_pm_rentout_retcheck表的常用操作
   public SimpleClient<fdc_pm_parkcontract_b> fdc_pm_parkcontract_bDb { get { return Db.GetSimpleClient<fdc_pm_parkcontract_b>(); } }//用来处理fdc_pm_parkcontract_b表的常用操作
   public SimpleClient<computationunit> computationunitDb { get { return Db.GetSimpleClient<computationunit>(); } }//用来处理computationunit表的常用操作
   public SimpleClient<printfile> printfileDb { get { return Db.GetSimpleClient<printfile>(); } }//用来处理printfile表的常用操作
   public SimpleClient<fdc_pm_direction> fdc_pm_directionDb { get { return Db.GetSimpleClient<fdc_pm_direction>(); } }//用来处理fdc_pm_direction表的常用操作
   public SimpleClient<fdc_pm_devicemain> fdc_pm_devicemainDb { get { return Db.GetSimpleClient<fdc_pm_devicemain>(); } }//用来处理fdc_pm_devicemain表的常用操作
   public SimpleClient<SetletypeManagement> SetletypeManagementDb { get { return Db.GetSimpleClient<SetletypeManagement>(); } }//用来处理SetletypeManagement表的常用操作
   public SimpleClient<usersinprint> usersinprintDb { get { return Db.GetSimpleClient<usersinprint>(); } }//用来处理usersinprint表的常用操作
   public SimpleClient<MangmengBillsitem> MangmengBillsitemDb { get { return Db.GetSimpleClient<MangmengBillsitem>(); } }//用来处理MangmengBillsitem表的常用操作
   public SimpleClient<ContractStandard> ContractStandardDb { get { return Db.GetSimpleClient<ContractStandard>(); } }//用来处理ContractStandard表的常用操作
   public SimpleClient<fdc_pm_billsitemstand_stage> fdc_pm_billsitemstand_stageDb { get { return Db.GetSimpleClient<fdc_pm_billsitemstand_stage>(); } }//用来处理fdc_pm_billsitemstand_stage表的常用操作
   public SimpleClient<fdc_pm_house> fdc_pm_houseDb { get { return Db.GetSimpleClient<fdc_pm_house>(); } }//用来处理fdc_pm_house表的常用操作
   public SimpleClient<msgtype> msgtypeDb { get { return Db.GetSimpleClient<msgtype>(); } }//用来处理msgtype表的常用操作
   public SimpleClient<code> codeDb { get { return Db.GetSimpleClient<code>(); } }//用来处理code表的常用操作
   public SimpleClient<usersinmsgtype> usersinmsgtypeDb { get { return Db.GetSimpleClient<usersinmsgtype>(); } }//用来处理usersinmsgtype表的常用操作
   public SimpleClient<fdc_pm_meterrecord_total> fdc_pm_meterrecord_totalDb { get { return Db.GetSimpleClient<fdc_pm_meterrecord_total>(); } }//用来处理fdc_pm_meterrecord_total表的常用操作
   public SimpleClient<fdc_pm_appealrecord_b> fdc_pm_appealrecord_bDb { get { return Db.GetSimpleClient<fdc_pm_appealrecord_b>(); } }//用来处理fdc_pm_appealrecord_b表的常用操作
   public SimpleClient<fdc_pm_revfare_del> fdc_pm_revfare_delDb { get { return Db.GetSimpleClient<fdc_pm_revfare_del>(); } }//用来处理fdc_pm_revfare_del表的常用操作
   public SimpleClient<fdc_pm_occupationbill> fdc_pm_occupationbillDb { get { return Db.GetSimpleClient<fdc_pm_occupationbill>(); } }//用来处理fdc_pm_occupationbill表的常用操作
   public SimpleClient<currentstock> currentstockDb { get { return Db.GetSimpleClient<currentstock>(); } }//用来处理currentstock表的常用操作
   public SimpleClient<funcs> funcsDb { get { return Db.GetSimpleClient<funcs>(); } }//用来处理funcs表的常用操作
   public SimpleClient<fdc_pm_voucher_b> fdc_pm_voucher_bDb { get { return Db.GetSimpleClient<fdc_pm_voucher_b>(); } }//用来处理fdc_pm_voucher_b表的常用操作
   public SimpleClient<fdc_pm_appealtype> fdc_pm_appealtypeDb { get { return Db.GetSimpleClient<fdc_pm_appealtype>(); } }//用来处理fdc_pm_appealtype表的常用操作
   public SimpleClient<fdc_pm_adjust_b> fdc_pm_adjust_bDb { get { return Db.GetSimpleClient<fdc_pm_adjust_b>(); } }//用来处理fdc_pm_adjust_b表的常用操作
   public SimpleClient<fdc_pm_zsystemurl> fdc_pm_zsystemurlDb { get { return Db.GetSimpleClient<fdc_pm_zsystemurl>(); } }//用来处理fdc_pm_zsystemurl表的常用操作
   public SimpleClient<fdc_pm_rentcontent> fdc_pm_rentcontentDb { get { return Db.GetSimpleClient<fdc_pm_rentcontent>(); } }//用来处理fdc_pm_rentcontent表的常用操作
   public SimpleClient<fdc_pm_model> fdc_pm_modelDb { get { return Db.GetSimpleClient<fdc_pm_model>(); } }//用来处理fdc_pm_model表的常用操作
   public SimpleClient<fdc_pm_build> fdc_pm_buildDb { get { return Db.GetSimpleClient<fdc_pm_build>(); } }//用来处理fdc_pm_build表的常用操作
   public SimpleClient<updatemsg> updatemsgDb { get { return Db.GetSimpleClient<updatemsg>(); } }//用来处理updatemsg表的常用操作
   public SimpleClient<fdc_sa_paymodel> fdc_sa_paymodelDb { get { return Db.GetSimpleClient<fdc_sa_paymodel>(); } }//用来处理fdc_sa_paymodel表的常用操作
   public SimpleClient<fdc_pm_ownersalesman> fdc_pm_ownersalesmanDb { get { return Db.GetSimpleClient<fdc_pm_ownersalesman>(); } }//用来处理fdc_pm_ownersalesman表的常用操作
   public SimpleClient<fdc_pm_fare_del> fdc_pm_fare_delDb { get { return Db.GetSimpleClient<fdc_pm_fare_del>(); } }//用来处理fdc_pm_fare_del表的常用操作
   public SimpleClient<fdc_pm_securityevent> fdc_pm_securityeventDb { get { return Db.GetSimpleClient<fdc_pm_securityevent>(); } }//用来处理fdc_pm_securityevent表的常用操作
   public SimpleClient<fdc_pm_receiadjust_b> fdc_pm_receiadjust_bDb { get { return Db.GetSimpleClient<fdc_pm_receiadjust_b>(); } }//用来处理fdc_pm_receiadjust_b表的常用操作
   public SimpleClient<fdc_pm_fare_b_del> fdc_pm_fare_b_delDb { get { return Db.GetSimpleClient<fdc_pm_fare_b_del>(); } }//用来处理fdc_pm_fare_b_del表的常用操作
   public SimpleClient<fdc_pm_vowner> fdc_pm_vownerDb { get { return Db.GetSimpleClient<fdc_pm_vowner>(); } }//用来处理fdc_pm_vowner表的常用操作


   /// <summary>
    /// 获取所有
    /// </summary>
    /// <returns></returns>
    public virtual List<T> GetList()
    {
        return CurrentDb.GetList();
    }

    /// <summary>
    /// 根据表达式查询
    /// </summary>
    /// <returns></returns>
    public virtual List<T> GetList(Expression<Func<T, bool>> whereExpression)
    {
        return CurrentDb.GetList(whereExpression);
    }


    /// <summary>
    /// 根据表达式查询分页
    /// </summary>
    /// <returns></returns>
    public virtual List<T> GetPageList(Expression<Func<T, bool>> whereExpression, PageModel pageModel)
    {
        return CurrentDb.GetPageList(whereExpression, pageModel);
    }

    /// <summary>
    /// 根据表达式查询分页并排序
    /// </summary>
    /// <param name="whereExpression">it</param>
    /// <param name="pageModel"></param>
    /// <param name="orderByExpression">it=>it.id或者it=>new{it.id,it.name}</param>
    /// <param name="orderByType">OrderByType.Desc</param>
    /// <returns></returns>
    public virtual List<T> GetPageList(Expression<Func<T, bool>> whereExpression, PageModel pageModel, Expression<Func<T, object>> orderByExpression = null, OrderByType orderByType = OrderByType.Asc)
    {
        return CurrentDb.GetPageList(whereExpression, pageModel,orderByExpression,orderByType);
    }


    /// <summary>
    /// 根据主键查询
    /// </summary>
    /// <returns></returns>
    public virtual T GetById(dynamic id)
    {
        return CurrentDb.GetById(id);
    }

    /// <summary>
    /// 根据主键删除
    /// </summary>
    /// <param name="id"></param>
    /// <returns></returns>
    public virtual bool Delete(dynamic id)
    {
        return CurrentDb.Delete(id);
    }


    /// <summary>
    /// 根据实体删除
    /// </summary>
    /// <param name="id"></param>
    /// <returns></returns>
    public virtual bool Delete(T data)
    {
        return CurrentDb.Delete(data);
    }

    /// <summary>
    /// 根据主键删除
    /// </summary>
    /// <param name="id"></param>
    /// <returns></returns>
    public virtual bool Delete(dynamic[] ids)
    {
        return CurrentDb.AsDeleteable().In(ids).ExecuteCommand()>0;
    }

    /// <summary>
    /// 根据表达式删除
    /// </summary>
    /// <param name="id"></param>
    /// <returns></returns>
    public virtual bool Delete(Expression<Func<T, bool>> whereExpression)
    {
        return CurrentDb.Delete(whereExpression);
    }


    /// <summary>
    /// 根据实体更新，实体需要有主键
    /// </summary>
    /// <param name="id"></param>
    /// <returns></returns>
    public virtual bool Update(T obj)
    {
        return CurrentDb.Update(obj);
    }

    /// <summary>
    ///批量更新
    /// </summary>
    /// <param name="id"></param>
    /// <returns></returns>
    public virtual bool Update(List<T> objs)
    {
        return CurrentDb.UpdateRange(objs);
    }

    /// <summary>
    /// 插入
    /// </summary>
    /// <param name="id"></param>
    /// <returns></returns>
    public virtual bool Insert(T obj)
    {
        return CurrentDb.Insert(obj);
    }


    /// <summary>
    /// 批量
    /// </summary>
    /// <param name="id"></param>
    /// <returns></returns>
    public virtual bool Insert(List<T> objs)
    {
        return CurrentDb.InsertRange(objs);
    }


    //自已扩展更多方法
}
