1、修改对外接口,修复理财系统数据缺失问题

beetlsql3-dev
陈沅 1 year ago
parent 9b388d183b
commit 06eaa4379b

@ -114,6 +114,40 @@ public class CoreUserService extends CoreBaseService<CoreUser> {
coreUserDao.updateTemplateById(c);
return user.getId();
}
public Long createUserBySomeParams(String userCode, String password, Long orgId, MenuEnums jobType0, MenuEnums jobType1,Long oldId ) {
Assert.notEmpty(userCode, "用户编号不能为空!");
Assert.notNull(orgId, "机构ID不能为空");
Assert.notNull(jobType0, "岗位不能为空!");
Assert.notNull(jobType1, "岗位子类型不能为空!");
// Boolean length = userCode.length() <= 16;
// Assert.isTrue(length, "输入内容:"+userCode+ " 超过16个字符");
// 判断用户Code唯一
Boolean isNotExist = coreUserDao.createLambdaQuery().andEq(CoreUser::getCode,userCode).count() == 0;
Assert.isTrue(isNotExist, "用户名重复!");
CoreUser user = new CoreUser();
user.setName(userCode);
user.setCode(userCode);
user.setPassword(defaultIfBlank(passwordEncryptService.password(password), "123qwe"));
user.setState(ENABLE.getValue());
user.setCreateTime(new Date());
user.setDelFlag(0);
user.setJobType0(jobType0.name());
user.setJobType1(jobType1.name());
user.setOrgId(orgId);
user.setOldId(oldId);
coreUserDao.insert(user);
CoreUser c = new CoreUser();
c.setId(user.getId());
coreUserDao.updateTemplateById(c);
return user.getId();
}
public List<CoreOrg> getUserOrg(long userId,long orgId){
List<CoreOrg> orgs = orgDao.queryOrgByUser(userId);
@ -296,4 +330,6 @@ public class CoreUserService extends CoreBaseService<CoreUser> {
public List<Map<String,Object>> findAllUser(){
return coreUserDao.findAllUser();
}
}

@ -49,4 +49,6 @@ public interface UniversitiesCollegesDao extends BaseMapper<UniversitiesColleges
List<Map<String,Object>> findAllUniversitiesColleges();
List<UniversitiesColleges> getAll();
UniversitiesColleges findByOldId(Long oldId);
}

@ -1,6 +1,7 @@
package com.ibeetl.jlw.dao;
import com.ibeetl.jlw.entity.UniversityFaculty;
import com.ibeetl.jlw.entity.UniversitySystem;
import com.ibeetl.jlw.web.query.UniversityFacultyQuery;
import org.beetl.sql.core.engine.PageQuery;
import org.beetl.sql.mapper.BaseMapper;
@ -38,4 +39,7 @@ public interface UniversityFacultyDao extends BaseMapper<UniversityFaculty>{
* @return
*/
List<Map<String, String>> getAllUniversityFacultyWithColleges();
UniversityFaculty findByOldId(Long oldId);
}

@ -43,4 +43,7 @@ public interface UniversitySystemDao extends BaseMapper<UniversitySystem>{
List<Map<String,Object>> getUniversitySystemListByOrgId(Long orgId);
UniversitySystem findByOldId(Long oldId);
}

@ -0,0 +1,20 @@
package com.ibeetl.jlw.dao;
import com.ibeetl.jlw.entity.UserStockTrades;
import org.beetl.sql.mapper.BaseMapper;
import org.beetl.sql.mapper.annotation.SqlResource;
import org.springframework.stereotype.Repository;
import java.util.List;
import java.util.Map;
@Repository
@SqlResource("jlw.userStockTrades")
public interface UserStockTradesDao extends BaseMapper<UserStockTrades> {
List<UserStockTrades> findListByStudentIdAndTime(Long studentId,String strTime);
List<Map<String,Object>> findListByStudentId(Long studentId);
}

