38 lines
1.2 KiB
C#
38 lines
1.2 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Data;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
using dccdc.Models;
|
|
using Dapper;
|
|
|
|
namespace dccdc.DAL
|
|
{
|
|
public class AccessygsqDal
|
|
{
|
|
public List<AccessygsqModel> GetAllList(string TrueName)
|
|
{
|
|
using (IDbConnection conn = CommHelper.GetSqlConnection())
|
|
{
|
|
string sql = "";
|
|
if(!string.IsNullOrEmpty(TrueName))
|
|
{
|
|
TrueName = "%" + TrueName + "%";
|
|
sql += "and TrueName like @TrueName";
|
|
}
|
|
return conn.Query<AccessygsqModel>("select * from oa.dbo.erpuser where 1=1 "+sql, new { @TrueName = TrueName }).ToList();
|
|
}
|
|
}
|
|
public List<AccessygsqModel> findName(String TrueName)
|
|
{
|
|
using (IDbConnection conn = CommHelper.GetSqlConnection())
|
|
{
|
|
string param = "";
|
|
param = " and TrueName like @TrueName";
|
|
return conn.Query<AccessygsqModel>("select * from oa.dbo.erpuser where 1=1 " + param, new { @TrueName = TrueName }).ToList();
|
|
}
|
|
}
|
|
}
|
|
}
|