拆表及行业,技能添加 by kevin.cui
This commit is contained in:
@@ -3,9 +3,9 @@ logging:
|
||||
|
||||
spring:
|
||||
redis:
|
||||
host: 192.168.0.96
|
||||
host: localhost
|
||||
datasource:
|
||||
url: jdbc:mysql://192.168.0.96:3306/xzs?useSSL=false&useUnicode=true&serverTimezone=Asia/Shanghai&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&allowPublicKeyRetrieval=true&allowMultiQueries=true
|
||||
url: jdbc:mysql://localhost:3306/xzs?useSSL=false&useUnicode=true&serverTimezone=Asia/Shanghai&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&allowPublicKeyRetrieval=true&allowMultiQueries=true
|
||||
username: root
|
||||
password: 123456
|
||||
password: lanfoo
|
||||
driver-class-name: com.mysql.cj.jdbc.Driver
|
||||
|
||||
@@ -5,6 +5,8 @@
|
||||
<id column="id" jdbcType="INTEGER" property="id" />
|
||||
<result column="question_type" jdbcType="INTEGER" property="questionType" />
|
||||
<result column="subject_id" jdbcType="INTEGER" property="subjectId" />
|
||||
<result column="industry_id" jdbcType="INTEGER" property="industryId" />
|
||||
<result column="skill_id" jdbcType="INTEGER" property="skillId" />
|
||||
<result column="score" jdbcType="INTEGER" property="score" />
|
||||
<result column="grade_level" jdbcType="INTEGER" property="gradeLevel" />
|
||||
<result column="difficult" jdbcType="INTEGER" property="difficult" />
|
||||
@@ -16,7 +18,7 @@
|
||||
<result column="deleted" jdbcType="BIT" property="deleted" />
|
||||
</resultMap>
|
||||
<sql id="Base_Column_List">
|
||||
id, question_type, subject_id, score, grade_level, difficult, correct, info_text_content_id,
|
||||
id, question_type, subject_id, industry_id, skill_id, score, grade_level, difficult, correct, info_text_content_id,
|
||||
create_user, status, create_time, deleted
|
||||
</sql>
|
||||
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
|
||||
@@ -53,6 +55,12 @@
|
||||
<if test="subjectId != null">
|
||||
subject_id,
|
||||
</if>
|
||||
<if test="industryId != null">
|
||||
industry_id,
|
||||
</if>
|
||||
<if test="skillId != null">
|
||||
skill_id,
|
||||
</if>
|
||||
<if test="score != null">
|
||||
score,
|
||||
</if>
|
||||
@@ -91,6 +99,12 @@
|
||||
<if test="subjectId != null">
|
||||
#{subjectId,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="industryId != null">
|
||||
#{industryId,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="skillId != null">
|
||||
#{skillId,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="score != null">
|
||||
#{score,jdbcType=INTEGER},
|
||||
</if>
|
||||
@@ -129,6 +143,12 @@
|
||||
<if test="subjectId != null">
|
||||
subject_id = #{subjectId,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="industryId != null">
|
||||
industry_id = #{industryId,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="skillId != null">
|
||||
skill_id = #{skillId,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="score != null">
|
||||
score = #{score,jdbcType=INTEGER},
|
||||
</if>
|
||||
@@ -196,6 +216,12 @@
|
||||
<if test="questionType != null ">
|
||||
and question_type= #{questionType}
|
||||
</if>
|
||||
<if test="industryId != null ">
|
||||
and industry_id= #{industryId}
|
||||
</if>
|
||||
<if test="skillId != null ">
|
||||
and skill_id= #{skillId}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
|
||||
69
source/xzs/src/main/resources/mapper/SkillMapper.xml
Normal file
69
source/xzs/src/main/resources/mapper/SkillMapper.xml
Normal file
@@ -0,0 +1,69 @@
|
||||
<?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.mindskip.xzs.repository.SkillMapper">
|
||||
<resultMap id="BaseResultMap" type="com.mindskip.xzs.domain.Skill">
|
||||
<id column="id" jdbcType="INTEGER" property="id" />
|
||||
<result column="name" jdbcType="VARCHAR" property="name" />
|
||||
</resultMap>
|
||||
<sql id="Base_Column_List">
|
||||
id, `name`
|
||||
</sql>
|
||||
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
|
||||
select
|
||||
<include refid="Base_Column_List" />
|
||||
from t_skill
|
||||
where id = #{id,jdbcType=INTEGER}
|
||||
</select>
|
||||
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
|
||||
delete from t_skill
|
||||
where id = #{id,jdbcType=INTEGER}
|
||||
</delete>
|
||||
<insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.mindskip.xzs.domain.Skill" useGeneratedKeys="true">
|
||||
insert into t_skill (`name`)
|
||||
values (#{name,jdbcType=VARCHAR})
|
||||
</insert>
|
||||
<insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.mindskip.xzs.domain.Skill" useGeneratedKeys="true">
|
||||
insert into t_skill
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="name != null">
|
||||
`name`,
|
||||
</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="name != null">
|
||||
#{name,jdbcType=VARCHAR},
|
||||
</if>
|
||||
</trim>
|
||||
</insert>
|
||||
<update id="updateByPrimaryKeySelective" parameterType="com.mindskip.xzs.domain.Skill">
|
||||
update t_skill
|
||||
<set>
|
||||
<if test="name != null">
|
||||
`name` = #{name,jdbcType=VARCHAR},
|
||||
</if>
|
||||
</set>
|
||||
where id = #{id,jdbcType=INTEGER}
|
||||
</update>
|
||||
<update id="updateByPrimaryKey" parameterType="com.mindskip.xzs.domain.Skill">
|
||||
update t_skill
|
||||
set `name` = #{name,jdbcType=VARCHAR}
|
||||
where id = #{id,jdbcType=INTEGER}
|
||||
</update>
|
||||
|
||||
<select id="page" resultMap="BaseResultMap" parameterType="com.mindskip.xzs.viewmodel.admin.skill.SkillEditRequestVM">
|
||||
SELECT
|
||||
<include refid="Base_Column_List"/>
|
||||
FROM t_skill
|
||||
<where>
|
||||
<if test="id != null ">
|
||||
and id= #{id}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="allSkill" resultMap="BaseResultMap">
|
||||
select
|
||||
<include refid="Base_Column_List"/>
|
||||
from t_skill
|
||||
</select>
|
||||
</mapper>
|
||||
Reference in New Issue
Block a user