| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Data; |
| | | using System.Drawing; |
| | | using System.Drawing.Printing; |
| | | using System.Linq; |
| | | using System.Text; |
| | |
| | | return Count; |
| | | } |
| | | } |
| | | public int GetDeclarationtimeCount(string Keyword, int Time) |
| | | public int GetDeclarationtimeCount(string Keyword, int Time, string Region) |
| | | { |
| | | using (IDbConnection connection = new MySqlConnection(connectionString)) |
| | | { |
| | | var sql = $"SELECT COUNT(*) from articledata WHERE articletype='申报通知' AND declarationtime IS NOT NULL "; |
| | | var sql = $"SELECT COUNT(*) from articledata a JOIN departmentdata d ON a.platform = d.department WHERE a.articletype='申报通知' AND a.declarationtime IS NOT NULL "; |
| | | |
| | | if (!string.IsNullOrEmpty(Region)) |
| | | { |
| | | sql += $" and a.region = '{Region}' "; |
| | | } |
| | | |
| | | if (!string.IsNullOrEmpty(Keyword)) |
| | | { |
| | | sql += $" AND articletitle like '%{Keyword.Trim()}%' "; |
| | | sql += $" AND a.articletitle like '%{Keyword.Trim()}%' "; |
| | | } |
| | | if (Time != 0) |
| | | { |
| | | if (Time == 7) |
| | | { |
| | | sql += $" AND declarationtime IS NOT NULL AND deadline BETWEEN CURDATE() AND CURDATE() + INTERVAL 7 DAY "; |
| | | sql += $" AND a.declarationtime IS NOT NULL AND a.deadline BETWEEN CURDATE() AND CURDATE() + INTERVAL 7 DAY "; |
| | | } |
| | | else if(Time == 30){ |
| | | sql += $" AND declarationtime IS NOT NULL AND deadline BETWEEN CURDATE() AND CURDATE() + INTERVAL 30 DAY "; |
| | | sql += $" AND a.declarationtime IS NOT NULL AND a.deadline BETWEEN CURDATE() AND CURDATE() + INTERVAL 30 DAY "; |
| | | } |
| | | } |
| | | int Count = connection.Query<int>(sql).FirstOrDefault(); |
| | |
| | | } |
| | | } |
| | | |
| | | public List<ArticleDataPage> GetDeclarationtimeList( string Keyword,int Time, int PageNumber, int PageSize) |
| | | public List<ArticleDataPage> GetDeclarationtimeList( string Keyword,int Time, int PageNumber, int PageSize ,string Region) |
| | | { |
| | | using (IDbConnection connection = new MySqlConnection(connectionString)) |
| | | { |
| | | var sql = $"SELECT *, d.region from articledata a JOIN departmentdata d ON a.platform = d.department WHERE a.articletype='申报通知' AND a.declarationtime IS NOT NULL "; |
| | | if (!string.IsNullOrEmpty(Region)) |
| | | { |
| | | sql += $" and a.region = '{Region}' "; |
| | | } |
| | | |
| | | if (!string.IsNullOrEmpty(Keyword)) |
| | | { |