You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
67 lines
1.8 KiB
67 lines
1.8 KiB
2 years ago
|
using AutoMapper;
|
||
|
using System;
|
||
|
using System.Collections.Generic;
|
||
|
using System.Linq;
|
||
|
using System.Web;
|
||
|
using Warehouse.Models.DTO;
|
||
|
using Warehouse.Models.mesModel;
|
||
|
|
||
|
namespace Warehouse.DAL.Config.PowerRule
|
||
|
{
|
||
|
public class PowerRuleMSDal
|
||
|
{
|
||
|
/// <summary>
|
||
|
/// 查询功率范围
|
||
|
/// </summary>
|
||
|
/// <param name="Id"></param>
|
||
|
/// <param name="Power"></param>
|
||
|
/// <returns></returns>
|
||
|
public List<PowerRangeDto> QueryPowerRange(short Id)
|
||
|
{
|
||
|
using (var context = new mesModel())
|
||
|
{
|
||
|
var Res = from a in context.config_power
|
||
|
where a.power_grade_group_id == Id
|
||
|
select new PowerRangeDto()
|
||
|
{
|
||
|
powergrade = a.power_grade,
|
||
|
lower = a.lower_power,
|
||
|
upper = a.upper_power
|
||
|
};
|
||
|
return Res.ToList<PowerRangeDto>();
|
||
|
//return context.config_power.Where(a => a.power_grade_group_id == Id ).ToList();
|
||
|
}
|
||
|
}
|
||
|
/// <summary>
|
||
|
/// 查询电流范围
|
||
|
/// </summary>
|
||
|
/// <param name="Id"></param>
|
||
|
/// <param name="Power"></param>
|
||
|
/// <param name="Current"></param>
|
||
|
/// <returns></returns>
|
||
|
public List<CurrentRangeDto> QueryCurrentRange(short Id)
|
||
|
{
|
||
|
using (var context = new mesModel())
|
||
|
{
|
||
|
return context.config_power_current.Where(a => a.power_grade_group_id == Id).Select(a =>
|
||
|
new CurrentRangeDto() {
|
||
|
currentgrade = a.current_grade,
|
||
|
powergrade = a.power_grade,
|
||
|
lower = a.lower_current,
|
||
|
upper = a.upper_current }).ToList();
|
||
|
}
|
||
|
}
|
||
|
/// <summary>
|
||
|
/// 查询功率分组
|
||
|
/// </summary>
|
||
|
/// <returns></returns>
|
||
|
public config_power_group QueryPowerRule(short Id)
|
||
|
{
|
||
|
using (var context = new mesModel())
|
||
|
{
|
||
|
return context.config_power_group.Find(Id);
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|