using JNPF.Common.Models;
using JNPF.DependencyInjection;
namespace JNPF.VisualDev.Engine.Model.CodeGen;
///
/// 数据库表列.
///
[SuppressSniffer]
public class TableColumnConfigModel
{
#region 通用参数
///
/// 功能名称.
///
public string ClassName { get; set; }
///
/// 功能名称(首字母小写).
///
public string LowerClassName => string.IsNullOrWhiteSpace(ClassName) ? null : ClassName.Substring(0, 1).ToLower() + ClassName[1..];
///
/// 字段名-大写(剔除"F_","f_").
///
public string ColumnName { get; set; }
///
/// 数据库字段名(首字母小写).
///
public string LowerColumnName => string.IsNullOrWhiteSpace(ColumnName) ? null : ColumnName.Substring(0, 1).ToLower() + ColumnName[1..];
///
/// 原本名称.
///
public string OriginalColumnName { get; set; }
///
/// 控件标题.
///
public string ControlLabel { get; set; }
///
/// 数据库中类型.
///
public string DataType { get; set; }
///
/// .NET字段类型.
///
public string NetType { get; set; }
///
/// 字段描述.
///
public string ColumnComment { get; set; }
///
/// 是否是查询条件.
///
public bool QueryWhether { get; set; }
///
/// 查询方式
/// 1-等于,2-模糊,3-范围.
///
public int QueryType { get; set; }
///
/// 是否查询多选.
///
public bool QueryMultiple { get; set; }
///
/// 是否展示.
///
public bool IsShow { get; set; }
///
/// 是否多选.
///
public bool IsMultiple { get; set; }
///
/// 是否主键.
///
public bool PrimaryKey { get; set; }
///
/// 是否外键字段.
///
public bool ForeignKeyField { get; set; }
///
/// 控件Key.
///
public string jnpfKey { get; set; }
///
/// 控件Key
/// 用途:数据转换时 字段名+控件key 单驼峰命名规则.
///
public string upperJnpfKey => string.IsNullOrWhiteSpace(jnpfKey) ? null : jnpfKey.Substring(0, 1).ToUpper() + jnpfKey[1..];
///
/// 单据规则.
///
public string Rule { get; set; }
///
/// 表名称.
///
public string TableName { get; set; }
///
/// 格式化表名称
/// 子表或者副表使用.
///
public string FormatTableName { get; set; }
///
/// 格式化表名称
/// 子表或者副表使用.
///
public string LowerFormatTableName => string.IsNullOrWhiteSpace(FormatTableName) ? null : FormatTableName.Substring(0, 1).ToLower() + FormatTableName[1..];
///
/// 是否yyyy-MM-dd HH:mm:ss.
///
public bool IsDateTime { get; set; }
///
/// 时间格式化.
///
public string Format { get; set; }
///
/// 开关控件 属性 - 开启展示值.
///
public string ActiveTxt { get; set; }
///
/// 开关控件 属性 - 关闭展示值.
///
public string InactiveTxt { get; set; }
///
/// 静态数据JSON.
///
public List StaticData { get; set; }
///
/// 控件数据来源
/// 部分控件的数据源
/// 例如 静态数据,数据字段,远端数据.
///
public string ControlsDataType { get; set; }
///
/// 数据来源ID.
///
public string propsUrl { get; set; }
///
/// 指定选项的值为选项对象的某个属性值.
///
public string Label { get; set; }
///
/// 是否转换数据.
///
public bool IsConversion { get; set; }
///
/// 是否详情转换数据.
///
public bool IsDetailConversion { get; set; }
///
/// 是否系统控件.
///
public bool IsSystemControl { get; set; }
///
/// 是否唯一.
///
public bool IsUnique { get; set; }
///
/// 是否更新.
///
public bool IsUpdate { get; set; }
///
/// 控制解析.
///
public bool IsControlParsing { get; set; }
#endregion
#region 副表使用
///
/// 是否副表.
///
public bool IsAuxiliary { get; set; }
///
/// 表编号
/// 子表或者副表使用.
///
public int TableNo { get; set; }
#endregion
#region 子表使用
///
/// 子表控件Key.
///
public string ChildControlKey { get; set; }
#endregion
#region 数据导出导入
///
/// 导出配置.
///
public CodeGenFieldsModel ImportConfig { get; set; }
///
/// 是否导入字段.
///
public bool IsImportField { get; set; }
///
/// 指定选项标签为选项对象的某个属性值.
///
public string Value { get; set; }
///
/// 指定选项的子选项为选项对象的某个属性值.
///
public string Children { get; set; }
///
/// 选项分隔符.
///
public string Separator { get; set; }
#endregion
///
/// 联表编号
/// 后续会被遗弃.
///
public string LeagueTableNo { get; set; }
///
/// 展示字段.
///
public string ShowField { get; set; }
///
/// 是否树形父级字段.
///
public bool IsTreeParentField { get; set; }
}