当前位置: 首页 > news >正文

c# 动态lambda实现二级过滤(多种参数类型)

效果

调用方法

实体类(可以根据需求更换)

public class ToolStr50
{public bool isSelected { get; set; }public string toolStr1 { get; set; }public string toolStr2 { get; set; }public string toolStr3 { get; set; }public string toolStr4 { get; set; }public string toolStr5 { get; set; }public string toolStr6 { get; set; }public string toolStr7 { get; set; }public string toolStr8 { get; set; }public string toolStr9 { get; set; }public string toolStr10 { get; set; }public int toolInt1 { get; set; }public int toolInt2 { get; set; }public int toolInt3 { get; set; }public int toolInt4 { get; set; }public int toolInt5 { get; set; }public int toolInt6 { get; set; }public int toolInt7 { get; set; }public int toolInt8 { get; set; }public int toolInt9 { get; set; }public int toolInt10 { get; set; }public double toolDouble1 { get; set; }public double toolDouble2 { get; set; }public double toolDouble3 { get; set; }public double toolDouble4 { get; set; }public double toolDouble5 { get; set; }public double toolDouble6 { get; set; }public double toolDouble7 { get; set; }public double toolDouble8 { get; set; }public double toolDouble9 { get; set; }public double toolDouble10 { get; set; }public DateTime toolDate1 { get; set; }public DateTime toolDate2 { get; set; }public DateTime toolDate3 { get; set; }public DateTime toolDate4 { get; set; }public DateTime toolDate5 { get; set; }public DateTime toolDate6 { get; set; }public DateTime toolDate7 { get; set; }public DateTime toolDate8 { get; set; }public DateTime toolDate9 { get; set; }public DateTime toolDate10 { get; set; }
}

