Master.CanYinWu.DAL/ADsShowDAL.cs

(开头部分) 16KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

using Dapper;
using Master.CanYinWu.Entity;
using Master.CanYinWu.Entity.ViewModel;
using Master.CanYinWu.Utility;
using System;
using System.Collections.Generic;
using System.Data;
using System.Text;
using System.Threading.Tasks;

namespace Master.CanYinWu.DAL
{
    public class ADsShowDAL
    {
        private IDbConnection conn;

        #region 栏目列表
        /// <summary>
        /// 栏目列表
        /// </summary>
        /// <param name="pageIndex"></param>
        /// <param name="pageSize"></param>
        /// <param name="key"></param>
        /// <returns></returns>
        public async Task<Tuple<IEnumerable<ADsShowViewModel>, int>> GetList(int pageIndex, int pageSize, string key, string ClientCategory, string ViewCategory, int? ADsPositionType, int? IsOpen)
        {
            StringBuilder sb = new StringBuilder(@"
                     select tab.ADsId,tab.CompanyName,tab.CompanyUrl,tab.MainProduct,tab.ImageName,tab.ImageType,tab.ClassSort,tab.AddDate,
		                    tab.JoinTitle,tab.JoinTitle2,tab.SmallImageName,tab.IsOpen,tab.UpdateDate,tab.Remark,tab.EndDate,tab.IsFree,
		                    tab.ADsPositionType,tab.ProjectJoinId,tab.ClientCategory,tab.ViewCategory,
                            (select Name from ADsPosition as adsp where adsp.id=tab.ADsPositionType)as PositionName,
		                    (select ShortName from ProjectJoinInfo as pji where pji.ProjectJoinId=tab.ProjectJoinId)as ProjectJoinShortName
                     from(
                     select * from(select *,ROW_NUMBER() over (order by ADsId asc) as  rownumber  from  ADsShow where IsDelete =0  ");
            DynamicParameters dp = new DynamicParameters();
            dp.Add("PageIndex", pageIndex);
            dp.Add("PageSize", pageSize);
            StringBuilder sqlTotal = new StringBuilder(@"select count(1)  from ADsShow where IsDelete =0");
            DynamicParameters dpTotal = new DynamicParameters();
            if (!string.IsNullOrEmpty(key))
            {
                sb.Append(" and CompanyName like '%'+@Key+'%' ");
                sqlTotal.Append(" and CompanyName like '%'+@Key+'%' ");
                dp.Add("Key", key);
                dpTotal.Add("Key", key);
            }
            if (!string.IsNullOrEmpty(ClientCategory))
            {
                sb.Append(" and ClientCategory =@ClientCategory ");
                sqlTotal.Append(" and ClientCategory=@ClientCategory ");
                dp.Add("ClientCategory", ClientCategory);
                dpTotal.Add("ClientCategory", ClientCategory);
            }
            if (!string.IsNullOrEmpty(ViewCategory))
            {
                sb.Append(" and ViewCategory like '%'+@ViewCategory+'%' ");
                sqlTotal.Append(" and ViewCategory like '%'+@ViewCategory+'%' ");
                dp.Add("ViewCategory", ViewCategory);
                dpTotal.Add("ViewCategory", ViewCategory);
            }
后面还有 328 行代码,购买后查看完整代码

24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明

AI 解读 AI

登录后可用,每次 10 算力,解读结果公开显示在下面。

还没有人解读过这个文件。