using Mall.Model.Entity.Property;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using VT.FW.DB;

namespace Mall.Repository.Property
{
    /// <summary>
    /// 资产审批关联仓储类
    /// </summary>
    public partial class RB_Property_AuditRelevanceRepository : BaseRepository<RB_Property_AuditRelevance>
    {
        /// <summary>
        /// 获取列表数据
        /// </summary>
        /// <param name="dmodel"></param>
        /// <returns></returns>
        public List<RB_Property_AuditRelevance> GetList(RB_Property_AuditRelevance dmodel)
        {
            string where = " where 1=1 ";
            where += string.Format(" AND {0}={1}", nameof(RB_Property_AuditRelevance.Status), 0);
            where += $@" and RB_Group_Id={dmodel.RB_Group_Id}";
            if (dmodel.Type > 0)
            {
                where += " and " + nameof(RB_Property_AuditRelevance.Type) + "=" + (int)dmodel.Type;
            }
            string sql = $@" select * from RB_Property_AuditRelevance {where}";
            return Get<RB_Property_AuditRelevance>(sql).ToList();
        }
    }
}