传入需要二级过滤的数据

 public void ShowSecondaryFiltration(){var columnMappings = new Dictionary<string, string>{{ "采购日期", "toolStr26" },{ "采购周期", "toolInt10" },{ "采购回复交期", "toolStr31" },{ "采购说明", "toolStr53" },{ "生产订单号", "toolStr1" },{ "来源单号", "toolStr2" },{ "采购订单号", "toolStr3" },{ "行号", "toolInt1" },{ "料号", "toolStr4" },{ "品名", "toolStr5" },{ "规格描述", "toolStr6" },{ "现存量", "toolInt2" },{ "单位", "toolStr11" },{ "采购数量(计量)", "toolInt3" },{ "收货数量(计量)", "toolInt4" },{ "已退货数(计量)", "toolInt5" },{ "实际入库数(计量)", "toolInt6" },{ "入库单号", "toolStr16" },{ "已暂收数量(计量)", "toolInt7" },{ "最后交货日期", "toolStr18" },{ "逾期天数(负数未到期)", "toolInt8" },{ "品质异常报告日期", "toolStr19" },{ "品质问题描述", "toolStr20" },{ "处理结论", "toolStr21" },{ "未交数量(计量)", "toolInt9" },{ "交货结案日期", "toolStr23" },{ "请购日期", "toolStr24" },{ "PMC交单日期", "toolStr25" },{ "理论交期", "toolStr28" },{ "要求交期", "toolStr29" },{ "订单回传日期", "toolStr30" },{ "色板_模板_图纸提供情况", "toolStr32" },{ "异常反馈", "toolStr33" },{ "预付款比例", "toolInt11" },{ "预付款支付日期", "toolStr35" },{ "尾款比例", "toolInt12" },{ "尾款支付日期", "toolStr39" },{ "采购员", "toolStr44" },{ "请购制单人", "toolStr40" },{ "供应商名称", "toolStr46" },{ "请购单备注", "toolStr42" },{ "采购单备注", "toolStr45" },{ "可用量", "toolStr8" },{ "含税单价", "toolDouble1" },{ "含税金额", "toolDouble2" },{ "采购到货日期", "toolStr37" },{ "财务交单日期", "toolStr38" },{ "请购人", "toolStr41" },{ "采购制单人", "toolStr43" },{ "采购订单结案状态", "toolStr48" },{ "修改日期_请购", "toolStr50" },{ "修改日期_采购", "toolStr51" },{ "PMC要求交货日期", "toolStr52" }};var traceWindow = new TraceTableSecondaryFiltration(columnMappings, OdlIbo);traceWindow.QueryConditions = _queryConditions;if (traceWindow.ShowDialog() == true) // 检查对话框的结果{var filteredIbo = traceWindow.FilteredData;_queryConditions = traceWindow.QueryConditions;Ibo = filteredIbo;// 使用 filteredIbo 进行后续处理}if (_queryConditions.Count == 0){SelectInfo();}//更新总条数和总金额InfoCount = "数据汇总:" + Ibo.Count.ToString() + "条";decimal total = Ibo.Sum(x => Convert.ToDecimal(x.toolStr10)); // 假设 TaxInclusiveSum 是 double 类型  total = decimal.Round(total, 4);//TaxinclusiveSum = "合计含税金额:" + total.ToString();}

窗体页面TraceTableSecondaryFiltration.xaml

<Window x:Class="GMWPF.Views.ModuleMenu.Purchase.PurchaseModle1.ChildWindow.TraceTableSecondaryFiltration"xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"xmlns:d="http://schemas.microsoft.com/expression/blend/2008"xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"xmlns:local="clr-namespace:GMWPF.Views.ModuleMenu.Purchase.PurchaseModle1.ChildWindow"mc:Ignorable="d"Title="TraceTableSecondaryFiltration" Height="450" Width="800"WindowStartupLocation="CenterScreen"><Grid Margin="10" Name="myDynamicGrid"><Grid.RowDefinitions><RowDefinition Height="Auto"/><RowDefinition Height="Auto"/><RowDefinition Height="Auto"/><RowDefinition Height="Auto"/><RowDefinition Height="Auto"/><RowDefinition Height="*"/><!-- 让表格占用剩余空间 --></Grid.RowDefinitions><TextBlock Text="字段名称" Margin="49,34,655,0" VerticalAlignment="Top" Grid.Row="0"/><ComboBox Name="FieldNameComboBox" Margin="25,5,640,0" VerticalAlignment="Top" ItemsSource="{Binding FieldNames}" SelectedItem="{Binding SelectedFieldName, Mode=TwoWay}" SelectionChanged="FieldNameComboBox_SelectionChanged"Grid.Row="1"/><TextBlock Text="条件" Margin="227,34,495,0" VerticalAlignment="Top" Grid.Row="0"/><ComboBox Name="ConditionComboBox" Margin="184,5,471,0" VerticalAlignment="Top" ItemsSource="{Binding Conditions}" SelectedItem="{Binding SelectedCondition}" Grid.Row="1"/><TextBlock Text="条件值" Margin="402,34,320,0" VerticalAlignment="Top" Grid.Row="0"/><ComboBox Name="ValueComboBox" Margin="357,5,275,0" VerticalAlignment="Top" ItemsSource="{Binding ConditionValues}" SelectedItem="{Binding SelectedConditionValue}" Grid.Row="1"/><TextBlock Text="关系" Margin="564,34,168,0" VerticalAlignment="Top" Grid.Row="0"/><ComboBox Name="RelationComboBox" Margin="532,5,154,0" VerticalAlignment="Top" ItemsSource="{Binding RelationValues}" SelectedItem="{Binding SelectedRelationValue}" Grid.Row="1"/><Button Content="添加" Command="{Binding AddQueryConditionCommand}" Margin="637,5,0,0" HorizontalAlignment="Left" VerticalAlignment="Top" Height="27" Grid.Row="1"/><Button Content="查询" Command="{Binding QueryCommand}" Margin="697,5,0,0" HorizontalAlignment="Left" VerticalAlignment="Top" Height="27" Grid.Row="1"/><DataGrid Name="ConditionDataGrid" Grid.Row="2" Margin="10,10,10,0" BorderThickness="1"Height="300"AutoGenerateColumns="False" ItemsSource="{Binding QueryConditions}"><DataGrid.Columns><DataGridTextColumn Width="200" Header="字段名称" Binding="{Binding FieldName}"><DataGridTextColumn.ElementStyle><Style TargetType="TextBlock"><Setter Property="HorizontalAlignment" Value="Center"/><Setter Property="VerticalAlignment" Value="Center"/></Style></DataGridTextColumn.ElementStyle><DataGridTextColumn.HeaderStyle><Style TargetType="DataGridColumnHeader"><Setter Property="HorizontalContentAlignment" Value="Center"/></Style></DataGridTextColumn.HeaderStyle></DataGridTextColumn><DataGridTextColumn Width="100" Header="条件" Binding="{Binding Condition}"><DataGridTextColumn.ElementStyle><Style TargetType="TextBlock"><Setter Property="HorizontalAlignment" Value="Center"/><Setter Property="VerticalAlignment" Value="Center"/></Style></DataGridTextColumn.ElementStyle><DataGridTextColumn.HeaderStyle><Style TargetType="DataGridColumnHeader"><Setter Property="HorizontalContentAlignment" Value="Center"/></Style></DataGridTextColumn.HeaderStyle></DataGridTextColumn><DataGridTextColumn Width="200" Header="条件值" Binding="{Binding ConditionValue}"><DataGridTextColumn.ElementStyle><Style TargetType="TextBlock"><Setter Property="HorizontalAlignment" Value="Center"/><Setter Property="VerticalAlignment" Value="Center"/></Style></DataGridTextColumn.ElementStyle><DataGridTextColumn.HeaderStyle><Style TargetType="DataGridColumnHeader"><Setter Property="HorizontalContentAlignment" Value="Center"/></Style></DataGridTextColumn.HeaderStyle></DataGridTextColumn><DataGridTextColumn Width="100" Header="关系" Binding="{Binding RelationValue}"><DataGridTextColumn.ElementStyle><Style TargetType="TextBlock"><Setter Property="HorizontalAlignment" Value="Center"/><Setter Property="VerticalAlignment" Value="Center"/></Style></DataGridTextColumn.ElementStyle><DataGridTextColumn.HeaderStyle><Style TargetType="DataGridColumnHeader"><Setter Property="HorizontalContentAlignment" Value="Center"/></Style></DataGridTextColumn.HeaderStyle></DataGridTextColumn><DataGridTemplateColumn Width="200" Header="操作"><DataGridTemplateColumn.CellTemplate><DataTemplate><Button Content="删除" Width="80" Command="{Binding DataContext.DeleteConditionCommand, RelativeSource={RelativeSource AncestorType={x:Type Window}}}"CommandParameter="{Binding}"/></DataTemplate></DataGridTemplateColumn.CellTemplate><DataGridTemplateColumn.HeaderStyle><Style TargetType="DataGridColumnHeader"><Setter Property="HorizontalContentAlignment" Value="Center"/></Style></DataGridTemplateColumn.HeaderStyle></DataGridTemplateColumn></DataGrid.Columns></DataGrid></Grid>
</Window>

窗体实现类TraceTableSecondaryFiltration.xaml.cs

这里在进行数据对比时对数据进行了类型转换,因为string类型的对比会出现

“4”>“20”的情况

using CommunityToolkit.Mvvm.Input;
using SQLSugarDB.Model.Public;
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Windows;
using System.Windows.Controls;
using Expression = System.Linq.Expressions.Expression;
namespace GMWPF.Views.ModuleMenu.Purchase.PurchaseModle1.ChildWindow
{public partial class TraceTableSecondaryFiltration : Window{public List<ToolStr50> FilteredData { get; private set; }private Dictionary<string, string> _columnMappings;//所有的列和对应Toolstr属性的映射关系private List<ToolStr50> _Ibo;//所有的数据private List<string> _fieldNames = new List<string>(); // 字段名public List<string> FieldNames{get { return _fieldNames; }set{_fieldNames = value;}}private string _selectedFieldName;public string SelectedFieldName{get { return _selectedFieldName; }set{_selectedFieldName = value;}}private ObservableCollection<string> _conditions = new ObservableCollection<string>(); // 条件public ObservableCollection<string> Conditions{get { return _conditions; }set{_conditions = value;}}private string _selectedCondition;public string SelectedCondition{get { return _selectedCondition; }set{_selectedCondition = value;}}private ObservableCollection<string> _conditionValues = new ObservableCollection<string>(); // 条件值public ObservableCollection<string> ConditionValues{get { return _conditionValues; }set{_conditions = value;}}private string _selectedConditionValue;public string SelectedConditionValue{get { return _selectedConditionValue; }set{_selectedConditionValue = value;}}private ObservableCollection<string> _relationValues = new ObservableCollection<string>(); // 关系public ObservableCollection<string> RelationValues{get { return _relationValues; }set{_relationValues = value;}}private string _selectedRelationValue;public string SelectedRelationValue{get { return _selectedRelationValue; }set{_selectedRelationValue = value;}}private ObservableCollection<SecondQueryCondition> _queryConditions = new ObservableCollection<SecondQueryCondition>();public ObservableCollection<SecondQueryCondition> QueryConditions{get => _queryConditions;set{_queryConditions = value;}}public TraceTableSecondaryFiltration(Dictionary<string, string> columnMappings, List<ToolStr50> Ibo){_columnMappings = columnMappings;_Ibo = Ibo;InitializeComponent();DataContext = this; // 设置数据上下文为当前窗口//将columnMappings所有的key拿出来放进List<string> _fieldNames中_fieldNames = new List<string>(_columnMappings.Keys);Conditions.Add("大于");Conditions.Add("大于等于");Conditions.Add("小于");Conditions.Add("小于等于");Conditions.Add("等于");Conditions.Add("不等于");RelationValues.Add("并且");RelationValues.Add("或者");//设定个默认值SelectedRelationValue = "并且";}[RelayCommand]public void AddQueryCondition(){// 检查是否有空值或空字符串if (string.IsNullOrEmpty(_selectedFieldName) ||string.IsNullOrEmpty(_selectedCondition) ||string.IsNullOrEmpty(_selectedConditionValue) ||string.IsNullOrEmpty(_selectedRelationValue)){return; // 如果有空值,直接返回}// 创建并添加 SecondQueryCondition 对象到 QueryConditions 列表QueryConditions.Add(new SecondQueryCondition(QueryConditions.Count + 1, _selectedFieldName, _selectedCondition, _selectedConditionValue, _selectedRelationValue));}private void FieldNameComboBox_SelectionChanged(object sender, SelectionChangedEventArgs e){ConditionValues.Clear();_columnMappings.TryGetValue(_selectedFieldName, out string property);if (_Ibo == null){return;}foreach (var item in _Ibo){string propertyValue = item.GetType().GetProperty(property)?.GetValue(item)?.ToString();if (!string.IsNullOrEmpty(propertyValue) && !ConditionValues.Contains(propertyValue)){ConditionValues.Add(propertyValue);}}}[RelayCommand]public void DeleteCondition(SecondQueryCondition secondQueryCondition){QueryConditions.Remove(secondQueryCondition);}[RelayCommand]public void Query(){var parameter = Expression.Parameter(typeof(ToolStr50), "p");Expression finalExpression = null;foreach (var queryCondition in QueryConditions){if (_columnMappings.TryGetValue(queryCondition.FieldName, out string property)){var member = Expression.Property(parameter, property);var conditionValue = Expression.Constant(queryCondition.ConditionValue, typeof(string));Expression comparison;// 尝试解析为 int, double, DateTimeif (int.TryParse(queryCondition.ConditionValue, out int intValue)){var intMember = Expression.Convert(member, typeof(int));var intConditionValue = Expression.Constant(intValue, typeof(int));comparison = GetIntegerComparison(queryCondition.Condition, intMember, intConditionValue);}else if (double.TryParse(queryCondition.ConditionValue, out double doubleValue)){var doubleMember = Expression.Convert(member, typeof(double));var doubleConditionValue = Expression.Constant(doubleValue, typeof(double));comparison = GetDoubleComparison(queryCondition.Condition, doubleMember, doubleConditionValue);}//如果日期类型无法对比直接注释掉,按照string类型对比//else if (DateTime.TryParse(queryCondition.ConditionValue, out DateTime dateTimeValue))//{//    var dateTimeMember = Expression.Convert(member, typeof(DateTime));//    var dateTimeConditionValue = Expression.Constant(dateTimeValue, typeof(DateTime));//    comparison = GetDateTimeComparison(queryCondition.Condition, dateTimeMember, dateTimeConditionValue);//}else{// 如果无法转换,继续使用字符串比较comparison = GetStringComparison(queryCondition.Condition, member, conditionValue);}// 组合条件if (finalExpression == null){finalExpression = comparison;}else{if (queryCondition.RelationValue.Equals("并且")){finalExpression = Expression.AndAlso(finalExpression, comparison); // 使用 AndAlso 组合条件}if (queryCondition.RelationValue.Equals("或者")){finalExpression = Expression.Or(finalExpression, comparison); // 使用 Or 组合条件}}}}// 生成最终的 Lambda 表达式if (finalExpression != null){var lambda = Expression.Lambda<Func<ToolStr50, bool>>(finalExpression, parameter);FilteredData = _Ibo.Where(lambda.Compile()).ToList();this.DialogResult = true; // 可选: 设置窗口的结果this.Close(); // 关闭窗口}else //没有查询条件查全部{FilteredData = _Ibo;this.DialogResult = true; // 可选: 设置窗口的结果this.Close(); // 关闭窗口}}private Expression GetIntegerComparison(string condition, Expression member, Expression conditionValue){return condition switch{"大于" => Expression.GreaterThan(member, conditionValue),"大于等于" => Expression.GreaterThanOrEqual(member, conditionValue),"小于" => Expression.LessThan(member, conditionValue),"小于等于" => Expression.LessThanOrEqual(member, conditionValue),"等于" => Expression.Equal(member, conditionValue),"不等于" => Expression.NotEqual(member, conditionValue),_ => throw new NotSupportedException($"不支持的条件: {condition}")};}private Expression GetDoubleComparison(string condition, Expression member, Expression conditionValue){return condition switch{"大于" => Expression.GreaterThan(member, conditionValue),"大于等于" => Expression.GreaterThanOrEqual(member, conditionValue),"小于" => Expression.LessThan(member, conditionValue),"小于等于" => Expression.LessThanOrEqual(member, conditionValue),"等于" => Expression.Equal(member, conditionValue),"不等于" => Expression.NotEqual(member, conditionValue),_ => throw new NotSupportedException($"不支持的条件: {condition}")};}private Expression GetDateTimeComparison(string condition, Expression member, Expression conditionValue){return condition switch{"大于" => Expression.GreaterThan(member, conditionValue),"大于等于" => Expression.GreaterThanOrEqual(member, conditionValue),"小于" => Expression.LessThan(member, conditionValue),"小于等于" => Expression.LessThanOrEqual(member, conditionValue),"等于" => Expression.Equal(member, conditionValue),"不等于" => Expression.NotEqual(member, conditionValue),_ => throw new NotSupportedException($"不支持的条件: {condition}")};}private Expression GetStringComparison(string condition, Expression member, Expression conditionValue){// 比较两个字符串时,我们需要使用 string.Compare 方法var compareMethod = typeof(string).GetMethod("Compare", new[] { typeof(string), typeof(string) });return condition switch{// 等于"等于" => Expression.Equal(member, conditionValue),// 不等于"不等于" => Expression.NotEqual(member, conditionValue),// 大于"大于" => Expression.GreaterThan(Expression.Call(null, compareMethod, member, conditionValue),Expression.Constant(0)),// 小于"小于" => Expression.LessThan(Expression.Call(null, compareMethod, member, conditionValue),Expression.Constant(0)),// 大于等于"大于等于" => Expression.GreaterThanOrEqual(Expression.Call(null, compareMethod, member, conditionValue),Expression.Constant(0)),// 小于等于"小于等于" => Expression.LessThanOrEqual(Expression.Call(null, compareMethod, member, conditionValue),Expression.Constant(0)),_ => throw new NotSupportedException($"不支持的条件: {condition}")};}}
}

动态生成的lambda表达式:

相关文章:

c# 动态lambda实现二级过滤(多种参数类型)

效果 调用方法 实体类&#xff08;可以根据需求更换&#xff09; public class ToolStr50 {public bool isSelected { get; set; }public string toolStr1 { get; set; }public string toolStr2 { get; set; }public string toolStr3 { get; set; }public string toolStr4 { …...

34.Redis事务

1.事务Redis介绍 事务表示一组动作&#xff0c;要么全部执行&#xff0c;要么全部不执行。 例如微博粉丝关注用户&#xff0c;博主粉丝列表增加了用户&#xff0c;粉丝关注列表增加了博主&#xff1b; Redis 提供了简单的事务功能&#xff0c;将一组需要一起执行的命令放到mult…...

认识类和对象

认识类 类是用来对一个实体 ( 对象 ) 来进行描述的&#xff0c;主要描述该实体(对象)具有哪些属性(外观尺寸等)&#xff0c;哪些功能(用来干啥) 类中包含的内容称为 类的成员。属性主要是用来描述类的&#xff0c;称之为 类的成员属性或者 类成员变量。方法主要说明类具有哪些功…...

解决echarts桑基图为0时tooltip不显示的问题

关键代码 formatter: function (params) {console.log("params",params)if (params.value 0) {// 如果值为0&#xff0c;返回空字符串&#xff0c;不显示任何内容return params.name : params.value;// return ;} else {// 否则返回标准的格式化信息return par…...

vue3 基础笔记

基础模板语法 //1. 普通文本插值: <p>{{ rawHtml }}</p>//2. v-html 指令&#xff1a;插入 HTML 内容&#xff0c;并希望 Vue 将其视为 HTML 而不是纯文本 <p v-html"rawHtml"></p> let rawHtml <span>这是一个 <b>HTML</…...

Oracle 第30章:最佳实践与案例研究

在《Oracle最佳实践与案例研究》第30章中&#xff0c;我们探讨了实际项目中的经验分享以及解决常见问题的技巧。这一章节旨在通过具体的案例来说明如何在Oracle数据库管理和开发中应用最佳实践。下面我将从几个方面进行详细介绍&#xff0c;并提供一些源代码示例。 1. 性能优化…...

第九周预习报告

文章目录 第九周预习报告学习内容AI 对学习内容的总结章节概述内容总结 对知识总结的反思思维导图基于AI的学习知识点1&#xff1a;系统调用知识点2&#xff1a;进程控制 学习实践过程遇到的问题与解决方式问题1&#xff1a;fork() 调用后&#xff0c;子进程和父进程同时运行导…...

【分享】这篇教程助力你成为 JavaScript 糕手!(四)

第四章&#xff1a;运算符与表达式 4.1 算术运算符 加法运算符&#xff08;&#xff09;&#xff1a;用于数字相加&#xff0c;如console.log(5 3);结果为8。 当用于字符串时&#xff0c;它表示字符串拼接。例如console.log(‘Hello’ ‘world’);输出Hello world。如果一个操…...

双亲委派模型的破坏

双亲委派模型的第一次“被破坏”其实发生在双亲委派模型出现之前--即JDK1.2发布之前。由于双亲委派模型是在JDK1.2之后才被引入的,而类加载器和抽象类java.lang.ClassLoader则是JDK1.0时候就已经存在,面对已经存在 的用户自定义类加载器的实现代码,Java设计者引入双亲委派模…...

Android关机流程知多少?

在 Android 中&#xff0c;关机流程涉及系统各个组件的协同工作&#xff0c;确保设备在断电之前能够安全地关闭所有活动并保存数据。以下是 Android 系统中关机流程的详细介绍&#xff1a; 1. 用户触发关机请求 关机流程由用户的操作触发&#xff0c;通常有以下几种方式&#…...

深入理解指针end(总结篇)

如果有不会的智识点&#xff0c;请移动到博主前四篇指针博客&#xff01; 可以当一个指针智商检阅博客看。 看看你是否掌握了这些知识 1&#xff1a;内存&#xff0c;指针变量 内存单元的编号地址指针&#xff1b; 指针变量和其他变量没有区别&#xff0c;指针变量是来存放…...

C# 程序暂停的两种方式

C# 程序暂停的两种方式&#xff1a;EventWaitHandle 与 volatile bool pause 在C#中&#xff0c;线程控制是多线程编程的重要组成部分&#xff0c;其中实现暂停的需求经常出现。本文将详细探讨使用EventWaitHandle和设置volatilebool来实现线程暂停的不同方式&#xff0c;它们…...

【LeetCode】【算法】160.相交链表

Leetcode 160. 相交链表 题目描述 给你两个单链表的头节点 headA 和 headB &#xff0c;请你找出并返回两个单链表相交的起始节点。如果两个链表不存在相交节点&#xff0c;返回 null 。 思路 AB&#xff0c;一个指针&#xff0c;访问完A访问B&#xff1b;另一个指针&#…...

光伏破局 引领能源革命

为进一步推进商业信用体系建设&#xff0c;促进企业诚实守信经营&#xff0c;面向企业普及诚信与品牌建设的意义&#xff0c;指导企业加强诚信品牌建设&#xff0c;提升其整体竞争力&#xff0c;“崛起的民族品牌”专题系列节目以诚信为内涵&#xff0c;在全国范围内遴选出有行…...

Jenkins声明式Pipeline流水线语法示例

系列文章目录 docker搭建Jenkins2.346.3版本及常用工具集成配置(ldap、maven、ansible、npm等) docker安装低版本的jenkins-2.346.3,在线安装对应版本插件失败的解决方法 文章目录 系列文章目录jenkins流水线基础1、pipeline1.1、什么是pipeline&#xff1f;1.2、为什么使用pi…...

互联网技术净土?原生鸿蒙开启全新技术征程

鸿蒙生态与开发者的崭新机会 HarmonyOS NEXT承载着华为对未来操作系统的深刻理解&#xff0c;如今已发展为坚实的数字底座。它不仅在技术层面取得了全面突破&#xff0c;还在中国操作系统市场中站稳了脚跟。 当前&#xff0c;HarmonyOS NEXT的代码行数已超过1.1亿&#xff0c…...

关于Django 模型字段 `choices`自定义数据类型的枚举——补充

文章目录 1. 处理 datetime 类型的 choices2. 处理 time 类型的 choices3. 处理 Decimal 类型的 choices4. 处理 UUID 类型的 choices5. 处理 float 类型的 choices 在 Choices 类的基础上扩展&#xff0c;可以将 choices 与特定数据类型&#xff08;如 date 或 datetime&a…...

CAP理论的延申--BASE理论

上一篇文章我简单介绍了一下什么是CAP理论&#xff0c;本篇文章讲解一下随着技术的演变&#xff0c;CAP理论是如何发展为BASE理论的。 CAP理论回顾 首先我们回顾一下CAP理论&#xff0c;CAP理论指得是分布式系统发生网络等故障时&#xff0c;不同节点之间无法同步数据&#xf…...

【傻呱呱】phpMyAdmin怎样给特定用户授权特定数据库权限?

前期准备 phpMyAdmin数据库&#xff08;MySQL&#xff09; END...

『VUE』21. 组件注册(详细图文注释)

目录 组件注册局部注册全局注册全局注册示例总结 欢迎关注 『VUE』 专栏&#xff0c;持续更新中 欢迎关注 『VUE』 专栏&#xff0c;持续更新中 组件注册 组件注册有两种方式&#xff1a;全局注册和局部注册。全局注册只需要注册依次,其他组件可以直接调用无需再次像局部注册一…...

如何产看SQL 查询的执行时间

要查看 SQL 查询的执行时间&#xff0c;尤其是毫秒级别&#xff0c;可以使用以下几种方法&#xff1a; 方法 1&#xff1a;使用 SET STATISTICS TIME 查看执行时间 SET STATISTICS TIME 会显示执行时间的详细信息&#xff0c;包括 CPU 时间和总耗时。启用后&#xff0c;SQL S…...

计算机网络——路由器构成

算路由表是分布式去算——你算你的&#xff0c;我算我的 输出队列非先来先传 调度发生在哪里 缓存队列一般是应对——来数据方向的速度过快问题...

架构师之路-学渣到学霸历程-48

实现域名跳转的实验 今天继续还是分享域名跳转的实验&#xff1b;继续整&#xff0c;看看效果 意思就是你本来访问www.liangjiawei.net的网站然后跳转到blog.liangjiawei.net的网站 1、基础的环境部署 安装好nginx&#xff08;这里最好的就是干净的环境&#xff09;创建两个…...

HappyChart——一款简单好用的专业绘图软件

HappyChart是一款新出的专业绘图软件&#xff0c;灵感来自于类PS软件&#xff0c;它是以图层的方式进行绘图。相比与Excel图表或其他专业绘图软件&#xff0c;HappyChart界面简洁明了&#xff0c;操作简单&#xff0c;没有复杂的选项&#xff0c;它只调整绘图相关参数即可实时展…...

【Linux】进程信号全攻略(二)

&#x1f308; 个人主页&#xff1a;Zfox_ &#x1f525; 系列专栏&#xff1a;Linux 目录 一&#xff1a;&#x1f525; 再谈信号的捕捉 &#x1f98b; 关于信号捕捉的细节部分&#xff08;sigaction函数&#xff09; 二&#xff1a;&#x1f525; 穿插话题 - 操作系统是怎么运…...

redis用法(二)

文章目录 02-redis数据类型篇生产环境下的redis实况图 1.全局命令redis数据存储格式set设置k-v查看当前redis的key的数量危险命令&#xff0c;新手请在于超老师陪同下执行为什么危险&#xff1f;如何正确搜索redis的key 查看库下有多少个key查询redis库信息切换redis库查看key是…...

Python-利用os,tkinter库编写一个伪恶意程序文件(Pro版)

前言&#xff1a;上一期我们简单学习了如何编写一个多次弹窗警告用户的exe伪恶意文件。我们知道了把Python初始文件编译为exe文件后&#xff0c;程序在没有Python环境的情况下也能正常运行。我们上次编写的程序仅仅只是伪造系统正在执行关机命令前的倒计时的假象&#xff0c;实…...

Oracle视频基础1.4.4练习

1.4.4 [dbs] 删干净上次创建的bbk ll rm -f *dbf ll rm -f spfilebbk.ora clear ll创建bbk的pfile&#xff0c;准备对应的目录 ll strings spfilewilson.ora | more strings spfilewilson.ora > initbbk.ora :%s/wilson/bbk :%s/*\.//g :wq ll vi initbbk.ora####### 创…...

GOF的C++软件设计模式的分类和模式名称

“GOF” 指的是 “Gang of Four”&#xff0c;即“四人帮”&#xff0c;他们是指 Erich Gamma、Richard Helm、Ralph Johnson 和 John Vlissides。这四位作者在其著作《Design Patterns: Elements of Reusable Object-Oriented Software》中定义了23种设计模式&#xff0c;这些…...

有向图的完全可达性(有向图搜索全路径的问题) C#DFs

在考察输入输出方面我觉得是道难题了 第一次遇见邻接表的数据结构该怎么声明 卡码网105 在力扣没找见完全相同的题 感觉需要多练习多复习这种类型的题 105. 有向图的完全可达性 题目描述 给定一个有向图&#xff0c;包含 N 个节点&#xff0c;节点编号分别为 1&…...