using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace JwKdsV.Core { public class SqlConstant { /// /// 获取指定key设置 /// public const string ConfigQueryByKey = "select [id],[tenantId],[group],[name],[keys],[values],[createUser],[createDate], [modifyDate], [modifyUser] from [pos_config] where [keys] = '{0}';"; /// /// 获取指定key设置 /// public const string ConfigQueryByGroupAndKey = "select [id],[tenantId],[group],[name],[keys],[values],[createUser],[createDate], [modifyDate], [modifyUser] from [pos_config] where [group] = '{0}' and [keys] = '{1}';"; /// /// 获取参数组 /// public const string ConfigQueryByGroups = "select [id],[tenantId],[group],[name],[keys],[values],[createUser],[createDate], [modifyDate], [modifyUser] from [pos_config] where [group] in ({0});"; /// /// 获取全部系统参数 /// public const string ConfigQueryAllToDictionary = "select [keys],[values] from [pos_config];"; /// /// 按指定Group获取系统参数 /// public const string ConfigQueryByGroupToDictionary = "select [keys],[values] from [pos_config] where [group] = '{0}';"; /// /// 更新或者插入配置参数信息 /// public const string ConfigSaveOrUpdate = "replace into [pos_config]([id],[tenantId],[group],[name],[keys],[values],[createUser],[createDate], [modifyUser], [modifyDate]) values ('{0}','{1}','{2}','{3}','{4}','{5}','{6}','{7}','{8}','{9}');"; /// /// 获取posversion /// public const string PosVersionQuery = "SELECT [id], [version], [dbVersion], [createDate], [createUser], [modifyDate], [modifyUser] FROM [pos_version];"; /// /// 系统全部模块查询 /// public const string ModuleQueryAll = "select [id], [tenantId], [area], [parentId], [name], [alias], [keycode], [keydata], [color1], [color2],[color3],[fontSize], [shortcut], [orderNo], [icon], [enable], [resourceId], [width], [height], [createUser], [createDate], [modifyUser], [modifyDate] from [pos_module];"; //, [width], [height] /// /// 查询全部功能资源 /// public const string ResourcesQueryAll = "select [id], [tenantId], [group], [name], [keycode], [keydata], [enable], [createUser], [createDate], [modifyUser], [modifyDate] from [pos_resources];"; /// /// 根据keycode查询资源 /// public const string ResourcesQueryByKeycode = "select [id], [tenantId], [group], [name], [keycode], [keydata], [enable],[createUser], [createDate], [modifyUser], [modifyDate] from [pos_resources] where [keycode] = '{0}';"; /// /// 获取全部小类 /// public const string QueryAllDishType = "SELECT [id], [no], [name], [seriesId], [color], [createUser], [createDate], [modifyUser], [modifyDate] FROM [food_dish_type];"; /// /// 获取全部大类 /// public const string QueryAllDishSeries = "SELECT [id], [no], [name], [createUser], [createDate], [modifyUser], [modifyDate] FROM [food_dish_series]; "; #region V2 /// /// 查询全部API接口 /// public const string ApisQueryAll = "SELECT id, tenantId, apiType, appKey, appSecret, locale, format, client, version, routing, memo, ext1, ext2, ext3, createUser, createDate, modifyUser, modifyDate FROM pos_apis;"; /// /// 查询API对应的URL数据 /// public const string UrlsQueryAll = "SELECT id, tenantId, apiType, protocol, url, contextPath, userDefined, enable, memo, ext1, ext2, ext3, createUser, createDate, modifyUser, modifyDate FROM pos_urls;"; #endregion /// /// 查询所有商品 /// public const string ProductExtAll = @"select p.[id],p.[tenantId],p.[brandId],p.[typeId],p.[typePath],p.[no],p.[name],p.[shortName],p.[spell],p.[assistNo],p.[otherNo],p.[barCode],p.[english],p.[unitId],p.[memo],p.[commissionType],p.[commissionValue],p.[discountFlag],p.[suitFlag],p.[tapleFlag],p.[weighFlag],p.[currentFlag],p.[labelPrintFlag],p.[stopFlag],p.[groupName],p.[picture],p.[mebDiscountFlag],p.[giveFlag],p.[promotionFlag],p.[type],p.[stockFlag],p.[pointType],p.[pointValue],p.[purchaseTax],p.[saleTax],p.[lyRate],p.[specCount],p.[ext1],p.[ext3],p.[ext2],p.[createUser],p.[createDate],p.[modifyUser],p.[modifyDate],t.name as typeName,u.name as unitName,s.name as specName,s.id as specId,s.[price],s.[memberPrice],s.[otherPrice],s.[costPrice],s.[purchasePrice],s.[dispatchPrice],s.[minPrice], p.[kdsFlag] from pos_product p left join pos_product_unit u on p.unitId = u.id left join pos_product_type t on p.typeId = t.id left join ( select sp.* , sps.* from (select productId, min(no) as minNo from pos_product_spec where deleteFlag = 0 group by productId) sps left join pos_product_spec sp on(sps.productId = sp.productId and sp.no = sps.minNo) where sp.deleteFlag = 0 ) s on s.productId = p.id WHERE p.`type` >= 0 AND p.`type` <= 9 AND p.`stopFlag` = 0 and s.id is not null "; public const string ProductExtAll2 = @"select p.[id],p.[tenantId],p.[brandId],p.[typeId],p.[typePath],p.[no],p.[name],p.[shortName],p.[spell],p.[assistNo],p.[otherNo],p.[barCode],p.[english],p.[unitId],p.[memo],p.[commissionType],p.[commissionValue],p.[discountFlag],p.[suitFlag],p.[tapleFlag],p.[weighFlag],p.[currentFlag],p.[labelPrintFlag],p.[stopFlag],p.[groupName],p.[picture],p.[mebDiscountFlag],p.[giveFlag],p.[promotionFlag],p.[type],p.[stockFlag],p.[pointType],p.[pointValue],p.[purchaseTax],p.[saleTax],p.[lyRate],p.[specCount],p.[ext1],p.[ext3],p.[ext2],p.[createUser],p.[createDate],p.[modifyUser],p.[modifyDate],t.name as typeName,u.name as unitName,s.name as specName,s.id as specId ,k.chuda,k.chudaFlag,k.chupin,k.chupinFlag ,k.[labelFlag] as chuDaLabelFlag, k.[labelValue] as chuDaLabel,s.[price],s.[memberPrice],s.[otherPrice],s.[costPrice],s.[purchasePrice],s.[dispatchPrice],s.[minPrice],d.[chuxian],d.[chuxianFlag],d.[chuxianTime],d.[chupin] as kdsChupin,d.[chupinFlag] as kdsChupinFlag,d.[chupinTime] as kdsChupinTime, p.[kdsFlag] from pos_product p left join pos_product_unit u on p.unitId = u.id left join pos_product_type t on p.typeId = t.id left join pos_kit_product k on p.id = k.productId left join pos_kds_product d on p.id = d.productId left join ( select sp.* , sps.* from (select productId, min(no) as minNo from pos_product_spec where deleteFlag = 0 group by productId) sps left join pos_product_spec sp on(sps.productId = sp.productId and sp.no = sps.minNo) where sp.deleteFlag = 0 ) s on s.productId = p.id WHERE p.`type` >= 0 AND p.`type` <= 9 AND p.`stopFlag` = 0 and s.id is not null "; } }