using GenerateCode_WeiBen_WMS.Model;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace GenerateCode_GEBrilliantFactory
{
///
/// 生成查询实体类
///
public class InputModel_Generate : BaseGenerate
{
public static string CreateQueryModelLText(GenerateCodeParam param)
{
var str = TextHelper.ReadText(@"Templete\Entity\InputQueryModel模板.txt");
CommonReplace(ref str);
CommonHelper.CommonReplaceStr(param, ref str);
//处理 分页查询部分
string attrString = "";
List newColumnNameList = ListHelper.OnlyRemoveId(param.ColumnNameList);
for (int i = 0; i < newColumnNameList.Count; ++i)
{
attrString += StructStrHelper.GenerateAttributeForQueryModel(newColumnNameList[i]);
attrString += StructStrHelper.GenerateAttributeForQueryModelMode(newColumnNameList[i]);
}
str = str.Replace("$QueryAttributes$", attrString);
//处理 新增部分
attrString = "";
newColumnNameList = ListHelper.RemoveIdCreatorModifier(param.ColumnNameList);
for (int i = 0; i < newColumnNameList.Count; ++i)
{
attrString += StructStrHelper.GenerateAttribute(i, newColumnNameList[i]);
}
str = str.Replace("$AddAttributes$", attrString);
return str;
}
}
}