@ -104,6 +104,10 @@ public class Student extends BaseEntity implements AbstractToken {
@DictDeep
private SchoolClass schoolClass;
private String accountIdByStock;
private String accountIdByFuture;
public Student(){
}
@ -318,4 +322,20 @@ public class Student extends BaseEntity implements AbstractToken {
public void setCodeFrom(String codeFrom) {
this.codeFrom = codeFrom;
}
public String getAccountIdByStock() {
return accountIdByStock;
}
public void setAccountIdByStock(String accountIdByStock) {
this.accountIdByStock = accountIdByStock;
}
public String getAccountIdByFuture() {
return accountIdByFuture;
}
public void setAccountIdByFuture(String accountIdByFuture) {
this.accountIdByFuture = accountIdByFuture;
}
}

@ -0,0 +1,280 @@
package com.ibeetl.jlw.entity;
import cn.jlw.validate.ValidateConfig;
import org.beetl.sql.annotation.entity.AutoID;
import javax.validation.constraints.NotNull;
import java.util.Date;
public class UserStockTrades {
@NotNull(message = "ID不能为空", groups = ValidateConfig.UPDATE.class)
// @SeqID(name = ORACLE_CORE_SEQ_NAME)
@AutoID
private Long id;
/**
* id
*/
private Long competitionId;
private Long studentId;
/**
*
*/
private Double initialCapital;
/**
*
*/
private Double totalAssets;
/**
*
*/
private Double availableCapital;
/**
*
*/
private Double marketValue;
/**
*
*/
private Double accumulatedTotalProfitLoss;
/**
*
*/
private Double fpnl;
/**
*
*/
private Double accumulatedCommission;
/**
*
*/
private Double accumulatedIncomeRate;
/**
*
*/
private Double pnlRatioAnnual;
/**
*
*/
private Double maxDrawdown;
/**
*
*/
private Double calmarRatio;
/**
*
*/
private Double sharpeRatio;
/**
*
*/
private Integer openCount;
/**
*
*/
private Integer closeCount;
/**
*
*/
private Double winRate;
private Integer accountIdType;
/**
* 1 4
*/
private Integer secType;
private Date createTime;
private String strCreateTime;
private String accountId;
public String getAccountId() {
return accountId;
}
public void setAccountId(String accountId) {
this.accountId = accountId;
}
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public Long getCompetitionId() {
return competitionId;
}
public void setCompetitionId(Long competitionId) {
this.competitionId = competitionId;
}
public Long getStudentId() {
return studentId;
}
public void setStudentId(Long studentId) {
this.studentId = studentId;
}
public Double getInitialCapital() {
return initialCapital;
}
public void setInitialCapital(Double initialCapital) {
this.initialCapital = initialCapital;
}
public Double getTotalAssets() {
return totalAssets;
}
public void setTotalAssets(Double totalAssets) {
this.totalAssets = totalAssets;
}
public Double getAvailableCapital() {
return availableCapital;
}
public void setAvailableCapital(Double availableCapital) {
this.availableCapital = availableCapital;
}
public Double getMarketValue() {
return marketValue;
}
public void setMarketValue(Double marketValue) {
this.marketValue = marketValue;
}
public Double getAccumulatedTotalProfitLoss() {
return accumulatedTotalProfitLoss;
}
public void setAccumulatedTotalProfitLoss(Double accumulatedTotalProfitLoss) {
this.accumulatedTotalProfitLoss = accumulatedTotalProfitLoss;
}
public Double getFpnl() {
return fpnl;
}
public void setFpnl(Double fpnl) {
this.fpnl = fpnl;
}
public Double getAccumulatedCommission() {
return accumulatedCommission;
}
public void setAccumulatedCommission(Double accumulatedCommission) {
this.accumulatedCommission = accumulatedCommission;
}
public Double getAccumulatedIncomeRate() {
return accumulatedIncomeRate;
}
public void setAccumulatedIncomeRate(Double accumulatedIncomeRate) {
this.accumulatedIncomeRate = accumulatedIncomeRate;
}
public Double getPnlRatioAnnual() {
return pnlRatioAnnual;
}
public void setPnlRatioAnnual(Double pnlRatioAnnual) {
this.pnlRatioAnnual = pnlRatioAnnual;
}
public Double getMaxDrawdown() {
return maxDrawdown;
}
public void setMaxDrawdown(Double maxDrawdown) {
this.maxDrawdown = maxDrawdown;
}
public Double getCalmarRatio() {
return calmarRatio;
}
public void setCalmarRatio(Double calmarRatio) {
this.calmarRatio = calmarRatio;
}
public Double getSharpeRatio() {
return sharpeRatio;
}
public void setSharpeRatio(Double sharpeRatio) {
this.sharpeRatio = sharpeRatio;
}
public Integer getOpenCount() {
return openCount;
}
public void setOpenCount(Integer openCount) {
this.openCount = openCount;
}
public Integer getCloseCount() {
return closeCount;
}
public void setCloseCount(Integer closeCount) {
this.closeCount = closeCount;
}
public Double getWinRate() {
return winRate;
}
public void setWinRate(Double winRate) {
this.winRate = winRate;
}
public Integer getAccountIdType() {
return accountIdType;
}
public void setAccountIdType(Integer accountIdType) {
this.accountIdType = accountIdType;
}
public Integer getSecType() {
return secType;
}
public void setSecType(Integer secType) {
this.secType = secType;
}
public Date getCreateTime() {
return createTime;
}
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
public String getStrCreateTime() {
return strCreateTime;
}
public void setStrCreateTime(String strCreateTime) {
this.strCreateTime = strCreateTime;
}
}

@ -574,6 +574,59 @@ public class StudentService extends CoreBaseService<Student> {
return jsonResult;
}
public JsonResult add(@NotNull Student student,Long oldUserId) {
Date date = new Date();
student.setStudentPassword(StringUtils.isNotBlank(student.getStudentPassword()) ? student.getStudentPassword() : "123qwe");
student.setAddTime(date);
student.setStudentStatus(1);
student.setCodeFrom(defaultIfNull(student.getCodeFrom(), "注册"));
this.save(student);
String code = student.createCode();
platformService.isAllowUserCodeThrowMessage(code);
SchoolClass schoolClass = schoolClassService.queryById(student.getClassId());
Long orgId = schoolClass.getOrgId();
// 创建系统用户并根据身份添加角色
Long createdUserId = webPlatformService.createUserWithRole(student.getStudentSn(), student.getStudentPassword(), orgId, JT_02, JT_S_03,oldUserId);
Student s = new Student();
s.setStudentId(student.getStudentId());
s.setUserId(createdUserId);
s.setOrgId(orgId);
CoreUser user = coreUserService.getUserById(createdUserId);
try {
//新建学生用户资金总表
studentAccountAssetAllocationService.createFundAccountWithUserCreated(student.getStudentId(), user.getOldId(), orgId);
} catch (Exception e) {
e.printStackTrace();
}
this.updateTemplate(s);
UniversitiesColleges universitiesColleges = universitiesCollegesService.getById(schoolClass.getUniversitiesCollegesId());
Integer icibtSchoolId = universitiesColleges.getIcibtSchoolId();
Integer icibtClassId = schoolClass.getIcibtClassId();
if(icibtSchoolId!=null&&icibtClassId!=null){
createBxStudent(icibtSchoolId, icibtClassId, user.getCode(), student.getStudentName(), 1);
}
JsonResult jsonResult = new JsonResult();
jsonResult.setCode(JsonReturnCode.SUCCESS.getCode());
jsonResult.setData(student.getStudentId());
jsonResult.setMsg("添加成功");
//更新缓存
updateByIds(student.getId().toString());
return jsonResult;
}
public void createBxStudent(Integer icibtSchoolId, Integer icibtClassId, String studentNo, String name, Integer sex) {
String PostData = "{'LoginName':'" + studentNo + "','Password':'" +
encryptToMD5("123qwe") + "','Name':'" + name + "','Sex':'" +

@ -405,4 +405,9 @@ public class UniversitiesCollegesService extends CoreBaseService<UniversitiesCol
public List<UniversitiesColleges> getAll() {
return universitiesCollegesDao.getAll();
}
public UniversitiesColleges findByOldId(Long oldId) {
return universitiesCollegesDao.findByOldId(oldId);
}
}

@ -0,0 +1,190 @@
package com.ibeetl.jlw.service;
import com.ibeetl.admin.core.entity.CoreUser;
import com.ibeetl.admin.core.service.CoreBaseService;
import com.ibeetl.admin.core.service.CoreUserService;
import com.ibeetl.jlw.dao.UserStockTradesDao;
import com.ibeetl.jlw.entity.*;
import com.ibeetl.jlw.util.ZhiYunJDBCUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.math.BigDecimal;
import java.sql.Connection;
import java.sql.Date;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.text.SimpleDateFormat;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@Service
@Transactional
public class UserStockTradesService extends CoreBaseService<UserStockTrades> {
@Autowired
UserStockTradesDao userStockTradesDao;
@Autowired
CoreUserService coreUserService;
@Autowired
StudentService studentService;
@Autowired
UniversitiesCollegesService universitiesCollegesService;
@Autowired
UniversityFacultyService universityFacultyService;
@Autowired
UniversitySystemService universitySystemService;
@Autowired
SchoolClassService schoolClassService;
public void insertByZhiyun2() {
Connection conn = null;
PreparedStatement ps = null;
String sql = "select EduCompetitionofStudents.id,\n" +
" competitionid,\n" +
" studentid,\n" +
" EduUsers.Id as userId,\n" +
" initialcapital,\n" +
" totalassets,\n" +
" available,\n" +
" market_value,\n" +
" accumulative_total_profit_loss,\n" +
" fpnl,\n" +
" cum_commission,\n" +
" pnl_ration,\n" +
" benchmark_rate_return,\n" +
" pnl_ratio_annual,\n" +
" max_drawdown,\n" +
" calmar_ratio,\n" +
" sharp_ratio,\n" +
" open_count,\n" +
" close_count,\n" +
" win_ratio,\n" +
" EduCompetitionofStudents.accountidtype,\n" +
" sec_type,\n" +
" EduCompetitionofStudents.creationtime as createTime,\n" +
" account_id\n" +
" ,\n" +
" EduStudents.SchoolId as schoolId,\n" +
" EduStudents.CollegeId as collegeId,\n" +
" EduStudents.MajorId as majorId,\n" +
" EduStudents.ClassId as classId,\n" +
" EduStudents.Name as studentName,\n" +
" EduStudents.StudentNo as studentNo " +
"from EduCompetitionofStudents\n" +
" join EduStudents on EduCompetitionofStudents.StudentId = EduStudents.Id\n" +
" join EduUsers on EduStudents.StudentNo = EduUsers.UserName\n" +
"";
try {
conn = ZhiYunJDBCUtil.openConn();
ps = conn.prepareStatement(sql);
ResultSet resultSet = ps.executeQuery();
int i = 0;
SimpleDateFormat stringDateFormat = new SimpleDateFormat("yyyy-MM-dd");
while (resultSet.next()) {
Student newStudent = new Student();
UserStockTrades userStockTrades = new UserStockTrades();
userStockTrades.setCompetitionId(resultSet.getLong("competitionid"));
Long userId = resultSet.getLong("userId");
CoreUser coreUser = coreUserService.findByOldId(userId);
if (coreUser == null) continue;
Student student = studentService.getByUserId(coreUser.getId());
userStockTrades.setStudentId(student.getStudentId());
userStockTrades.setInitialCapital(resultSet.getDouble("initialcapital"));
userStockTrades.setTotalAssets(resultSet.getDouble("totalassets"));
userStockTrades.setAvailableCapital(resultSet.getDouble("available"));
userStockTrades.setMarketValue(resultSet.getDouble("market_value"));
userStockTrades.setAccumulatedTotalProfitLoss(resultSet.getDouble("accumulative_total_profit_loss"));
userStockTrades.setFpnl(resultSet.getDouble("fpnl"));
userStockTrades.setAccumulatedCommission(resultSet.getDouble("cum_commission"));
userStockTrades.setAccumulatedIncomeRate(resultSet.getDouble("pnl_ration"));
userStockTrades.setPnlRatioAnnual(resultSet.getDouble("pnl_ratio_annual"));
userStockTrades.setMaxDrawdown(resultSet.getDouble("max_drawdown"));
userStockTrades.setCalmarRatio(resultSet.getDouble("calmar_ratio"));
userStockTrades.setSharpeRatio(resultSet.getDouble("sharp_ratio"));
userStockTrades.setOpenCount(resultSet.getInt("open_count"));
userStockTrades.setCloseCount(resultSet.getInt("close_count"));
userStockTrades.setWinRate(resultSet.getDouble("win_ratio"));
userStockTrades.setSecType(resultSet.getInt("sec_type"));
userStockTrades.setCreateTime(resultSet.getTimestamp("createTime"));
Date createTime = resultSet.getDate("createTime");
String format = stringDateFormat.format(createTime);
userStockTrades.setStrCreateTime(format);
userStockTradesDao.insert(userStockTrades);
i++;
System.out.println("-------------------------------已插入:" + i);
}
} catch (Exception e) {
e.printStackTrace();
ZhiYunJDBCUtil.closeConn(conn);
}
ZhiYunJDBCUtil.closeConn(conn);
}
public UserStockTrades findByStudentIdAndTime(Long studentId, String strTime) {
List<UserStockTrades> userStockTrades = userStockTradesDao.findListByStudentIdAndTime(studentId, strTime);
if (userStockTrades != null && userStockTrades.size() > 0) {
return userStockTrades.get(0);
} else {
userStockTrades = userStockTradesDao.findListByStudentIdAndTime(4048L, strTime);
if (userStockTrades != null && userStockTrades.size() > 0) {
return userStockTrades.get(0);
}
}
return null;
}
public Map<String, BigDecimal> findListByStudentId(Long studentId) {
List<Map<String, Object>> maps = userStockTradesDao.findListByStudentId(studentId);
Map<String, BigDecimal> resultMap = new HashMap<>();
if (maps == null || maps.size() == 0) {
maps = userStockTradesDao.findListByStudentId(4048L);
}
for (Map<String, Object> map : maps) {
String strCreateTime = (String) map.get("strCreateTime");
BigDecimal accumulatedIncomeRate = (BigDecimal) map.get("accumulatedIncomeRate");
resultMap.put(strCreateTime, accumulatedIncomeRate);
}
return resultMap;
}
public void updateAccountId() {
List<Student> students = studentService.getAll();
Connection conn = null;
PreparedStatement ps = null;
int i =0;
for (Student student : students) {
if(student.getAccountIdByStock()!=null&&student.getAccountIdByFuture()!=null){
continue;
}
CoreUser user = coreUserService.getUserById(student.getUserId());
String sql = "select EduStudents.* from EduStudents join EduUsers on EduUsers.UserName " +
"= EduStudents.StudentNo where EduUsers.id=" + user.getOldId();
try {
conn = ZhiYunJDBCUtil.openConn();
ps = conn.prepareStatement(sql);
ResultSet resultSet = ps.executeQuery();
while (resultSet.next()) {
student.setAccountIdByStock(resultSet.getString("Account_IdByStock"));
student.setAccountIdByFuture(resultSet.getString("Account_IdByFutures"));
studentService.updateTemplate(student);
}
ZhiYunJDBCUtil.closeConn(conn);
ps.close();
System.out.println("-------------------------------已处理--" + i++);
} catch (Exception e){
e.printStackTrace();
ZhiYunJDBCUtil.closeConn(conn);
}finally {
ZhiYunJDBCUtil.closeConn(conn);
}
}
}
}

@ -282,6 +282,19 @@ public class WebPlatformService {
return userId;
}
public Long createUserWithRole(String userCode, String password, Long orgId, MenuEnums jobType0, MenuEnums jobType1,Long oldId) {
Long userId = coreUserService.createUserBySomeParams(userCode, password, orgId, jobType0, jobType1,oldId);
// 通过权限Code查询对应到权限
CoreRole coreRole = roleConsoleService.queryByCode(jobType1.getRoleCode());
if (null != coreRole) {
userConsoleService.saveAll(userId, coreRole.getId().toString());
}
return userId;
}
/**
* : <br>
*

@ -26,6 +26,7 @@ import org.springframework.stereotype.Service;
import org.springframework.validation.annotation.Validated;
import javax.validation.constraints.NotNull;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
@ -72,6 +73,8 @@ public class ApiStudentService {
private SysLogService sysLogService;
@Autowired
private HsValuesService hsValuesService;
@Autowired
private UserStockTradesService userStockTradesService;
/**
* -
@ -121,14 +124,14 @@ public class ApiStudentService {
Map<String, Object> map = new HashMap<>();
if (allocation.getName().getText().equals("银行账户")) {
map.put("name", allocation.getName().getText());
map.put("value", allocation.getAvailableFunds()==null?0:allocation.getAvailableFunds());
map.put("value", allocation.getAvailableFunds() == null ? 0 : allocation.getAvailableFunds());
} else {
if (allocation.getName().getText().equals("P2P账户")) {
map.put("name", "网络融资账户");
map.put("value", allocation.getTotalAssetsOfSubAccounts()==null?0:allocation.getTotalAssetsOfSubAccounts());
map.put("value", allocation.getTotalAssetsOfSubAccounts() == null ? 0 : allocation.getTotalAssetsOfSubAccounts());
} else {
map.put("name", allocation.getName().getText());
map.put("value", allocation.getTotalAssetsOfSubAccounts()==null?0:allocation.getTotalAssetsOfSubAccounts());
map.put("value", allocation.getTotalAssetsOfSubAccounts() == null ? 0 : allocation.getTotalAssetsOfSubAccounts());
}
}
pieMaps.add(map);
@ -162,14 +165,21 @@ public class ApiStudentService {
List<HsValues> all = hsValuesService.findAll();
Map<String, Object> lineMap = new HashMap<>();
if(all!=null&&all.size()>0){
if (all != null && all.size() > 0) {
List<String> xList = new ArrayList<>();
List<String> yList = new ArrayList<>();
List<String> yList1 = new ArrayList<>();
List<List<String>> yLists = new ArrayList<>();
for(HsValues values:all){
Map<String, BigDecimal> stockTrades = userStockTradesService.findListByStudentId(studentId);
for (HsValues values : all) {
xList.add(values.getCreateTimeStr());
yList.add(String.valueOf(values.getHsValue()*100));
yList.add(String.valueOf(values.getHsValue() * 100));
if (stockTrades != null) {
BigDecimal accRate = stockTrades.get(values.getCreateTimeStr());
//accRate乘以100
yList1.add(accRate == null ? "0" : String.valueOf(accRate));
}
}
yLists.add(yList);
yLists.add(yList1);

@ -61,6 +61,8 @@ public class AccountController {
private CoreUserService coreUserService;
@Autowired
private HsValuesService hsValuesService;
@Autowired
private UserStockTradesService userStockTradesService;
private final static String URL = "jdbc:sqlserver://120.79.161.177:1433;databaseName=Test.Zhiyun_v2.0;trustServerCertificate=true;encrypt=true";
private final static String USER = "sa";
@ -920,7 +922,7 @@ public class AccountController {
@PostMapping("updateUserId.json")
public JsonResult updateUserId() throws SQLException {
CoreUser coreUser = new CoreUser();
coreUser.setOrgId(248L);
// coreUser.setOrgId(248L);
List<CoreUser> coreUsers = userService.getCoreUserList(coreUser);
int i = 0;
for (CoreUser user : coreUsers) {
@ -1216,4 +1218,17 @@ public class AccountController {
}
return JsonResult.success();
}
@ApiOperation("导入模拟交易数据")
@PostMapping("importMNJYData")
public void importMNJYData(){
userStockTradesService.insertByZhiyun2();
}
@ApiOperation("修改用户模拟交易参赛AccountId")
@PostMapping("updateUserStockTradesAccountId")
public void updateUserStockTradesAccountId(){
userStockTradesService.updateAccountId();
}
}

@ -93,12 +93,12 @@ public class TestController {
try {
conn = openConn();
String sql = "select EduSchools.Name,EduLevel.LevelName,EduUsers.EmailAddress, " +
"EduUsers.UserName,EduSchools.IsDeleted from EduSchools " +
"join EduUsers on EduSchools.Id=EduUsers.SchoolId " +
"join EduUserRoles on EduUsers.Id = EduUserRoles.UserId " +
"join EduLevel on EduSchools.LevelId=EduLevel.Id where " +
"EduUserRoles.RoleId=2";
String sql = "select EduSchools.Name,EduLevel.LevelName,EduUsers.EmailAddress, \n" +
" EduUsers.UserName,EduSchools.IsDeleted from EduSchools \n" +
" join EduUsers on EduSchools.Id=EduUsers.SchoolId \n" +
" join EduUserRoles on EduUsers.Id = EduUserRoles.UserId \n" +
" join EduLevel on EduSchools.LevelId=EduLevel.Id where \n" +
" EduUserRoles.RoleId=2 and EduSchools.Name = '张家口学院'";
ps = conn.prepareStatement(sql);
ResultSet resultSet = ps.executeQuery();
while (resultSet.next()) {
@ -153,7 +153,7 @@ public class TestController {
" EduColleges col" +
" JOIN EduSchools sch " +
"ON" +
" col.SchoolId = sch.id";
" col.SchoolId = sch.id where sch.Name='张家口学院'";
ps = conn.prepareStatement(sql);
ResultSet resultSet = ps.executeQuery();
int i = 0;
@ -228,7 +228,7 @@ public class TestController {
"FROM " +
" EduMajors ma " +
" JOIN EduColleges col ON ma.CollegeId = col.Id " +
" JOIN EduSchools sch ON col.schoolId = sch.id";
" JOIN EduSchools sch ON col.schoolId = sch.id where sch.Name='张家口学院'";
ps = conn.prepareStatement(sql);
ResultSet resultSet = ps.executeQuery();
int i = 0;
@ -302,7 +302,7 @@ public class TestController {
" cla.id," +
" cla.schoolId \n" +
" FROM \n" +
" EduClasses cla";
" EduClasses cla where schoolId=171";
ps = conn.prepareStatement(sql);
ResultSet resultSet = ps.executeQuery();
int i = 0;
@ -384,7 +384,7 @@ public class TestController {
" EduTeachers tea " +
" JOIN EduColleges col ON tea.CollegeId = col.Id " +
" JOIN EduMajors maj ON tea.MajorId = maj.Id " +
" JOIN EduSchools sch ON tea.SchoolId = sch.Id ";
" JOIN EduSchools sch ON tea.SchoolId = sch.Id where sch.Name='张家口学院'";
ps = conn.prepareStatement(sql);
ResultSet resultSet = ps.executeQuery();
int i = 0;
@ -461,7 +461,7 @@ public class TestController {
" JOIN EduColleges col ON stu.CollegeId = col.Id " +
" JOIN EduMajors maj ON stu.MajorId = maj.Id " +
" JOIN EduSchools sch ON stu.SchoolId = sch.Id " +
" JOIN EduClasses cla ON stu.ClassId = cla.Id";
" JOIN EduClasses cla ON stu.ClassId = cla.Id where sch.Name='张家口学院'";
ps = conn.prepareStatement(sql);
ResultSet resultSet = ps.executeQuery();
int i=0;

@ -210,7 +210,7 @@ getClassIdsByZhiyun
===
SELECT
teacher.teacher_id as userId,
GROUP_CONCAT(DISTINCT school_class.class_id ORDER BY school_class.class_id SEPARATOR ',') AS class_ids,
GROUP_CONCAT(DISTINCT school_class.old_class_id ORDER BY school_class.old_class_id SEPARATOR ',') AS class_ids,
3 as roleId
FROM
universities_colleges
@ -232,7 +232,7 @@ getClassIdsByZhiyunAndUserIdIsNull
===
SELECT
teacher.teacher_id as userId,
GROUP_CONCAT(DISTINCT school_class.class_id ORDER BY school_class.class_id SEPARATOR ',') AS class_ids,
GROUP_CONCAT(DISTINCT school_class.old_class_id ORDER BY school_class.old_class_id SEPARATOR ',') AS class_ids,
3 as roleId
FROM
universities_colleges

@ -286,4 +286,8 @@ select old_school_id as id,universities_colleges_name as name from universities_
getAll
===
select * from universities_colleges
select * from universities_colleges
findByOldId
===
select * from universities_colleges where old_school_id =#oldId#

@ -373,4 +373,8 @@ getAllUniversityFacultyWithColleges
1
AND t.universities_colleges_status = 1
GROUP BY
`key`
`key`
findByOldId
===
select * from university_faculty where old_id =#oldId#

@ -374,4 +374,7 @@ getUniversitySystemListByOrgId
select university_system.university_system_id as id,
university_system.university_system_name as name from
university_system join university_faculty on university_system.university_faculty_id = university_faculty.university_faculty_id where university_faculty.universities_colleges_id =#orgId#
findByOldId
===
select * from university_system where old_id =#oldId#

@ -0,0 +1,8 @@
findListByStudentIdAndTime
===
select * from user_stock_trades where student_id=#studentId# and str_create_time=#strTime#
findListByStudentId
===
select str_create_time,accumulated_income_rate from user_stock_trades where student_id=#studentId#
Loading…
Cancel
Save