schangxiang@126.com
2025-05-21 496f78c085e7f8c5ba261835f9b8bda99c25b4cb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
 
 
using GenerateCode_WeiBen_WMS.Model;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
 
namespace GenerateCode_GEBrilliantFactory
{
    /// <summary>
    /// 生成查询实体类
    /// </summary>
    public class InputQueryModel_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<ColumnModel> newColumnNameList = ListHelper.OnlyRemoveId(param.ColumnNameList);
            for (int i = 0; i < newColumnNameList.Count; ++i)
            {
                attrString += StructStrHelper.GenerateAttributeForQueryModel(newColumnNameList[i], param);
                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;
        }
    }
}