自动生成配置文件和mapper xml
parent
93dd731bbe
commit
e8fda05a6b
@ -1,33 +1,40 @@
|
|||||||
//package com.sztzjy.financial_bigdata.config.security;
|
package com.sztzjy.financial_bigdata.config.security;
|
||||||
//
|
|
||||||
//import com.sztzjy.financial_bigdata.entity.User;
|
import com.sztzjy.financial_bigdata.entity.StuUser;
|
||||||
//import com.sztzjy.financial_bigdata.service.IUserService;
|
import com.sztzjy.financial_bigdata.entity.StuUserExample;
|
||||||
//import io.jsonwebtoken.lang.Assert;
|
import com.sztzjy.financial_bigdata.mapper.StuUserMapper;
|
||||||
//import org.springframework.security.core.userdetails.UserDetails;
|
import io.jsonwebtoken.lang.Assert;
|
||||||
//import org.springframework.security.core.userdetails.UserDetailsService;
|
import org.springframework.security.core.userdetails.UserDetails;
|
||||||
//import org.springframework.security.core.userdetails.UsernameNotFoundException;
|
import org.springframework.security.core.userdetails.UserDetailsService;
|
||||||
//import org.springframework.stereotype.Service;
|
import org.springframework.security.core.userdetails.UsernameNotFoundException;
|
||||||
//
|
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
|
||||||
//import javax.annotation.Resource;
|
import org.springframework.stereotype.Service;
|
||||||
//
|
|
||||||
//
|
import javax.annotation.Resource;
|
||||||
//@Service
|
import java.util.List;
|
||||||
//public class AuthenticationService implements UserDetailsService {
|
|
||||||
// @Resource
|
|
||||||
// private IUserService userService;
|
@Service
|
||||||
//
|
public class AuthenticationService implements UserDetailsService {
|
||||||
//
|
@Resource
|
||||||
// @Override
|
private StuUserMapper stuUserMapper;
|
||||||
// public UserDetails loadUserByUsername(String username) throws UsernameNotFoundException {
|
|
||||||
// User user = userService.findByUsername(username);
|
|
||||||
// Assert.notNull(user, "用户不存在");
|
@Override
|
||||||
//
|
public UserDetails loadUserByUsername(String username) throws UsernameNotFoundException {
|
||||||
// JwtUser jwtUser = new JwtUser();
|
StuUserExample stuUserExample = new StuUserExample();
|
||||||
// jwtUser.setUsername(user.getUsername());
|
stuUserExample.createCriteria().andUsernameEqualTo(username);
|
||||||
// jwtUser.setPassword(user.getPassword());
|
List<StuUser> list = stuUserMapper.selectByExample(stuUserExample);
|
||||||
// jwtUser.setUserId(user.getUserid());
|
Assert.notNull(list, "用户不存在");
|
||||||
// jwtUser.setName(user.getName());
|
StuUser user = list.get(0);
|
||||||
// jwtUser.setRoleId(user.getRoleId());
|
com.sztzjy.financial_bigdata.config.security.JwtUser jwtUser = new com.sztzjy.financial_bigdata.config.security.JwtUser();
|
||||||
// return jwtUser;
|
jwtUser.setUsername(user.getUsername());
|
||||||
// }
|
jwtUser.setPassword(new BCryptPasswordEncoder().encode(user.getPassword())); //不加密会报错Encoded password does not look like BCrypt
|
||||||
//}
|
jwtUser.setUserId(user.getUserid());
|
||||||
|
jwtUser.setName(user.getName());
|
||||||
|
jwtUser.setRoleId(user.getRoleId());
|
||||||
|
jwtUser.setStudentId(user.getStudentId());
|
||||||
|
return jwtUser;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
@ -0,0 +1,61 @@
|
|||||||
|
package com.sztzjy.financial_bigdata.entity.tea_dto;
|
||||||
|
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 实训报告表
|
||||||
|
*
|
||||||
|
* @author xcj
|
||||||
|
* training_report
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@NoArgsConstructor
|
||||||
|
public class TrainingReportDto {
|
||||||
|
@ApiModelProperty("实训报告ID")
|
||||||
|
private String reportId;
|
||||||
|
|
||||||
|
@ApiModelProperty("章节ID")
|
||||||
|
private String chapterId;
|
||||||
|
|
||||||
|
@ApiModelProperty("章节名称")
|
||||||
|
private String chapterName;
|
||||||
|
|
||||||
|
@ApiModelProperty("用户ID")
|
||||||
|
private String userId;
|
||||||
|
|
||||||
|
@ApiModelProperty("姓名")
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
@ApiModelProperty("学号")
|
||||||
|
private String studentId;
|
||||||
|
|
||||||
|
@ApiModelProperty("班级")
|
||||||
|
private String className;
|
||||||
|
|
||||||
|
@ApiModelProperty("实训报告名称")
|
||||||
|
private String reportName;
|
||||||
|
|
||||||
|
@ApiModelProperty("实训报告上传时间")
|
||||||
|
private Date uploadTime;
|
||||||
|
|
||||||
|
@ApiModelProperty("实训报告大小/单位MB")
|
||||||
|
private Integer reportSize;
|
||||||
|
|
||||||
|
@ApiModelProperty("教师评分")
|
||||||
|
private BigDecimal teacherScore;
|
||||||
|
|
||||||
|
@ApiModelProperty("文件地址")
|
||||||
|
private String filePath;
|
||||||
|
|
||||||
|
@ApiModelProperty("学校ID")
|
||||||
|
private String schoolId;
|
||||||
|
|
||||||
|
@ApiModelProperty("教师评语")
|
||||||
|
private String teacherComment;
|
||||||
|
|
||||||
|
}
|
@ -1,196 +1,203 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?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">
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
<mapper namespace="com.sztzjy.financial_bigdata.mapper.StuClassMapper">
|
<mapper namespace="com.sztzjy.financial_bigdata.mapper.StuClassMapper">
|
||||||
<resultMap id="BaseResultMap" type="com.sztzjy.financial_bigdata.entity.StuClass">
|
<resultMap id="BaseResultMap" type="com.sztzjy.financial_bigdata.entity.StuClass">
|
||||||
<id column="class_id" jdbcType="VARCHAR" property="classId" />
|
<id column="class_id" jdbcType="VARCHAR" property="classId"/>
|
||||||
<result column="class_name" jdbcType="VARCHAR" property="className" />
|
<result column="class_name" jdbcType="VARCHAR" property="className"/>
|
||||||
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
|
<result column="create_time" jdbcType="TIMESTAMP" property="createTime"/>
|
||||||
<result column="school_name" jdbcType="VARCHAR" property="schoolName" />
|
<result column="school_name" jdbcType="VARCHAR" property="schoolName"/>
|
||||||
</resultMap>
|
</resultMap>
|
||||||
<sql id="Example_Where_Clause">
|
<sql id="Example_Where_Clause">
|
||||||
<where>
|
<where>
|
||||||
<foreach collection="oredCriteria" item="criteria" separator="or">
|
<foreach collection="oredCriteria" item="criteria" separator="or">
|
||||||
<if test="criteria.valid">
|
<if test="criteria.valid">
|
||||||
<trim prefix="(" prefixOverrides="and" suffix=")">
|
<trim prefix="(" prefixOverrides="and" suffix=")">
|
||||||
<foreach collection="criteria.criteria" item="criterion">
|
<foreach collection="criteria.criteria" item="criterion">
|
||||||
<choose>
|
<choose>
|
||||||
<when test="criterion.noValue">
|
<when test="criterion.noValue">
|
||||||
and ${criterion.condition}
|
and ${criterion.condition}
|
||||||
</when>
|
</when>
|
||||||
<when test="criterion.singleValue">
|
<when test="criterion.singleValue">
|
||||||
and ${criterion.condition} #{criterion.value}
|
and ${criterion.condition} #{criterion.value}
|
||||||
</when>
|
</when>
|
||||||
<when test="criterion.betweenValue">
|
<when test="criterion.betweenValue">
|
||||||
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
|
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
|
||||||
</when>
|
</when>
|
||||||
<when test="criterion.listValue">
|
<when test="criterion.listValue">
|
||||||
and ${criterion.condition}
|
and ${criterion.condition}
|
||||||
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
|
<foreach close=")" collection="criterion.value" item="listItem" open="("
|
||||||
#{listItem}
|
separator=",">
|
||||||
</foreach>
|
#{listItem}
|
||||||
</when>
|
</foreach>
|
||||||
</choose>
|
</when>
|
||||||
|
</choose>
|
||||||
|
</foreach>
|
||||||
|
</trim>
|
||||||
|
</if>
|
||||||
</foreach>
|
</foreach>
|
||||||
</trim>
|
</where>
|
||||||
</if>
|
</sql>
|
||||||
</foreach>
|
<sql id="Update_By_Example_Where_Clause">
|
||||||
</where>
|
<where>
|
||||||
</sql>
|
<foreach collection="example.oredCriteria" item="criteria" separator="or">
|
||||||
<sql id="Update_By_Example_Where_Clause">
|
<if test="criteria.valid">
|
||||||
<where>
|
<trim prefix="(" prefixOverrides="and" suffix=")">
|
||||||
<foreach collection="example.oredCriteria" item="criteria" separator="or">
|
<foreach collection="criteria.criteria" item="criterion">
|
||||||
<if test="criteria.valid">
|
<choose>
|
||||||
<trim prefix="(" prefixOverrides="and" suffix=")">
|
<when test="criterion.noValue">
|
||||||
<foreach collection="criteria.criteria" item="criterion">
|
and ${criterion.condition}
|
||||||
<choose>
|
</when>
|
||||||
<when test="criterion.noValue">
|
<when test="criterion.singleValue">
|
||||||
and ${criterion.condition}
|
and ${criterion.condition} #{criterion.value}
|
||||||
</when>
|
</when>
|
||||||
<when test="criterion.singleValue">
|
<when test="criterion.betweenValue">
|
||||||
and ${criterion.condition} #{criterion.value}
|
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
|
||||||
</when>
|
</when>
|
||||||
<when test="criterion.betweenValue">
|
<when test="criterion.listValue">
|
||||||
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
|
and ${criterion.condition}
|
||||||
</when>
|
<foreach close=")" collection="criterion.value" item="listItem" open="("
|
||||||
<when test="criterion.listValue">
|
separator=",">
|
||||||
and ${criterion.condition}
|
#{listItem}
|
||||||
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
|
</foreach>
|
||||||
#{listItem}
|
</when>
|
||||||
</foreach>
|
</choose>
|
||||||
</when>
|
</foreach>
|
||||||
</choose>
|
</trim>
|
||||||
|
</if>
|
||||||
</foreach>
|
</foreach>
|
||||||
</trim>
|
</where>
|
||||||
|
</sql>
|
||||||
|
<sql id="Base_Column_List">
|
||||||
|
class_id
|
||||||
|
, class_name, create_time, school_name
|
||||||
|
</sql>
|
||||||
|
<select id="selectByExample" parameterType="com.sztzjy.financial_bigdata.entity.StuClassExample"
|
||||||
|
resultMap="BaseResultMap">
|
||||||
|
select
|
||||||
|
<if test="distinct">
|
||||||
|
distinct
|
||||||
|
</if>
|
||||||
|
<include refid="Base_Column_List"/>
|
||||||
|
from stu_class
|
||||||
|
<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 stu_class
|
||||||
|
where class_id = #{classId,jdbcType=VARCHAR}
|
||||||
|
</select>
|
||||||
|
<delete id="deleteByPrimaryKey" parameterType="java.lang.String">
|
||||||
|
delete
|
||||||
|
from stu_class
|
||||||
|
where class_id = #{classId,jdbcType=VARCHAR}
|
||||||
|
</delete>
|
||||||
|
<delete id="deleteByExample" parameterType="com.sztzjy.financial_bigdata.entity.StuClassExample">
|
||||||
|
delete from stu_class
|
||||||
|
<if test="_parameter != null">
|
||||||
|
<include refid="Example_Where_Clause"/>
|
||||||
</if>
|
</if>
|
||||||
</foreach>
|
</delete>
|
||||||
</where>
|
<insert id="insert" parameterType="com.sztzjy.financial_bigdata.entity.StuClass">
|
||||||
</sql>
|
insert into stu_class (class_id, class_name, create_time,
|
||||||
<sql id="Base_Column_List">
|
school_name)
|
||||||
class_id, class_name, create_time, school_name
|
values (#{classId,jdbcType=VARCHAR}, #{className,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP},
|
||||||
</sql>
|
#{schoolName,jdbcType=VARCHAR})
|
||||||
<select id="selectByExample" parameterType="com.sztzjy.financial_bigdata.entity.StuClassExample" resultMap="BaseResultMap">
|
</insert>
|
||||||
select
|
<insert id="insertSelective" parameterType="com.sztzjy.financial_bigdata.entity.StuClass">
|
||||||
<if test="distinct">
|
insert into stu_class
|
||||||
distinct
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||||
</if>
|
<if test="classId != null">
|
||||||
<include refid="Base_Column_List" />
|
class_id,
|
||||||
from stu_class
|
</if>
|
||||||
<if test="_parameter != null">
|
<if test="className != null">
|
||||||
<include refid="Example_Where_Clause" />
|
class_name,
|
||||||
</if>
|
</if>
|
||||||
<if test="orderByClause != null">
|
<if test="createTime != null">
|
||||||
order by ${orderByClause}
|
create_time,
|
||||||
</if>
|
</if>
|
||||||
</select>
|
<if test="schoolName != null">
|
||||||
<select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="BaseResultMap">
|
school_name,
|
||||||
select
|
</if>
|
||||||
<include refid="Base_Column_List" />
|
</trim>
|
||||||
from stu_class
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||||
where class_id = #{classId,jdbcType=VARCHAR}
|
<if test="classId != null">
|
||||||
</select>
|
#{classId,jdbcType=VARCHAR},
|
||||||
<delete id="deleteByPrimaryKey" parameterType="java.lang.String">
|
</if>
|
||||||
delete from stu_class
|
<if test="className != null">
|
||||||
where class_id = #{classId,jdbcType=VARCHAR}
|
#{className,jdbcType=VARCHAR},
|
||||||
</delete>
|
</if>
|
||||||
<delete id="deleteByExample" parameterType="com.sztzjy.financial_bigdata.entity.StuClassExample">
|
<if test="createTime != null">
|
||||||
delete from stu_class
|
#{createTime,jdbcType=TIMESTAMP},
|
||||||
<if test="_parameter != null">
|
</if>
|
||||||
<include refid="Example_Where_Clause" />
|
<if test="schoolName != null">
|
||||||
</if>
|
#{schoolName,jdbcType=VARCHAR},
|
||||||
</delete>
|
</if>
|
||||||
<insert id="insert" parameterType="com.sztzjy.financial_bigdata.entity.StuClass">
|
</trim>
|
||||||
insert into stu_class (class_id, class_name, create_time,
|
</insert>
|
||||||
school_name)
|
<select id="countByExample" parameterType="com.sztzjy.financial_bigdata.entity.StuClassExample"
|
||||||
values (#{classId,jdbcType=VARCHAR}, #{className,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP},
|
resultType="java.lang.Long">
|
||||||
#{schoolName,jdbcType=VARCHAR})
|
select count(*) from stu_class
|
||||||
</insert>
|
<if test="_parameter != null">
|
||||||
<insert id="insertSelective" parameterType="com.sztzjy.financial_bigdata.entity.StuClass">
|
<include refid="Example_Where_Clause"/>
|
||||||
insert into stu_class
|
</if>
|
||||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
</select>
|
||||||
<if test="classId != null">
|
<update id="updateByExampleSelective" parameterType="map">
|
||||||
class_id,
|
update stu_class
|
||||||
</if>
|
<set>
|
||||||
<if test="className != null">
|
<if test="record.classId != null">
|
||||||
class_name,
|
class_id = #{record.classId,jdbcType=VARCHAR},
|
||||||
</if>
|
</if>
|
||||||
<if test="createTime != null">
|
<if test="record.className != null">
|
||||||
create_time,
|
class_name = #{record.className,jdbcType=VARCHAR},
|
||||||
</if>
|
</if>
|
||||||
<if test="schoolName != null">
|
<if test="record.createTime != null">
|
||||||
school_name,
|
create_time = #{record.createTime,jdbcType=TIMESTAMP},
|
||||||
</if>
|
</if>
|
||||||
</trim>
|
<if test="record.schoolName != null">
|
||||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
school_name = #{record.schoolName,jdbcType=VARCHAR},
|
||||||
<if test="classId != null">
|
</if>
|
||||||
#{classId,jdbcType=VARCHAR},
|
</set>
|
||||||
</if>
|
<if test="_parameter != null">
|
||||||
<if test="className != null">
|
<include refid="Update_By_Example_Where_Clause"/>
|
||||||
#{className,jdbcType=VARCHAR},
|
</if>
|
||||||
</if>
|
</update>
|
||||||
<if test="createTime != null">
|
<update id="updateByExample" parameterType="map">
|
||||||
#{createTime,jdbcType=TIMESTAMP},
|
update stu_class
|
||||||
</if>
|
set class_id = #{record.classId,jdbcType=VARCHAR},
|
||||||
<if test="schoolName != null">
|
|
||||||
#{schoolName,jdbcType=VARCHAR},
|
|
||||||
</if>
|
|
||||||
</trim>
|
|
||||||
</insert>
|
|
||||||
<select id="countByExample" parameterType="com.sztzjy.financial_bigdata.entity.StuClassExample" resultType="java.lang.Long">
|
|
||||||
select count(*) from stu_class
|
|
||||||
<if test="_parameter != null">
|
|
||||||
<include refid="Example_Where_Clause" />
|
|
||||||
</if>
|
|
||||||
</select>
|
|
||||||
<update id="updateByExampleSelective" parameterType="map">
|
|
||||||
update stu_class
|
|
||||||
<set>
|
|
||||||
<if test="record.classId != null">
|
|
||||||
class_id = #{record.classId,jdbcType=VARCHAR},
|
|
||||||
</if>
|
|
||||||
<if test="record.className != null">
|
|
||||||
class_name = #{record.className,jdbcType=VARCHAR},
|
class_name = #{record.className,jdbcType=VARCHAR},
|
||||||
</if>
|
|
||||||
<if test="record.createTime != null">
|
|
||||||
create_time = #{record.createTime,jdbcType=TIMESTAMP},
|
create_time = #{record.createTime,jdbcType=TIMESTAMP},
|
||||||
</if>
|
school_name = #{record.schoolName,jdbcType=VARCHAR}
|
||||||
<if test="record.schoolName != null">
|
<if test="_parameter != null">
|
||||||
school_name = #{record.schoolName,jdbcType=VARCHAR},
|
<include refid="Update_By_Example_Where_Clause"/>
|
||||||
</if>
|
</if>
|
||||||
</set>
|
</update>
|
||||||
<if test="_parameter != null">
|
<update id="updateByPrimaryKeySelective" parameterType="com.sztzjy.financial_bigdata.entity.StuClass">
|
||||||
<include refid="Update_By_Example_Where_Clause" />
|
update stu_class
|
||||||
</if>
|
<set>
|
||||||
</update>
|
<if test="className != null">
|
||||||
<update id="updateByExample" parameterType="map">
|
class_name = #{className,jdbcType=VARCHAR},
|
||||||
update stu_class
|
</if>
|
||||||
set class_id = #{record.classId,jdbcType=VARCHAR},
|
<if test="createTime != null">
|
||||||
class_name = #{record.className,jdbcType=VARCHAR},
|
create_time = #{createTime,jdbcType=TIMESTAMP},
|
||||||
create_time = #{record.createTime,jdbcType=TIMESTAMP},
|
</if>
|
||||||
school_name = #{record.schoolName,jdbcType=VARCHAR}
|
<if test="schoolName != null">
|
||||||
<if test="_parameter != null">
|
school_name = #{schoolName,jdbcType=VARCHAR},
|
||||||
<include refid="Update_By_Example_Where_Clause" />
|
</if>
|
||||||
</if>
|
</set>
|
||||||
</update>
|
where class_id = #{classId,jdbcType=VARCHAR}
|
||||||
<update id="updateByPrimaryKeySelective" parameterType="com.sztzjy.financial_bigdata.entity.StuClass">
|
</update>
|
||||||
update stu_class
|
<update id="updateByPrimaryKey" parameterType="com.sztzjy.financial_bigdata.entity.StuClass">
|
||||||
<set>
|
update stu_class
|
||||||
<if test="className != null">
|
set class_name = #{className,jdbcType=VARCHAR},
|
||||||
class_name = #{className,jdbcType=VARCHAR},
|
create_time = #{createTime,jdbcType=TIMESTAMP},
|
||||||
</if>
|
school_name = #{schoolName,jdbcType=VARCHAR}
|
||||||
<if test="createTime != null">
|
where class_id = #{classId,jdbcType=VARCHAR}
|
||||||
create_time = #{createTime,jdbcType=TIMESTAMP},
|
</update>
|
||||||
</if>
|
|
||||||
<if test="schoolName != null">
|
|
||||||
school_name = #{schoolName,jdbcType=VARCHAR},
|
|
||||||
</if>
|
|
||||||
</set>
|
|
||||||
where class_id = #{classId,jdbcType=VARCHAR}
|
|
||||||
</update>
|
|
||||||
<update id="updateByPrimaryKey" parameterType="com.sztzjy.financial_bigdata.entity.StuClass">
|
|
||||||
update stu_class
|
|
||||||
set class_name = #{className,jdbcType=VARCHAR},
|
|
||||||
create_time = #{createTime,jdbcType=TIMESTAMP},
|
|
||||||
school_name = #{schoolName,jdbcType=VARCHAR}
|
|
||||||
where class_id = #{classId,jdbcType=VARCHAR}
|
|
||||||
</update>
|
|
||||||
</mapper>
|
</mapper>
|
Loading…
Reference in New Issue