自动生成配置文件和mapper xml

newBigdata
xiaoCJ 1 year ago
parent 74e7c87540
commit 25ead463ca

@ -4,7 +4,10 @@ import cn.hutool.core.util.IdUtil;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.sztzjy.financial_bigdata.annotation.AnonymousAccess;
import com.sztzjy.financial_bigdata.entity.*;
import com.sztzjy.financial_bigdata.entity.StuClass;
import com.sztzjy.financial_bigdata.entity.StuClassExample;
import com.sztzjy.financial_bigdata.entity.StuUser;
import com.sztzjy.financial_bigdata.entity.StuUserExample;
import com.sztzjy.financial_bigdata.entity.stu_dto.StuUserDto;
import com.sztzjy.financial_bigdata.mapper.StuClassMapper;
import com.sztzjy.financial_bigdata.mapper.StuUserMapper;
@ -20,7 +23,10 @@ import org.springframework.http.HttpStatus;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import java.util.*;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Date;
import java.util.List;
/**
* @Author xcj

@ -33,5 +33,5 @@ public interface StuUserMapper {
int updateByPrimaryKey(StuUser record);
@Select("select DISTINCT stu_users.school_name from stu_users where school_id =#{schoolId}")
String selectSchoolNameById(@Param("schoolId") String schoolId);
String selectSchoolNameById(@Param("schoolId")String schoolId);
}

@ -3,8 +3,10 @@ package com.sztzjy.financial_bigdata.mapper;
import com.sztzjy.financial_bigdata.entity.SysCourseChapter;
import com.sztzjy.financial_bigdata.entity.SysCourseChapterExample;
import java.util.List;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
@Mapper
public interface SysCourseChapterMapper {
long countByExample(SysCourseChapterExample example);

@ -2,7 +2,7 @@
<!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.StuUserMapper">
<resultMap id="BaseResultMap" type="com.sztzjy.financial_bigdata.entity.StuUser">
<result column="userid" jdbcType="VARCHAR" property="userid" />
<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_id" jdbcType="VARCHAR" property="classId" />
@ -17,7 +17,6 @@
<result column="school_name" jdbcType="VARCHAR" property="schoolName" />
<result column="status" jdbcType="INTEGER" property="status" />
</resultMap>
<sql id="Example_Where_Clause">
<where>
<foreach collection="oredCriteria" item="criteria" separator="or">
@ -86,7 +85,7 @@
distinct
</if>
<include refid="Base_Column_List" />
from stu_user
from stu_userinfo
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
@ -94,14 +93,24 @@
order by ${orderByClause}
</if>
</select>
<select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from stu_userinfo
where userid = #{userid,jdbcType=VARCHAR}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.String">
delete from stu_userinfo
where userid = #{userid,jdbcType=VARCHAR}
</delete>
<delete id="deleteByExample" parameterType="com.sztzjy.financial_bigdata.entity.StuUserExample">
delete from stu_user
delete from stu_userinfo
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</delete>
<insert id="insert" parameterType="com.sztzjy.financial_bigdata.entity.StuUser">
insert into stu_user (userid, name, student_id,
insert into stu_userinfo (userid, name, student_id,
class_id, username, password,
phone, email, major,
role_id, create_time, school_id,
@ -113,7 +122,7 @@
#{schoolName,jdbcType=VARCHAR}, #{status,jdbcType=INTEGER})
</insert>
<insert id="insertSelective" parameterType="com.sztzjy.financial_bigdata.entity.StuUser">
insert into stu_user
insert into stu_userinfo
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="userid != null">
userid,
@ -204,13 +213,13 @@
</trim>
</insert>
<select id="countByExample" parameterType="com.sztzjy.financial_bigdata.entity.StuUserExample" resultType="java.lang.Long">
select count(*) from stu_user
select count(*) from stu_userinfo
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</select>
<update id="updateByExampleSelective" parameterType="map">
update stu_user
update stu_userinfo
<set>
<if test="record.userid != null">
userid = #{record.userid,jdbcType=VARCHAR},
@ -260,7 +269,7 @@
</if>
</update>
<update id="updateByExample" parameterType="map">
update stu_user
update stu_userinfo
set userid = #{record.userid,jdbcType=VARCHAR},
name = #{record.name,jdbcType=VARCHAR},
student_id = #{record.studentId,jdbcType=VARCHAR},
@ -279,4 +288,66 @@
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
</mapper>
<update id="updateByPrimaryKeySelective" parameterType="com.sztzjy.financial_bigdata.entity.StuUser">
update stu_userinfo
<set>
<if test="name != null">
name = #{name,jdbcType=VARCHAR},
</if>
<if test="studentId != null">
student_id = #{studentId,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="email != null">
email = #{email,jdbcType=VARCHAR},
</if>
<if test="major != null">
major = #{major,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="status != null">
status = #{status,jdbcType=INTEGER},
</if>
</set>
where userid = #{userid,jdbcType=VARCHAR}
</update>
<update id="updateByPrimaryKey" parameterType="com.sztzjy.financial_bigdata.entity.StuUser">
update stu_userinfo
set name = #{name,jdbcType=VARCHAR},
student_id = #{studentId,jdbcType=VARCHAR},
class_id = #{classId,jdbcType=VARCHAR},
username = #{username,jdbcType=VARCHAR},
password = #{password,jdbcType=VARCHAR},
phone = #{phone,jdbcType=VARCHAR},
email = #{email,jdbcType=VARCHAR},
major = #{major,jdbcType=VARCHAR},
role_id = #{roleId,jdbcType=INTEGER},
create_time = #{createTime,jdbcType=TIMESTAMP},
school_id = #{schoolId,jdbcType=VARCHAR},
school_name = #{schoolName,jdbcType=VARCHAR},
status = #{status,jdbcType=INTEGER}
where userid = #{userid,jdbcType=VARCHAR}
</update>
</mapper>

@ -193,70 +193,4 @@
sequence = #{sequence,jdbcType=INTEGER}
where chapter_id = #{chapterId,jdbcType=VARCHAR}
</update>
<resultMap id="BaseResultMap" type="com.sztzjy.financial_bigdata.entity.SysCourseChapter">
<id column="chapter_id" jdbcType="VARCHAR" property="chapterId" />
<result column="chapter_name" jdbcType="VARCHAR" property="chapterName" />
<result column="course_id" jdbcType="VARCHAR" property="courseId" />
<result column="sequence" jdbcType="INTEGER" property="sequence" />
<result column="school_id" jdbcType="VARCHAR" property="schoolId" />
<result column="input_type" jdbcType="VARCHAR" property="inputType" />
</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>
</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>
</where>
</sql>
</mapper>

@ -208,81 +208,4 @@
input_type = #{inputType,jdbcType=VARCHAR}
where course_id = #{courseId,jdbcType=VARCHAR}
</update>
<resultMap id="BaseResultMap" type="com.sztzjy.financial_bigdata.entity.SysCourse">
<id column="course_id" jdbcType="VARCHAR" property="courseId" />
<result column="course_name" jdbcType="VARCHAR" property="courseName" />
<result column="sequence" jdbcType="INTEGER" property="sequence" />
</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>
</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>
</where>
</sql>
<select id="selectChapter" parameterType="java.lang.String" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from sys_course
where
ORDER BY
CASE
WHEN input_type != '0' THEN sequence
END ASC,
CASE
WHEN input_type = '0' AND school_id = '9999' THEN sequence
END ASC;
</select>
</mapper>

File diff suppressed because it is too large Load Diff

@ -355,283 +355,5 @@
version = #{version,jdbcType=VARCHAR}
where id = #{id,jdbcType=VARCHAR}
</update>
<resultMap id="BaseResultMap" type="com.sztzjy.financial_bigdata.entity.TrainingReport">
<result column="report_id" jdbcType="VARCHAR" property="reportId" />
<result column="chapter_id" jdbcType="VARCHAR" property="chapterId" />
<result column="chapter_name" jdbcType="VARCHAR" property="chapterName" />
<result column="user_id" jdbcType="VARCHAR" property="userId" />
<result column="report_name" jdbcType="VARCHAR" property="reportName" />
<result column="upload_time" jdbcType="TIMESTAMP" property="uploadTime" />
<result column="report_size" jdbcType="INTEGER" property="reportSize" />
<result column="teacher_score" jdbcType="DECIMAL" property="teacherScore" />
<result column="file_path" jdbcType="VARCHAR" property="filePath" />
<result column="school_id" jdbcType="VARCHAR" property="schoolId" />
</resultMap>
<resultMap extends="BaseResultMap" id="ResultMapWithBLOBs" type="com.sztzjy.financial_bigdata.entity.TrainingReport">
<result column="teacher_comment" jdbcType="LONGVARCHAR" property="teacherComment" />
</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>
</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>
</where>
</sql>
<sql id="Base_Column_List">
report_id, chapter_id, chapter_name, user_id, report_name, upload_time, report_size,
teacher_score, file_path, school_id
</sql>
<sql id="Blob_Column_List">
teacher_comment
</sql>
<select id="selectByExampleWithBLOBs" parameterType="com.sztzjy.financial_bigdata.entity.TrainingReportExample" resultMap="ResultMapWithBLOBs">
select
<if test="distinct">
distinct
</if>
<include refid="Base_Column_List" />
,
<include refid="Blob_Column_List" />
from training_report
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
<if test="orderByClause != null">
order by ${orderByClause}
</if>
</select>
<select id="selectByExample" parameterType="com.sztzjy.financial_bigdata.entity.TrainingReportExample" resultMap="BaseResultMap">
select
<if test="distinct">
distinct
</if>
<include refid="Base_Column_List" />
from training_report
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
<if test="orderByClause != null">
order by ${orderByClause}
</if>
</select>
<delete id="deleteByExample" parameterType="com.sztzjy.financial_bigdata.entity.TrainingReportExample">
delete from training_report
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</delete>
<insert id="insert" parameterType="com.sztzjy.financial_bigdata.entity.TrainingReport">
insert into training_report (report_id, chapter_id, chapter_name,
user_id, report_name, upload_time,
report_size, teacher_score, file_path,
school_id, teacher_comment)
values (#{reportId,jdbcType=VARCHAR}, #{chapterId,jdbcType=VARCHAR}, #{chapterName,jdbcType=VARCHAR},
#{userId,jdbcType=VARCHAR}, #{reportName,jdbcType=VARCHAR}, #{uploadTime,jdbcType=TIMESTAMP},
#{reportSize,jdbcType=INTEGER}, #{teacherScore,jdbcType=DECIMAL}, #{filePath,jdbcType=VARCHAR},
#{schoolId,jdbcType=VARCHAR}, #{teacherComment,jdbcType=LONGVARCHAR})
</insert>
<insert id="insertSelective" parameterType="com.sztzjy.financial_bigdata.entity.TrainingReport">
insert into training_report
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="reportId != null">
report_id,
</if>
<if test="chapterId != null">
chapter_id,
</if>
<if test="chapterName != null">
chapter_name,
</if>
<if test="userId != null">
user_id,
</if>
<if test="reportName != null">
report_name,
</if>
<if test="uploadTime != null">
upload_time,
</if>
<if test="reportSize != null">
report_size,
</if>
<if test="teacherScore != null">
teacher_score,
</if>
<if test="filePath != null">
file_path,
</if>
<if test="schoolId != null">
school_id,
</if>
<if test="teacherComment != null">
teacher_comment,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="reportId != null">
#{reportId,jdbcType=VARCHAR},
</if>
<if test="chapterId != null">
#{chapterId,jdbcType=VARCHAR},
</if>
<if test="chapterName != null">
#{chapterName,jdbcType=VARCHAR},
</if>
<if test="userId != null">
#{userId,jdbcType=VARCHAR},
</if>
<if test="reportName != null">
#{reportName,jdbcType=VARCHAR},
</if>
<if test="uploadTime != null">
#{uploadTime,jdbcType=TIMESTAMP},
</if>
<if test="reportSize != null">
#{reportSize,jdbcType=INTEGER},
</if>
<if test="teacherScore != null">
#{teacherScore,jdbcType=DECIMAL},
</if>
<if test="filePath != null">
#{filePath,jdbcType=VARCHAR},
</if>
<if test="schoolId != null">
#{schoolId,jdbcType=VARCHAR},
</if>
<if test="teacherComment != null">
#{teacherComment,jdbcType=LONGVARCHAR},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="com.sztzjy.financial_bigdata.entity.TrainingReportExample" resultType="java.lang.Long">
select count(*) from training_report
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</select>
<update id="updateByExampleSelective" parameterType="map">
update training_report
<set>
<if test="record.reportId != null">
report_id = #{record.reportId,jdbcType=VARCHAR},
</if>
<if test="record.chapterId != null">
chapter_id = #{record.chapterId,jdbcType=VARCHAR},
</if>
<if test="record.chapterName != null">
chapter_name = #{record.chapterName,jdbcType=VARCHAR},
</if>
<if test="record.userId != null">
user_id = #{record.userId,jdbcType=VARCHAR},
</if>
<if test="record.reportName != null">
report_name = #{record.reportName,jdbcType=VARCHAR},
</if>
<if test="record.uploadTime != null">
upload_time = #{record.uploadTime,jdbcType=TIMESTAMP},
</if>
<if test="record.reportSize != null">
report_size = #{record.reportSize,jdbcType=INTEGER},
</if>
<if test="record.teacherScore != null">
teacher_score = #{record.teacherScore,jdbcType=DECIMAL},
</if>
<if test="record.filePath != null">
file_path = #{record.filePath,jdbcType=VARCHAR},
</if>
<if test="record.schoolId != null">
school_id = #{record.schoolId,jdbcType=VARCHAR},
</if>
<if test="record.teacherComment != null">
teacher_comment = #{record.teacherComment,jdbcType=LONGVARCHAR},
</if>
</set>
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByExampleWithBLOBs" parameterType="map">
update training_report
set report_id = #{record.reportId,jdbcType=VARCHAR},
chapter_id = #{record.chapterId,jdbcType=VARCHAR},
chapter_name = #{record.chapterName,jdbcType=VARCHAR},
user_id = #{record.userId,jdbcType=VARCHAR},
report_name = #{record.reportName,jdbcType=VARCHAR},
upload_time = #{record.uploadTime,jdbcType=TIMESTAMP},
report_size = #{record.reportSize,jdbcType=INTEGER},
teacher_score = #{record.teacherScore,jdbcType=DECIMAL},
file_path = #{record.filePath,jdbcType=VARCHAR},
school_id = #{record.schoolId,jdbcType=VARCHAR},
teacher_comment = #{record.teacherComment,jdbcType=LONGVARCHAR}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByExample" parameterType="map">
update training_report
set report_id = #{record.reportId,jdbcType=VARCHAR},
chapter_id = #{record.chapterId,jdbcType=VARCHAR},
chapter_name = #{record.chapterName,jdbcType=VARCHAR},
user_id = #{record.userId,jdbcType=VARCHAR},
report_name = #{record.reportName,jdbcType=VARCHAR},
upload_time = #{record.uploadTime,jdbcType=TIMESTAMP},
report_size = #{record.reportSize,jdbcType=INTEGER},
teacher_score = #{record.teacherScore,jdbcType=DECIMAL},
file_path = #{record.filePath,jdbcType=VARCHAR},
school_id = #{record.schoolId,jdbcType=VARCHAR}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
</mapper>
Loading…
Cancel
Save