var sql = $"UPDATE LR_Base_User SET F_RealName='{item.StuName}',F_Gender={xb},F_DepartmentId='{deptId}' WHERE F_Account='{item.USERNAME}'";
xbconn.Execute(sql);
}
//设置默认角色
var rel = xbconn.QueryFirstOrDefault<LR_Base_UserRelationEntity>($"select * from LR_Base_UserRelation where F_UserId='{id}' and F_ObjectId='0cfc388c-80e6-4cf0-b53b-02201827490a'");
if (rel == null)
{
var sql = $"insert into LR_Base_UserRelation (F_UserRelationId,F_UserId,F_Category,F_ObjectId,F_CreateDate,F_CreateUserId,F_CreateUserName) values ('{Guid.NewGuid()}','{id}',1,'0cfc388c-80e6-4cf0-b53b-02201827490a','{DateTime.Now}','System','同步生成')";
xbconn.Execute(sql);
}
}
using (IDbConnection conn =new SqlConnection(_misConnection))
using (IDbConnection conn =new SqlConnection(_misConnection))
{
stu= conn.QueryFirstOrDefault<StuInfoBasicEntity>($"select * from StuInfoBasic where StuNo='{item.USERNAME}'");
stu= conn.QueryFirstOrDefault<StuInfoBasicEntity>($"select * from StuInfoBasic where StuNo='{item.USERNAME}'");
if (stu == null)
{
var sql= "INSERT INTO StuInfoBasic(StuId,StuNo,StuCode,NoticeNo,GraduateYear,ksh,DeptNo,MajorNo,Grade,ClassNo,StuName,SpellFull,GenderNo,Birthday,PartyFaceNo," +
var sql= "INSERT INTO StuInfoBasic(StuId,StuNo,StuCode,NoticeNo,GraduateYear,ksh,DeptNo,MajorNo,Grade,ClassNo,StuName,SpellFull,GenderNo,Birthday,PartyFaceNo," +
var sql = $"UPDATE LR_Base_User SET F_RealName='{item.NAME}',F_Gender={xb},F_DepartmentId='{deptId}' WHERE F_Account='{item.USERNAME}'";
xbconn.Execute(sql);
}
//设置默认角色
var rel = xbconn.QueryFirstOrDefault<LR_Base_UserRelationEntity>($"select * from LR_Base_UserRelation where F_UserId='{id}' and F_ObjectId='ed811d67-59d6-4dfa-8061-299b73388e69'");
if(rel==null)
{
var sql = $"insert into LR_Base_UserRelation (F_UserRelationId,F_UserId,F_Category,F_ObjectId,F_CreateDate,F_CreateUserId,F_CreateUserName) values ('{Guid.NewGuid()}','{id}',1,'ed811d67-59d6-4dfa-8061-299b73388e69','{DateTime.Now}','System','同步生成')";
xbconn.Execute(sql);
}
}
using (IDbConnection conn = new SqlConnection(_misConnection))