public MiicConditionCollections vistor(PublishInfoDao publishDao) { MiicConditionCollections condition = new MiicConditionCollections(MiicDBLogicSetting.No); MiicCondition communityIDCondition = new MiicCondition(Config.Attribute.GetSqlColumnNameByPropertyName <PublishLabelRelation, string>(o => o.CommunityID), CommunityID, DbType.String, MiicDBOperatorSetting.Equal); condition.Add(new MiicConditionLeaf(MiicDBLogicSetting.No, communityIDCondition)); MiicCondition labelIDIDCondition = new MiicCondition(Config.Attribute.GetSqlColumnNameByPropertyName <PublishLabelRelation, string>(o => o.LabelID), LabelID, DbType.String, MiicDBOperatorSetting.Equal); condition.Add(new MiicConditionLeaf(labelIDIDCondition)); MiicCondition validCondition = new MiicCondition(Config.Attribute.GetSqlColumnNameByPropertyName <PublishLabelRelation, string>(o => o.Valid), ((int)MiicValidTypeSetting.Valid).ToString(), DbType.String, MiicDBOperatorSetting.Equal); condition.Add(new MiicConditionLeaf(validCondition)); MiicCondition editStatusCondition = new MiicCondition(Config.Attribute.GetSqlColumnNameByPropertyName <PublishInfo, string>(o => o.EditStatus), ((int)MiicYesNoSetting.No).ToString(), DbType.String, MiicDBOperatorSetting.Equal); condition.Add(new MiicConditionLeaf(editStatusCondition)); MiicConditionCollections dateCondition = new MiicConditionCollections(); MiicCondition yearCondition = new MiicCondition(MiicSimpleDateTimeFunction.YearFunc <PublishInfo, DateTime?>(o => o.PublishTime), Year, DbType.String, MiicDBOperatorSetting.Equal); dateCondition.Add(new MiicConditionLeaf(MiicDBLogicSetting.No, yearCondition)); if (!string.IsNullOrEmpty(Month)) { MiicCondition monthCondition = new MiicCondition(MiicSimpleDateTimeFunction.MonthFunc <PublishInfo, DateTime?>(o => o.PublishTime), Month, DbType.String, MiicDBOperatorSetting.Equal); dateCondition.Add(new MiicConditionLeaf(MiicDBLogicSetting.And, monthCondition)); } condition.Add(dateCondition); return(condition); }
public override MiicConditionCollections visitor(PublishInfoDao publishInfoDao) { MiicConditionCollections condition = new MiicConditionCollections(MiicDBLogicSetting.No); MiicCondition editStatusCondition = new MiicCondition(Config.Attribute.GetSqlColumnNameByPropertyName <AddressPublishInfo, string>(o => o.EditStatus), ((int)MiicYesNoSetting.No).ToString(), DbType.String, MiicDBOperatorSetting.Equal); condition.Add(new MiicConditionLeaf(MiicDBLogicSetting.No, editStatusCondition)); MiicConditionCollections dateCondition = new MiicConditionCollections(); MiicCondition yearCondition = new MiicCondition(MiicSimpleDateTimeFunction.YearFunc <AddressPublishInfo, DateTime?>(o => o.PublishTime), Year, DbType.String, MiicDBOperatorSetting.Equal); dateCondition.Add(new MiicConditionLeaf(MiicDBLogicSetting.No, yearCondition)); if (!string.IsNullOrEmpty(Month)) { MiicCondition monthCondition = new MiicCondition(MiicSimpleDateTimeFunction.MonthFunc <AddressPublishInfo, DateTime?>(o => o.PublishTime), Month, DbType.String, MiicDBOperatorSetting.Equal); dateCondition.Add(new MiicConditionLeaf(MiicDBLogicSetting.And, monthCondition)); } condition.Add(dateCondition); //发表人是用户 MiicCondition createrIDCondition = new MiicCondition(Config.Attribute.GetSqlColumnNameByPropertyName <AddressPublishInfo, string>(o => o.CreaterID), this.UserID, DbType.String, MiicDBOperatorSetting.Equal); condition.Add(new MiicConditionLeaf(createrIDCondition)); return(condition); }