修改实务认知得分和智能评分规则

master
xiaoCJ 7 months ago
parent ceb1613f62
commit a8ac1aa1ad

@ -132,7 +132,7 @@ public class TokenProvider {
//生成智云平台32字节密钥
public static void main(String[] args) {
getJWTUserByZhiYun("eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJjb2xsZWdlIjoi5ryU56S65a2m6ZmiIiwiaWNpYnRTY2hvb2xJZCI6NCwibWQ1UHdkIjoiNDYtRjktNEMtOEQtRTEtNEYtQjMtNjYtODAtODUtMDctNjgtRkYtMUItN0YtMkEiLCJyb2xlaWQiOiI0Iiwic2V4Ijoi55S3IiwidXNlcklkIjoiNDkyIiwic3R1ZGVudElkIjoiNDA1MSIsInBhc3N3b3JkIjoiMTIzcXdlIiwiY2xhc3NJZCI6IjIxNiIsImljaWJ0Q2xhc3NJZCI6MjA5LCJtYWpvciI6IuS6p-WTgea8lOekuuS4k-S4miIsInNjaG9vbCI6IuWkqeaLqeWkp-WtpiIsInNjaG9vbElkIjoiMjMyIiwibmFtZSI6InR6czAwNiIsInN0dWRlbnRObyI6InR6czAwNiIsImFwcGxpY2F0aW9uSWQiOiIxMjIiLCJjbGFzcyI6IuWkqeaLqea8lOekujbnj60iLCJ1c2VybmFtZSI6InR6czAwNiJ9.P6EmI0cQoAZwuoPJrwRjtjZNSCANUtxcRebQTtm0HOI");
getJWTUserByZhiYun("eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJjb2xsZWdlIjoi5ryU56S65a2m6ZmiIiwiaWNpYnRTY2hvb2xJZCI6NCwibWQ1UHdkIjoiNDYtRjktNEMtOEQtRTEtNEYtQjMtNjYtODAtODUtMDctNjgtRkYtMUItN0YtMkEiLCJyb2xlaWQiOiI0Iiwic2V4Ijoi55S3IiwidXNlcklkIjoiNDkyIiwic3R1ZGVudElkIjoiNDA1MSIsInBhc3N3b3JkIjoiMTIzcXdlIiwiY2xhc3NJZCI6IjIxNiIsImljaWJ0Q2xhc3NJZCI6MjA5LCJtYWpvciI6IuS6p-WTgea8lOekuuS4k-S4miIsInNjaG9vbCI6IuWkqeaLqeWkp-WtpiIsInNjaG9vbElkIjoiMjMyIiwibmFtZSI6InR6czAwNiIsInN0dWRlbnRObyI6InR6czAwNiIsImFwcGxpY2F0aW9uSWQiOiIxMjIiLCJjbGFzcyI6IuWkqeaLqea8lOekujbnj60iLCJ1c2VybmFtZSI6InR6czAwNiJ9.252uWMvke17Es1P82g3xHMTx6yfAGKt0jU3Q0TJC_9I");
// String prefix = "zy_wh_mnjy_";
// String generatedKey = generateKey(prefix);
// System.out.println("Generated Key: " + generatedKey);

@ -7,10 +7,7 @@ import com.sztzjy.fund_investment.config.exception.UnAuthorizedException;
import com.sztzjy.fund_investment.config.security.JwtUser;
import com.sztzjy.fund_investment.config.security.LoginResult;
import com.sztzjy.fund_investment.config.security.TokenProvider;
import com.sztzjy.fund_investment.entity.Flow;
import com.sztzjy.fund_investment.entity.PerformanceScore;
import com.sztzjy.fund_investment.entity.PerformanceScoreExample;
import com.sztzjy.fund_investment.entity.User;
import com.sztzjy.fund_investment.entity.*;
import com.sztzjy.fund_investment.entity.dto.EvaluationLevel;
import com.sztzjy.fund_investment.entity.dto.PerformanceTrainingScoreDto;
import com.sztzjy.fund_investment.mapper.FlowMapper;
@ -31,10 +28,7 @@ import org.springframework.security.authentication.UsernamePasswordAuthenticatio
import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder;
import org.springframework.security.core.Authentication;
import org.springframework.security.core.context.SecurityContextHolder;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import java.lang.reflect.Field;
@ -218,7 +212,7 @@ public class UserController {
flow1.setFlowId(uuid);
flowMapper.insert(flow1);
map.put("flowId", uuid);
}else {
} else {
map.put("flowId", flow.getFlowId());
}
return new ResultEntity(HttpStatus.OK, map);
@ -226,6 +220,47 @@ public class UserController {
}
@ApiOperation("根据用户Code查询该用户是否存在个人赛用户数据存在则返回不存在则新增后返回用于智云3.0创建用户后调用该接口创建用户个人赛")
@PostMapping("/checkOrCreateForexSimulationUser")
@AnonymousAccess
public String checkOrCreateForexSimulationUser(@RequestBody List<ZYUserInfo> zyUserInfoList) {
List<User> users = new ArrayList<>();
for (int i = 0; i < zyUserInfoList.size(); i++) {
ZYUserInfo zyUserInfo = zyUserInfoList.get(i);
Integer zyUserId = zyUserInfo.getUserId();
String username = zyUserInfo.getUsername(); // studentid
User user = userMapper.selectByPrimaryKey(String.valueOf(zyUserId));
if (user != null) {
continue;
}
User stuUser = new User();
stuUser.setUserid(String.valueOf(zyUserId));
stuUser.setStudentId(zyUserInfo.getUsername());
stuUser.setName(zyUserInfo.getName());
stuUser.setUsername(username);
stuUser.setClassId(zyUserInfo.getClassId().toString());
stuUser.setClassName(zyUserInfo.getClassName());
stuUser.setPassword(zyUserInfo.getPassword());
stuUser.setPhone(zyUserInfo.getPhone());
stuUser.setRoleId( zyUserInfo.getRoleId()); //3教师 4学生
stuUser.setSchoolId(zyUserInfo.getSchoolId().toString());
stuUser.setSchoolName(zyUserInfo.getSchoolName());
stuUser.setCreateTime(new Date());
users.add(stuUser);
}
if (users.isEmpty()) {
return "账号已全部存在";
}
try {
userMapper.batchInsertStudents(users);
return "ok";
} catch (Exception e) {
e.printStackTrace();
return "false";
}
}
/* MAPflow
* @author xcj
* @Date 2024/1/3

@ -0,0 +1,25 @@
package com.sztzjy.fund_investment.entity;
import lombok.Data;
/**
* @Author xcj
* @Date 2024/8/7
*/
@Data
public class ZYUserInfo {
private String username;
private String password;
private String name;
private Integer userId;
private Integer roleId;
private Integer schoolId;
private String schoolName;
private Integer classId;
private String className;
private String phone;
private Long collegeId;
private String collegeName;
private Long majorId;
private String majorName;
}

@ -41,4 +41,5 @@ public interface UserMapper {
List<UserDto>getStudentScoreDetails(@Param("schoolId") String schoolId, @Param("classId")String classId, @Param("studentIdOrName")String studentIdOrName);
void batchInsertStudents(@Param("list") List<User> users);
}

@ -1,434 +1,453 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.sztzjy.fund_investment.mapper.UserMapper">
<resultMap id="BaseResultMap" type="com.sztzjy.fund_investment.entity.User">
<id column="userid" jdbcType="VARCHAR" property="userid" />
<result column="name" jdbcType="VARCHAR" property="name" />
<result column="student_id" jdbcType="VARCHAR" property="studentId" />
<result column="class_name" jdbcType="VARCHAR" property="className" />
<result column="class_id" jdbcType="VARCHAR" property="classId" />
<result column="username" jdbcType="VARCHAR" property="username" />
<result column="password" jdbcType="VARCHAR" property="password" />
<result column="phone" jdbcType="VARCHAR" property="phone" />
<result column="role_id" jdbcType="INTEGER" property="roleId" />
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
<result column="school_id" jdbcType="VARCHAR" property="schoolId" />
<result column="school_name" jdbcType="VARCHAR" property="schoolName" />
<result column="un" jdbcType="VARCHAR" property="un" />
<result column="dis" jdbcType="VARCHAR" property="dis" />
<result column="access_token" jdbcType="VARCHAR" property="accessToken" />
<result column="login_type" jdbcType="INTEGER" property="loginType" />
</resultMap>
<sql id="Example_Where_Clause">
<where>
<foreach collection="oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
#{listItem}
</foreach>
</when>
</choose>
<resultMap id="BaseResultMap" type="com.sztzjy.fund_investment.entity.User">
<id column="userid" jdbcType="VARCHAR" property="userid"/>
<result column="name" jdbcType="VARCHAR" property="name"/>
<result column="student_id" jdbcType="VARCHAR" property="studentId"/>
<result column="class_name" jdbcType="VARCHAR" property="className"/>
<result column="class_id" jdbcType="VARCHAR" property="classId"/>
<result column="username" jdbcType="VARCHAR" property="username"/>
<result column="password" jdbcType="VARCHAR" property="password"/>
<result column="phone" jdbcType="VARCHAR" property="phone"/>
<result column="role_id" jdbcType="INTEGER" property="roleId"/>
<result column="create_time" jdbcType="TIMESTAMP" property="createTime"/>
<result column="school_id" jdbcType="VARCHAR" property="schoolId"/>
<result column="school_name" jdbcType="VARCHAR" property="schoolName"/>
<result column="un" jdbcType="VARCHAR" property="un"/>
<result column="dis" jdbcType="VARCHAR" property="dis"/>
<result column="access_token" jdbcType="VARCHAR" property="accessToken"/>
<result column="login_type" jdbcType="INTEGER" property="loginType"/>
</resultMap>
<sql id="Example_Where_Clause">
<where>
<foreach collection="oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="("
separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Update_By_Example_Where_Clause">
<where>
<foreach collection="example.oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
#{listItem}
</foreach>
</when>
</choose>
</where>
</sql>
<sql id="Update_By_Example_Where_Clause">
<where>
<foreach collection="example.oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="("
separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Base_Column_List">
userid, name, student_id, class_name, class_id, username, password, phone, role_id,
</where>
</sql>
<sql id="Base_Column_List">
userid
, name, student_id, class_name, class_id, username, password, phone, role_id,
create_time, school_id, school_name, un, dis, access_token, login_type
</sql>
</sql>
<select id="selectByUn" parameterType="java.lang.String" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from wx_user
where un = #{un,jdbcType=VARCHAR}
</select>
<select id="selectByUn" parameterType="java.lang.String" resultMap="BaseResultMap">
select
<include refid="Base_Column_List"/>
from wx_user
where un = #{un,jdbcType=VARCHAR}
</select>
<select id="selectByExample" parameterType="com.sztzjy.fund_investment.entity.UserExample" resultMap="BaseResultMap">
select
<if test="distinct">
distinct
</if>
<include refid="Base_Column_List" />
from wx_user
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
<if test="orderByClause != null">
order by ${orderByClause}
</if>
</select>
<select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from wx_user
where userid = #{userid,jdbcType=VARCHAR}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.String">
delete from wx_user
where userid = #{userid,jdbcType=VARCHAR}
</delete>
<delete id="deleteByExample" parameterType="com.sztzjy.fund_investment.entity.UserExample">
delete from wx_user
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</delete>
<insert id="insert" parameterType="com.sztzjy.fund_investment.entity.User">
insert into wx_user (userid, name, student_id,
class_name, class_id, username,
password, phone, role_id,
create_time, school_id, school_name,
un, dis, access_token,
login_type)
values (#{userid,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, #{studentId,jdbcType=VARCHAR},
#{className,jdbcType=VARCHAR}, #{classId,jdbcType=VARCHAR}, #{username,jdbcType=VARCHAR},
#{password,jdbcType=VARCHAR}, #{phone,jdbcType=VARCHAR}, #{roleId,jdbcType=INTEGER},
#{createTime,jdbcType=TIMESTAMP}, #{schoolId,jdbcType=VARCHAR}, #{schoolName,jdbcType=VARCHAR},
#{un,jdbcType=VARCHAR}, #{dis,jdbcType=VARCHAR}, #{accessToken,jdbcType=VARCHAR},
#{loginType,jdbcType=INTEGER})
</insert>
<insert id="insertSelective" parameterType="com.sztzjy.fund_investment.entity.User">
insert into wx_user
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="userid != null">
userid,
</if>
<if test="name != null">
name,
</if>
<if test="studentId != null">
student_id,
</if>
<if test="className != null">
class_name,
</if>
<if test="classId != null">
class_id,
</if>
<if test="username != null">
username,
</if>
<if test="password != null">
password,
</if>
<if test="phone != null">
phone,
</if>
<if test="roleId != null">
role_id,
</if>
<if test="createTime != null">
create_time,
</if>
<if test="schoolId != null">
school_id,
</if>
<if test="schoolName != null">
school_name,
</if>
<if test="un != null">
un,
</if>
<if test="dis != null">
dis,
</if>
<if test="accessToken != null">
access_token,
</if>
<if test="loginType != null">
login_type,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="userid != null">
#{userid,jdbcType=VARCHAR},
</if>
<if test="name != null">
#{name,jdbcType=VARCHAR},
</if>
<if test="studentId != null">
#{studentId,jdbcType=VARCHAR},
</if>
<if test="className != null">
#{className,jdbcType=VARCHAR},
</if>
<if test="classId != null">
#{classId,jdbcType=VARCHAR},
</if>
<if test="username != null">
#{username,jdbcType=VARCHAR},
</if>
<if test="password != null">
#{password,jdbcType=VARCHAR},
</if>
<if test="phone != null">
#{phone,jdbcType=VARCHAR},
</if>
<if test="roleId != null">
#{roleId,jdbcType=INTEGER},
</if>
<if test="createTime != null">
#{createTime,jdbcType=TIMESTAMP},
</if>
<if test="schoolId != null">
#{schoolId,jdbcType=VARCHAR},
</if>
<if test="schoolName != null">
#{schoolName,jdbcType=VARCHAR},
</if>
<if test="un != null">
#{un,jdbcType=VARCHAR},
</if>
<if test="dis != null">
#{dis,jdbcType=VARCHAR},
</if>
<if test="accessToken != null">
#{accessToken,jdbcType=VARCHAR},
</if>
<if test="loginType != null">
#{loginType,jdbcType=INTEGER},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="com.sztzjy.fund_investment.entity.UserExample" resultType="java.lang.Long">
select count(*) from wx_user
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</select>
<update id="updateByExampleSelective" parameterType="map">
update wx_user
<set>
<if test="record.userid != null">
userid = #{record.userid,jdbcType=VARCHAR},
</if>
<if test="record.name != null">
<select id="selectByExample" parameterType="com.sztzjy.fund_investment.entity.UserExample"
resultMap="BaseResultMap">
select
<if test="distinct">
distinct
</if>
<include refid="Base_Column_List"/>
from wx_user
<if test="_parameter != null">
<include refid="Example_Where_Clause"/>
</if>
<if test="orderByClause != null">
order by ${orderByClause}
</if>
</select>
<select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="BaseResultMap">
select
<include refid="Base_Column_List"/>
from wx_user
where userid = #{userid,jdbcType=VARCHAR}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.String">
delete
from wx_user
where userid = #{userid,jdbcType=VARCHAR}
</delete>
<delete id="deleteByExample" parameterType="com.sztzjy.fund_investment.entity.UserExample">
delete from wx_user
<if test="_parameter != null">
<include refid="Example_Where_Clause"/>
</if>
</delete>
<insert id="insert" parameterType="com.sztzjy.fund_investment.entity.User">
insert into wx_user (userid, name, student_id,
class_name, class_id, username,
password, phone, role_id,
create_time, school_id, school_name,
un, dis, access_token,
login_type)
values (#{userid,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, #{studentId,jdbcType=VARCHAR},
#{className,jdbcType=VARCHAR}, #{classId,jdbcType=VARCHAR}, #{username,jdbcType=VARCHAR},
#{password,jdbcType=VARCHAR}, #{phone,jdbcType=VARCHAR}, #{roleId,jdbcType=INTEGER},
#{createTime,jdbcType=TIMESTAMP}, #{schoolId,jdbcType=VARCHAR}, #{schoolName,jdbcType=VARCHAR},
#{un,jdbcType=VARCHAR}, #{dis,jdbcType=VARCHAR}, #{accessToken,jdbcType=VARCHAR},
#{loginType,jdbcType=INTEGER})
</insert>
<insert id="insertSelective" parameterType="com.sztzjy.fund_investment.entity.User">
insert into wx_user
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="userid != null">
userid,
</if>
<if test="name != null">
name,
</if>
<if test="studentId != null">
student_id,
</if>
<if test="className != null">
class_name,
</if>
<if test="classId != null">
class_id,
</if>
<if test="username != null">
username,
</if>
<if test="password != null">
password,
</if>
<if test="phone != null">
phone,
</if>
<if test="roleId != null">
role_id,
</if>
<if test="createTime != null">
create_time,
</if>
<if test="schoolId != null">
school_id,
</if>
<if test="schoolName != null">
school_name,
</if>
<if test="un != null">
un,
</if>
<if test="dis != null">
dis,
</if>
<if test="accessToken != null">
access_token,
</if>
<if test="loginType != null">
login_type,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="userid != null">
#{userid,jdbcType=VARCHAR},
</if>
<if test="name != null">
#{name,jdbcType=VARCHAR},
</if>
<if test="studentId != null">
#{studentId,jdbcType=VARCHAR},
</if>
<if test="className != null">
#{className,jdbcType=VARCHAR},
</if>
<if test="classId != null">
#{classId,jdbcType=VARCHAR},
</if>
<if test="username != null">
#{username,jdbcType=VARCHAR},
</if>
<if test="password != null">
#{password,jdbcType=VARCHAR},
</if>
<if test="phone != null">
#{phone,jdbcType=VARCHAR},
</if>
<if test="roleId != null">
#{roleId,jdbcType=INTEGER},
</if>
<if test="createTime != null">
#{createTime,jdbcType=TIMESTAMP},
</if>
<if test="schoolId != null">
#{schoolId,jdbcType=VARCHAR},
</if>
<if test="schoolName != null">
#{schoolName,jdbcType=VARCHAR},
</if>
<if test="un != null">
#{un,jdbcType=VARCHAR},
</if>
<if test="dis != null">
#{dis,jdbcType=VARCHAR},
</if>
<if test="accessToken != null">
#{accessToken,jdbcType=VARCHAR},
</if>
<if test="loginType != null">
#{loginType,jdbcType=INTEGER},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="com.sztzjy.fund_investment.entity.UserExample"
resultType="java.lang.Long">
select count(*) from wx_user
<if test="_parameter != null">
<include refid="Example_Where_Clause"/>
</if>
</select>
<update id="updateByExampleSelective" parameterType="map">
update wx_user
<set>
<if test="record.userid != null">
userid = #{record.userid,jdbcType=VARCHAR},
</if>
<if test="record.name != null">
name = #{record.name,jdbcType=VARCHAR},
</if>
<if test="record.studentId != null">
student_id = #{record.studentId,jdbcType=VARCHAR},
</if>
<if test="record.className != null">
class_name = #{record.className,jdbcType=VARCHAR},
</if>
<if test="record.classId != null">
class_id = #{record.classId,jdbcType=VARCHAR},
</if>
<if test="record.username != null">
username = #{record.username,jdbcType=VARCHAR},
</if>
<if test="record.password != null">
password = #{record.password,jdbcType=VARCHAR},
</if>
<if test="record.phone != null">
phone = #{record.phone,jdbcType=VARCHAR},
</if>
<if test="record.roleId != null">
role_id = #{record.roleId,jdbcType=INTEGER},
</if>
<if test="record.createTime != null">
create_time = #{record.createTime,jdbcType=TIMESTAMP},
</if>
<if test="record.schoolId != null">
school_id = #{record.schoolId,jdbcType=VARCHAR},
</if>
<if test="record.schoolName != null">
school_name = #{record.schoolName,jdbcType=VARCHAR},
</if>
<if test="record.un != null">
un = #{record.un,jdbcType=VARCHAR},
</if>
<if test="record.dis != null">
dis = #{record.dis,jdbcType=VARCHAR},
</if>
<if test="record.accessToken != null">
access_token = #{record.accessToken,jdbcType=VARCHAR},
</if>
<if test="record.loginType != null">
login_type = #{record.loginType,jdbcType=INTEGER},
</if>
</set>
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause"/>
</if>
</update>
<update id="updateByExample" parameterType="map">
update wx_user
set userid = #{record.userid,jdbcType=VARCHAR},
name = #{record.name,jdbcType=VARCHAR},
</if>
<if test="record.studentId != null">
student_id = #{record.studentId,jdbcType=VARCHAR},
</if>
<if test="record.className != null">
class_name = #{record.className,jdbcType=VARCHAR},
</if>
<if test="record.classId != null">
class_id = #{record.classId,jdbcType=VARCHAR},
</if>
<if test="record.username != null">
username = #{record.username,jdbcType=VARCHAR},
</if>
<if test="record.password != null">
password = #{record.password,jdbcType=VARCHAR},
</if>
<if test="record.phone != null">
phone = #{record.phone,jdbcType=VARCHAR},
</if>
<if test="record.roleId != null">
role_id = #{record.roleId,jdbcType=INTEGER},
</if>
<if test="record.createTime != null">
create_time = #{record.createTime,jdbcType=TIMESTAMP},
</if>
<if test="record.schoolId != null">
school_id = #{record.schoolId,jdbcType=VARCHAR},
</if>
<if test="record.schoolName != null">
school_name = #{record.schoolName,jdbcType=VARCHAR},
</if>
<if test="record.un != null">
un = #{record.un,jdbcType=VARCHAR},
</if>
<if test="record.dis != null">
dis = #{record.dis,jdbcType=VARCHAR},
</if>
<if test="record.accessToken != null">
access_token = #{record.accessToken,jdbcType=VARCHAR},
</if>
<if test="record.loginType != null">
login_type = #{record.loginType,jdbcType=INTEGER},
</if>
</set>
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByExample" parameterType="map">
update wx_user
set userid = #{record.userid,jdbcType=VARCHAR},
name = #{record.name,jdbcType=VARCHAR},
student_id = #{record.studentId,jdbcType=VARCHAR},
class_name = #{record.className,jdbcType=VARCHAR},
class_id = #{record.classId,jdbcType=VARCHAR},
username = #{record.username,jdbcType=VARCHAR},
password = #{record.password,jdbcType=VARCHAR},
phone = #{record.phone,jdbcType=VARCHAR},
role_id = #{record.roleId,jdbcType=INTEGER},
create_time = #{record.createTime,jdbcType=TIMESTAMP},
school_id = #{record.schoolId,jdbcType=VARCHAR},
school_name = #{record.schoolName,jdbcType=VARCHAR},
un = #{record.un,jdbcType=VARCHAR},
dis = #{record.dis,jdbcType=VARCHAR},
access_token = #{record.accessToken,jdbcType=VARCHAR},
login_type = #{record.loginType,jdbcType=INTEGER}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByPrimaryKeySelective" parameterType="com.sztzjy.fund_investment.entity.User">
update wx_user
<set>
<if test="name != null">
name = #{name,jdbcType=VARCHAR},
</if>
<if test="studentId != null">
student_id = #{studentId,jdbcType=VARCHAR},
</if>
<if test="className != null">
class_name = #{className,jdbcType=VARCHAR},
</if>
<if test="classId != null">
class_id = #{classId,jdbcType=VARCHAR},
</if>
<if test="username != null">
username = #{username,jdbcType=VARCHAR},
</if>
<if test="password != null">
password = #{password,jdbcType=VARCHAR},
</if>
<if test="phone != null">
phone = #{phone,jdbcType=VARCHAR},
</if>
<if test="roleId != null">
role_id = #{roleId,jdbcType=INTEGER},
</if>
<if test="createTime != null">
create_time = #{createTime,jdbcType=TIMESTAMP},
</if>
<if test="schoolId != null">
school_id = #{schoolId,jdbcType=VARCHAR},
</if>
<if test="schoolName != null">
school_name = #{schoolName,jdbcType=VARCHAR},
</if>
<if test="un != null">
un = #{un,jdbcType=VARCHAR},
</if>
<if test="dis != null">
dis = #{dis,jdbcType=VARCHAR},
</if>
<if test="accessToken != null">
access_token = #{accessToken,jdbcType=VARCHAR},
</if>
<if test="loginType != null">
login_type = #{loginType,jdbcType=INTEGER},
</if>
</set>
where userid = #{userid,jdbcType=VARCHAR}
</update>
<update id="updateByPrimaryKey" parameterType="com.sztzjy.fund_investment.entity.User">
update wx_user
set name = #{name,jdbcType=VARCHAR},
student_id = #{studentId,jdbcType=VARCHAR},
class_name = #{className,jdbcType=VARCHAR},
class_id = #{classId,jdbcType=VARCHAR},
username = #{username,jdbcType=VARCHAR},
password = #{password,jdbcType=VARCHAR},
phone = #{phone,jdbcType=VARCHAR},
role_id = #{roleId,jdbcType=INTEGER},
create_time = #{createTime,jdbcType=TIMESTAMP},
school_id = #{schoolId,jdbcType=VARCHAR},
school_name = #{schoolName,jdbcType=VARCHAR},
un = #{un,jdbcType=VARCHAR},
dis = #{dis,jdbcType=VARCHAR},
access_token = #{accessToken,jdbcType=VARCHAR},
login_type = #{loginType,jdbcType=INTEGER}
where userid = #{userid,jdbcType=VARCHAR}
</update>
login_type = #{record.loginType,jdbcType=INTEGER}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause"/>
</if>
</update>
<update id="updateByPrimaryKeySelective" parameterType="com.sztzjy.fund_investment.entity.User">
update wx_user
<set>
<if test="name != null">
name = #{name,jdbcType=VARCHAR},
</if>
<if test="studentId != null">
student_id = #{studentId,jdbcType=VARCHAR},
</if>
<if test="className != null">
class_name = #{className,jdbcType=VARCHAR},
</if>
<if test="classId != null">
class_id = #{classId,jdbcType=VARCHAR},
</if>
<if test="username != null">
username = #{username,jdbcType=VARCHAR},
</if>
<if test="password != null">
password = #{password,jdbcType=VARCHAR},
</if>
<if test="phone != null">
phone = #{phone,jdbcType=VARCHAR},
</if>
<if test="roleId != null">
role_id = #{roleId,jdbcType=INTEGER},
</if>
<if test="createTime != null">
create_time = #{createTime,jdbcType=TIMESTAMP},
</if>
<if test="schoolId != null">
school_id = #{schoolId,jdbcType=VARCHAR},
</if>
<if test="schoolName != null">
school_name = #{schoolName,jdbcType=VARCHAR},
</if>
<if test="un != null">
un = #{un,jdbcType=VARCHAR},
</if>
<if test="dis != null">
dis = #{dis,jdbcType=VARCHAR},
</if>
<if test="accessToken != null">
access_token = #{accessToken,jdbcType=VARCHAR},
</if>
<if test="loginType != null">
login_type = #{loginType,jdbcType=INTEGER},
</if>
</set>
where userid = #{userid,jdbcType=VARCHAR}
</update>
<update id="updateByPrimaryKey" parameterType="com.sztzjy.fund_investment.entity.User">
update wx_user
set name = #{name,jdbcType=VARCHAR},
student_id = #{studentId,jdbcType=VARCHAR},
class_name = #{className,jdbcType=VARCHAR},
class_id = #{classId,jdbcType=VARCHAR},
username = #{username,jdbcType=VARCHAR},
password = #{password,jdbcType=VARCHAR},
phone = #{phone,jdbcType=VARCHAR},
role_id = #{roleId,jdbcType=INTEGER},
create_time = #{createTime,jdbcType=TIMESTAMP},
school_id = #{schoolId,jdbcType=VARCHAR},
school_name = #{schoolName,jdbcType=VARCHAR},
un = #{un,jdbcType=VARCHAR},
dis = #{dis,jdbcType=VARCHAR},
access_token = #{accessToken,jdbcType=VARCHAR},
login_type = #{loginType,jdbcType=INTEGER}
where userid = #{userid,jdbcType=VARCHAR}
</update>
<resultMap id="UserDtoMap" type="com.sztzjy.fund_investment.entity.dto.UserDto">
<id column="userid" jdbcType="VARCHAR" property="userid"/>
<result column="school_name" jdbcType="VARCHAR" property="schoolName"/>
<result column="class_name" jdbcType="VARCHAR" property="className"/>
<result column="name" jdbcType="VARCHAR" property="name"/>
<result column="student_id" jdbcType="VARCHAR" property="studentId"/>
<result column="class_id" jdbcType="VARCHAR" property="classId"/>
<result column="school_id" jdbcType="VARCHAR" property="schoolId"/>
<result column="report_name" jdbcType="VARCHAR" property="reportName"/>
<result column="total_score" jdbcType="DECIMAL" property="score"/>
<result column="flow_id" jdbcType="VARCHAR" property="flowId"/>
<result column="id" jdbcType="VARCHAR" property="performanceScoreId"/>
<result column="report_id" jdbcType="VARCHAR" property="reportId"/>
</resultMap>
<resultMap id="UserDtoMap" type="com.sztzjy.fund_investment.entity.dto.UserDto">
<id column="userid" jdbcType="VARCHAR" property="userid"/>
<result column="school_name" jdbcType="VARCHAR" property="schoolName"/>
<result column="class_name" jdbcType="VARCHAR" property="className"/>
<result column="name" jdbcType="VARCHAR" property="name"/>
<result column="student_id" jdbcType="VARCHAR" property="studentId"/>
<result column="class_id" jdbcType="VARCHAR" property="classId"/>
<result column="school_id" jdbcType="VARCHAR" property="schoolId"/>
<result column="report_name" jdbcType="VARCHAR" property="reportName"/>
<result column="total_score" jdbcType="DECIMAL" property="score"/>
<result column="flow_id" jdbcType="VARCHAR" property="flowId"/>
<result column="id" jdbcType="VARCHAR" property="performanceScoreId"/>
<result column="report_id" jdbcType="VARCHAR" property="reportId"/>
</resultMap>
<select id="getStudentScoreDetails" resultMap="UserDtoMap">
SELECT u.class_id,u.class_name,u.school_id,u.school_name,u.`name`,u.student_id,
u.userid,
tr.report_name,tr.id report_id,
ps.total_score,ps.id,
f.flow_id
FROM wx_user u
JOIN flow f on u.userid = f.userid
LEFT JOIN training_report tr ON tr.flow_id = f.flow_id AND tr.step = '投资报告'
LEFT JOIN performance_score ps on ps.flow_id = f.flow_id
WHERE u.role_id = 4
<if test="schoolId != null">
AND u.school_id = #{schoolId}
</if>
<if test="classId != null">
AND u.class_id = #{classId}
</if>
<if test="studentIdOrName != null">
AND u.name like '%${studentIdOrName}%' OR u.student_id like '%${studentIdOrName}%'
</if>
ORDER BY ps.total_score DESC
</select>
<select id="getStudentScoreDetails" resultMap="UserDtoMap">
SELECT u.class_id,u.class_name,u.school_id,u.school_name,u.`name`,u.student_id,
u.userid,
tr.report_name,tr.id report_id,
ps.total_score,ps.id,
f.flow_id
FROM wx_user u
JOIN flow f on u.userid = f.userid
LEFT JOIN training_report tr ON tr.flow_id = f.flow_id AND tr.step = '投资报告'
LEFT JOIN performance_score ps on ps.flow_id = f.flow_id
WHERE u.role_id = 4
<if test="schoolId != null">
AND u.school_id = #{schoolId}
</if>
<if test="classId != null">
AND u.class_id = #{classId}
</if>
<if test="studentIdOrName != null">
AND u.name like '%${studentIdOrName}%' OR u.student_id like '%${studentIdOrName}%'
</if>
ORDER BY ps.total_score DESC
</select>
<insert id="batchInsertStudents" parameterType="java.util.List">
insert into wx_user (userid, name, student_id,
class_name, class_id, username,
password, phone, role_id,
create_time, school_id, school_name)
values
<foreach collection="list" item="student" separator=",">
(#{student.userid,jdbcType=VARCHAR}, #{student.name,jdbcType=VARCHAR}, #{student.studentId,jdbcType=VARCHAR},
#{student.className,jdbcType=VARCHAR}, #{student.classId,jdbcType=VARCHAR}, #{student.username,jdbcType=VARCHAR},
#{student.password,jdbcType=VARCHAR}, #{student.phone,jdbcType=VARCHAR}, #{student.roleId,jdbcType=INTEGER},
#{student.createTime,jdbcType=TIMESTAMP}, #{student.schoolId,jdbcType=VARCHAR}, #{student.schoolName,jdbcType=VARCHAR})
</foreach>
</insert>
</mapper>
Loading…
Cancel
Save