feat: 修改模块名称

This commit is contained in:
2024-02-19 19:48:33 +08:00
parent 2176bf8bd7
commit 9be9287a3e
218 changed files with 130 additions and 130 deletions

View File

@@ -0,0 +1,151 @@
<?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.landaiqing.subject.infra.basic.mapper.SubjectBriefDao">
<resultMap type="com.landaiqing.subject.infra.basic.entity.SubjectBrief" id="SubjectBriefMap">
<result property="id" column="id" jdbcType="INTEGER"/>
<result property="subjectId" column="subject_id" jdbcType="INTEGER"/>
<result property="subjectAnswer" column="subject_answer" jdbcType="VARCHAR"/>
<result property="createdBy" column="created_by" jdbcType="VARCHAR"/>
<result property="createdTime" column="created_time" jdbcType="TIMESTAMP"/>
<result property="updateBy" column="update_by" jdbcType="VARCHAR"/>
<result property="updateTime" column="update_time" jdbcType="TIMESTAMP"/>
<result property="isDeleted" column="is_deleted" jdbcType="INTEGER"/>
</resultMap>
<!--查询单个-->
<select id="queryById" resultMap="SubjectBriefMap">
select id,subject_id,subject_answer,created_by,created_time,update_by,update_time,is_deleted
from subject_brief
where id = #{id}
</select>
<!--查询指定行数据-->
<select id="queryAllByLimit" resultMap="SubjectBriefMap">
select
id,subject_id,subject_answer,created_by,created_time,update_by,update_time,is_deleted
from subject_brief
<where>
<if test="id != null">
and id = #{id}
</if>
<if test="subjectId != null">
and subject_id = #{subjectId}
</if>
<if test="subjectAnswer != null and subjectAnswer != ''">
and subject_answer = #{subjectAnswer}
</if>
<if test="createdBy != null and createdBy != ''">
and created_by = #{createdBy}
</if>
<if test="createdTime != null">
and created_time = #{createdTime}
</if>
<if test="updateBy != null and updateBy != ''">
and update_by = #{updateBy}
</if>
<if test="updateTime != null">
and update_time = #{updateTime}
</if>
<if test="isDeleted != null">
and is_deleted = #{isDeleted}
</if>
</where>
</select>
<!--统计总行数-->
<select id="count" resultType="java.lang.Long">
select count(1)
from subject_brief
<where>
<if test="id != null">
and id = #{id}
</if>
<if test="subjectId != null">
and subject_id = #{subjectId}
</if>
<if test="subjectAnswer != null and subjectAnswer != ''">
and subject_answer = #{subjectAnswer}
</if>
<if test="createdBy != null and createdBy != ''">
and created_by = #{createdBy}
</if>
<if test="createdTime != null">
and created_time = #{createdTime}
</if>
<if test="updateBy != null and updateBy != ''">
and update_by = #{updateBy}
</if>
<if test="updateTime != null">
and update_time = #{updateTime}
</if>
<if test="isDeleted != null">
and is_deleted = #{isDeleted}
</if>
</where>
</select>
<!--新增所有列-->
<insert id="insert" keyProperty="id" useGeneratedKeys="true">
insert into subject_brief(subject_id,subject_answer,created_by,created_time,update_by,update_time,is_deleted)
values (#{subjectId},#{subjectAnswer},#{createdBy},#{createdTime},#{updateBy},#{updateTime},#{isDeleted})
</insert>
<insert id="insertBatch" keyProperty="id" useGeneratedKeys="true">
insert into subject_brief(subject_id,subject_answer,created_by,created_time,update_by,update_time,is_deleted)
values
<foreach collection="entities" item="entity" separator=",">
(#{entity.subjectId},#{entity.subjectAnswer},#{entity.createdBy},#{entity.createdTime},#{entity.updateBy},#{entity.updateTime},#{entity.isDeleted})
</foreach>
</insert>
<insert id="insertOrUpdateBatch" keyProperty="id" useGeneratedKeys="true">
insert into subject_brief(subject_id,subject_answer,created_by,created_time,update_by,update_time,is_deleted)
values
<foreach collection="entities" item="entity" separator=",">
(#{entity.subjectId},#{entity.subjectAnswer},#{entity.createdBy},#{entity.createdTime},#{entity.updateBy},#{entity.updateTime},#{entity.isDeleted})
</foreach>
on duplicate key update
subject_id = values(subject_id)subject_answer = values(subject_answer)created_by =
values(created_by)created_time = values(created_time)update_by = values(update_by)update_time =
values(update_time)is_deleted = values(is_deleted)
</insert>
<!--通过主键修改数据-->
<update id="update">
update subject_brief
<set>
<if test="subjectId != null">
subject_id = #{subjectId},
</if>
<if test="subjectAnswer != null and subjectAnswer != ''">
subject_answer = #{subjectAnswer},
</if>
<if test="createdBy != null and createdBy != ''">
created_by = #{createdBy},
</if>
<if test="createdTime != null">
created_time = #{createdTime},
</if>
<if test="updateBy != null and updateBy != ''">
update_by = #{updateBy},
</if>
<if test="updateTime != null">
update_time = #{updateTime},
</if>
<if test="isDeleted != null">
is_deleted = #{isDeleted},
</if>
</set>
where id = #{id}
</update>
<!--通过主键删除-->
<delete id="deleteById">
delete
from subject_brief
where id = #{id}
</delete>
</mapper>

View File

@@ -0,0 +1,188 @@
<?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.landaiqing.subject.infra.basic.mapper.SubjectCategoryDao">
<resultMap type="com.landaiqing.subject.infra.basic.entity.SubjectCategory" id="SubjectCategoryMap">
<result property="id" column="id" jdbcType="INTEGER"/>
<result property="categoryName" column="category_name" jdbcType="VARCHAR"/>
<result property="categoryType" column="category_type" jdbcType="INTEGER"/>
<result property="imageUrl" column="image_url" jdbcType="VARCHAR"/>
<result property="parentId" column="parent_id" jdbcType="INTEGER"/>
<result property="createdBy" column="created_by" jdbcType="VARCHAR"/>
<result property="createdTime" column="created_time" jdbcType="TIMESTAMP"/>
<result property="updateBy" column="update_by" jdbcType="VARCHAR"/>
<result property="updateTime" column="update_time" jdbcType="TIMESTAMP"/>
<result property="isDeleted" column="is_deleted" jdbcType="INTEGER"/>
</resultMap>
<!--查询单个-->
<select id="queryById" resultMap="SubjectCategoryMap">
select id,
category_name,
category_type,
image_url,
parent_id,
created_by,
created_time,
update_by,
update_time
from subject_category
where id = #{id}
</select>
<!--统计总行数-->
<select id="count" resultType="java.lang.Long">
select count(1)
from subject_category
<where>
<if test="id != null">
and id = #{id}
</if>
<if test="categoryName != null and categoryName != ''">
and category_name = #{categoryName}
</if>
<if test="categoryType != null">
and category_type = #{categoryType}
</if>
<if test="imageUrl != null and imageUrl != ''">
and image_url = #{imageUrl}
</if>
<if test="parentId != null">
and parent_id = #{parentId}
</if>
<if test="createdBy != null and createdBy != ''">
and created_by = #{createdBy}
</if>
<if test="createdTime != null">
and created_time = #{createdTime}
</if>
<if test="updateBy != null and updateBy != ''">
and update_by = #{updateBy}
</if>
<if test="updateTime != null">
and update_time = #{updateTime}
</if>
<if test="isDeleted != null">
and is_deleted = #{isDeleted}
</if>
</where>
</select>
<!--查询分类-->
<select id="queryCategory" resultMap="SubjectCategoryMap">
select * from subject_category
<where>
<if test="id != null">
and id = #{id}
</if>
<if test="categoryName != null and categoryName != ''">
and category_name = #{categoryName}
</if>
<if test="categoryType != null">
and category_type = #{categoryType}
</if>
<if test="imageUrl != null and imageUrl != ''">
and image_url = #{imageUrl}
</if>
<if test="parentId != null">
and parent_id = #{parentId}
</if>
<if test="createdBy != null and createdBy != ''">
and created_by = #{createdBy}
</if>
<if test="createdTime != null">
and created_time = #{createdTime}
</if>
<if test="updateBy != null and updateBy != ''">
and update_by = #{updateBy}
</if>
<if test="updateTime != null">
and update_time = #{updateTime}
</if>
<if test="isDeleted != null">
and is_deleted = #{isDeleted}
</if>
</where>
</select>
<!--新增所有列-->
<insert id="insert" keyProperty="id" useGeneratedKeys="true">
insert into subject_category(category_name, category_type, image_url, parent_id, created_by, created_time,
update_by, update_time, is_deleted)
values (#{categoryName}, #{categoryType}, #{imageUrl}, #{parentId}, #{createdBy}, #{createdTime}, #{updateBy},
#{updateTime}, #{isDeleted})
</insert>
<insert id="insertBatch" keyProperty="id" useGeneratedKeys="true">
insert into subject_category(category_name, category_type, image_url, parent_id, created_by, created_time,
update_by, update_time)
values
<foreach collection="entities" item="entity" separator=",">
(#{entity.categoryName}, #{entity.categoryType}, #{entity.imageUrl}, #{entity.parentId},
#{entity.createdBy}, #{entity.createdTime}, #{entity.updateBy}, #{entity.updateTime})
</foreach>
</insert>
<insert id="insertOrUpdateBatch" keyProperty="id" useGeneratedKeys="true">
insert into subject_category(category_name, category_type, image_url, parent_id, created_by, created_time,
update_by, update_time)
values
<foreach collection="entities" item="entity" separator=",">
(#{entity.categoryName}, #{entity.categoryType}, #{entity.imageUrl}, #{entity.parentId},
#{entity.createdBy}, #{entity.createdTime}, #{entity.updateBy}, #{entity.updateTime})
</foreach>
on duplicate key update
category_name = values(category_name),
category_type = values(category_type),
image_url = values(image_url),
parent_id = values(parent_id),
created_by = values(created_by),
created_time = values(created_time),
update_by = values(update_by),
update_time = values(update_time)
</insert>
<!--通过主键修改数据-->
<update id="update">
update subject_category
<set>
<if test="categoryName != null and categoryName != ''">
category_name = #{categoryName},
</if>
<if test="categoryType != null">
category_type = #{categoryType},
</if>
<if test="imageUrl != null and imageUrl != ''">
image_url = #{imageUrl},
</if>
<if test="parentId != null">
parent_id = #{parentId},
</if>
<if test="createdBy != null and createdBy != ''">
created_by = #{createdBy},
</if>
<if test="createdTime != null">
created_time = #{createdTime},
</if>
<if test="updateBy != null and updateBy != ''">
update_by = #{updateBy},
</if>
<if test="updateTime != null">
update_time = #{updateTime},
</if>
<if test="isDeleted != null">
is_deleted = #{isDeleted},
</if>
</set>
where id = #{id}
</update>
<!--通过主键删除-->
<delete id="deleteById">
delete from subject_category where id = #{id}
</delete>
</mapper>

View File

@@ -0,0 +1,255 @@
<?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.landaiqing.subject.infra.basic.mapper.SubjectInfoDao">
<resultMap type="com.landaiqing.subject.infra.basic.entity.SubjectInfo" id="SubjectInfoMap">
<result property="id" column="id" jdbcType="INTEGER"/>
<result property="subjectName" column="subject_name" jdbcType="VARCHAR"/>
<result property="subjectDifficult" column="subject_difficult" jdbcType="INTEGER"/>
<result property="settleName" column="settle_name" jdbcType="VARCHAR"/>
<result property="subjectType" column="subject_type" jdbcType="INTEGER"/>
<result property="subjectScore" column="subject_score" jdbcType="INTEGER"/>
<result property="subjectParse" column="subject_parse" jdbcType="VARCHAR"/>
<result property="createdBy" column="created_by" jdbcType="VARCHAR"/>
<result property="createdTime" column="created_time" jdbcType="TIMESTAMP"/>
<result property="updateBy" column="update_by" jdbcType="VARCHAR"/>
<result property="updateTime" column="update_time" jdbcType="TIMESTAMP"/>
<result property="isDeleted" column="is_deleted" jdbcType="INTEGER"/>
</resultMap>
<!--查询单个-->
<select id="queryById" resultMap="SubjectInfoMap">
select id,
subject_name,
subject_difficult,
settle_name,
subject_type,
subject_score,
subject_parse,
created_by,
created_time,
update_by,
update_time,
is_deleted
from subject_info
where id = #{id}
</select>
<!--查询指定行数据-->
<select id="queryAllByLimit" resultMap="SubjectInfoMap">
select
id,subject_name,subject_difficult,settle_name,subject_type,subject_score,subject_parse,created_by,created_time,update_by,update_time,is_deleted
from subject_info
<where>
<if test="id != null">
and id = #{id}
</if>
<if test="subjectName != null and subjectName != ''">
and subject_name = #{subjectName}
</if>
<if test="subjectDifficult != null">
and subject_difficult = #{subjectDifficult}
</if>
<if test="settleName != null and settleName != ''">
and settle_name = #{settleName}
</if>
<if test="subjectType != null">
and subject_type = #{subjectType}
</if>
<if test="subjectScore != null">
and subject_score = #{subjectScore}
</if>
<if test="subjectParse != null and subjectParse != ''">
and subject_parse = #{subjectParse}
</if>
<if test="createdBy != null and createdBy != ''">
and created_by = #{createdBy}
</if>
<if test="createdTime != null">
and created_time = #{createdTime}
</if>
<if test="updateBy != null and updateBy != ''">
and update_by = #{updateBy}
</if>
<if test="updateTime != null">
and update_time = #{updateTime}
</if>
<if test="isDeleted != null">
and is_deleted = #{isDeleted}
</if>
</where>
limit #{pageable.offset}, #{pageable.pageSize}
</select>
<!--统计总行数-->
<select id="count" resultType="java.lang.Long">
select count(1)
from subject_info
<where>
<if test="id != null">
and id = #{id}
</if>
<if test="subjectName != null and subjectName != ''">
and subject_name = #{subjectName}
</if>
<if test="subjectDifficult != null">
and subject_difficult = #{subjectDifficult}
</if>
<if test="settleName != null and settleName != ''">
and settle_name = #{settleName}
</if>
<if test="subjectType != null">
and subject_type = #{subjectType}
</if>
<if test="subjectScore != null">
and subject_score = #{subjectScore}
</if>
<if test="subjectParse != null and subjectParse != ''">
and subject_parse = #{subjectParse}
</if>
<if test="createdBy != null and createdBy != ''">
and created_by = #{createdBy}
</if>
<if test="createdTime != null">
and created_time = #{createdTime}
</if>
<if test="updateBy != null and updateBy != ''">
and update_by = #{updateBy}
</if>
<if test="updateTime != null">
and update_time = #{updateTime}
</if>
<if test="isDeleted != null">
and is_deleted = #{isDeleted}
</if>
</where>
</select>
<select id="countByCondition" resultType="java.lang.Integer">
select count(1)
from subject_info a,
subject_mapping b
where a.id = b.subject_id
and b.label_id = #{labelId}
and b.category_id = #{categoryId}
and a.is_deleted = 0
and b.is_deleted = 0
<if test="subjectInfo.subjectDifficult != null">
and a.subject_difficult = #{subjectInfo.subjectDifficult}
</if>
<if test="subjectInfo.subjectType != null">
and a.subject_type = #{subjectInfo.subjectType}
</if>
</select>
<select id="queryPage" resultMap="SubjectInfoMap">
select a.id,
a.subject_name,
a.subject_difficult,
a.settle_name,
a.subject_type,
a.subject_score,
a.subject_parse,
a.created_by,
a.created_time,
a. update_by,
a.update_time,
a.is_deleted
from subject_info a,
subject_mapping b
where a.id = b.subject_id
and b.label_id = #{labelId}
and b.category_id = #{categoryId}
and a.is_deleted = 0
and b.is_deleted = 0
<if test="subjectInfo.subjectDifficult != null">
and a.subject_difficult = #{subjectInfo.subjectDifficult}
</if>
<if test="subjectInfo.subjectType != null">
and a.subject_type = #{subjectInfo.subjectType}
</if>
limit #{start},#{pageSize}
</select>
<!--新增所有列-->
<insert id="insert" keyProperty="id" useGeneratedKeys="true">
<selectKey resultType="java.lang.Long" keyProperty="id" order="AFTER">
SELECT LAST_INSERT_ID()
</selectKey>
insert into
subject_info(subject_name,subject_difficult,settle_name,subject_type,subject_score,subject_parse,created_by,created_time,update_by,update_time,is_deleted)
values
(#{subjectName},#{subjectDifficult},#{settleName},#{subjectType},#{subjectScore},#{subjectParse},#{createdBy},#{createdTime},#{updateBy},#{updateTime},#{isDeleted})
</insert>
<insert id="insertBatch" keyProperty="id" useGeneratedKeys="true">
insert into
subject_info(subject_name,subject_difficult,settle_name,subject_type,subject_score,subject_parse,created_by,created_time,update_by,update_time,is_deleted)
values
<foreach collection="entities" item="entity" separator=",">
(#{entity.subjectName},#{entity.subjectDifficult},#{entity.settleName},#{entity.subjectType},#{entity.subjectScore},#{entity.subjectParse},#{entity.createdBy},#{entity.createdTime},#{entity.updateBy},#{entity.updateTime},#{entity.isDeleted})
</foreach>
</insert>
<insert id="insertOrUpdateBatch" keyProperty="id" useGeneratedKeys="true">
insert into
subject_info(subject_name,subject_difficult,settle_name,subject_type,subject_score,subject_parse,created_by,created_time,update_by,update_time,is_deleted)
values
<foreach collection="entities" item="entity" separator=",">
(#{entity.subjectName},#{entity.subjectDifficult},#{entity.settleName},#{entity.subjectType},#{entity.subjectScore},#{entity.subjectParse},#{entity.createdBy},#{entity.createdTime},#{entity.updateBy},#{entity.updateTime},#{entity.isDeleted})
</foreach>
on duplicate key update
subject_name = values(subject_name)subject_difficult = values(subject_difficult)settle_name =
values(settle_name)subject_type = values(subject_type)subject_score = values(subject_score)subject_parse =
values(subject_parse)created_by = values(created_by)created_time = values(created_time)update_by =
values(update_by)update_time = values(update_time)is_deleted = values(is_deleted)
</insert>
<!--通过主键修改数据-->
<update id="update">
update subject_info
<set>
<if test="subjectName != null and subjectName != ''">
subject_name = #{subjectName},
</if>
<if test="subjectDifficult != null">
subject_difficult = #{subjectDifficult},
</if>
<if test="settleName != null and settleName != ''">
settle_name = #{settleName},
</if>
<if test="subjectType != null">
subject_type = #{subjectType},
</if>
<if test="subjectScore != null">
subject_score = #{subjectScore},
</if>
<if test="subjectParse != null and subjectParse != ''">
subject_parse = #{subjectParse},
</if>
<if test="createdBy != null and createdBy != ''">
created_by = #{createdBy},
</if>
<if test="createdTime != null">
created_time = #{createdTime},
</if>
<if test="updateBy != null and updateBy != ''">
update_by = #{updateBy},
</if>
<if test="updateTime != null">
update_time = #{updateTime},
</if>
<if test="isDeleted != null">
is_deleted = #{isDeleted},
</if>
</set>
where id = #{id}
</update>
<!--通过主键删除-->
<delete id="deleteById">
delete
from subject_info
where id = #{id}
</delete>
</mapper>

View File

@@ -0,0 +1,151 @@
<?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.landaiqing.subject.infra.basic.mapper.SubjectJudgeDao">
<resultMap type="com.landaiqing.subject.infra.basic.entity.SubjectJudge" id="SubjectJudgeMap">
<result property="id" column="id" jdbcType="INTEGER"/>
<result property="subjectId" column="subject_id" jdbcType="INTEGER"/>
<result property="isCorrect" column="is_correct" jdbcType="INTEGER"/>
<result property="createdBy" column="created_by" jdbcType="VARCHAR"/>
<result property="createdTime" column="created_time" jdbcType="TIMESTAMP"/>
<result property="updateBy" column="update_by" jdbcType="VARCHAR"/>
<result property="updateTime" column="update_time" jdbcType="TIMESTAMP"/>
<result property="isDeleted" column="is_deleted" jdbcType="INTEGER"/>
</resultMap>
<!--查询单个-->
<select id="queryById" resultMap="SubjectJudgeMap">
select id,subject_id,is_correct,created_by,created_time,update_by,update_time,is_deleted
from subject_judge
where id = #{id}
</select>
<!--查询指定行数据-->
<select id="queryAllByLimit" resultMap="SubjectJudgeMap">
select
id,subject_id,is_correct,created_by,created_time,update_by,update_time,is_deleted
from subject_judge
<where>
<if test="id != null">
and id = #{id}
</if>
<if test="subjectId != null">
and subject_id = #{subjectId}
</if>
<if test="isCorrect != null">
and is_correct = #{isCorrect}
</if>
<if test="createdBy != null and createdBy != ''">
and created_by = #{createdBy}
</if>
<if test="createdTime != null">
and created_time = #{createdTime}
</if>
<if test="updateBy != null and updateBy != ''">
and update_by = #{updateBy}
</if>
<if test="updateTime != null">
and update_time = #{updateTime}
</if>
<if test="isDeleted != null">
and is_deleted = #{isDeleted}
</if>
</where>
</select>
<!--统计总行数-->
<select id="count" resultType="java.lang.Long">
select count(1)
from subject_judge
<where>
<if test="id != null">
and id = #{id}
</if>
<if test="subjectId != null">
and subject_id = #{subjectId}
</if>
<if test="isCorrect != null">
and is_correct = #{isCorrect}
</if>
<if test="createdBy != null and createdBy != ''">
and created_by = #{createdBy}
</if>
<if test="createdTime != null">
and created_time = #{createdTime}
</if>
<if test="updateBy != null and updateBy != ''">
and update_by = #{updateBy}
</if>
<if test="updateTime != null">
and update_time = #{updateTime}
</if>
<if test="isDeleted != null">
and is_deleted = #{isDeleted}
</if>
</where>
</select>
<!--新增所有列-->
<insert id="insert" keyProperty="id" useGeneratedKeys="true">
insert into subject_judge(subject_id,is_correct,created_by,created_time,update_by,update_time,is_deleted)
values (#{subjectId},#{isCorrect},#{createdBy},#{createdTime},#{updateBy},#{updateTime},#{isDeleted})
</insert>
<insert id="insertBatch" keyProperty="id" useGeneratedKeys="true">
insert into subject_judge(subject_id,is_correct,created_by,created_time,update_by,update_time,is_deleted)
values
<foreach collection="entities" item="entity" separator=",">
(#{entity.subjectId},#{entity.isCorrect},#{entity.createdBy},#{entity.createdTime},#{entity.updateBy},#{entity.updateTime},#{entity.isDeleted})
</foreach>
</insert>
<insert id="insertOrUpdateBatch" keyProperty="id" useGeneratedKeys="true">
insert into subject_judge(subject_id,is_correct,created_by,created_time,update_by,update_time,is_deleted)
values
<foreach collection="entities" item="entity" separator=",">
(#{entity.subjectId},#{entity.isCorrect},#{entity.createdBy},#{entity.createdTime},#{entity.updateBy},#{entity.updateTime},#{entity.isDeleted})
</foreach>
on duplicate key update
subject_id = values(subject_id)is_correct = values(is_correct)created_by = values(created_by)created_time =
values(created_time)update_by = values(update_by)update_time = values(update_time)is_deleted =
values(is_deleted)
</insert>
<!--通过主键修改数据-->
<update id="update">
update subject_judge
<set>
<if test="subjectId != null">
subject_id = #{subjectId},
</if>
<if test="isCorrect != null">
is_correct = #{isCorrect},
</if>
<if test="createdBy != null and createdBy != ''">
created_by = #{createdBy},
</if>
<if test="createdTime != null">
created_time = #{createdTime},
</if>
<if test="updateBy != null and updateBy != ''">
update_by = #{updateBy},
</if>
<if test="updateTime != null">
update_time = #{updateTime},
</if>
<if test="isDeleted != null">
is_deleted = #{isDeleted},
</if>
</set>
where id = #{id}
</update>
<!--通过主键删除-->
<delete id="deleteById">
delete
from subject_judge
where id = #{id}
</delete>
</mapper>

View File

@@ -0,0 +1,170 @@
<?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.landaiqing.subject.infra.basic.mapper.SubjectLabelDao">
<resultMap type="com.landaiqing.subject.infra.basic.entity.SubjectLabel" id="SubjectLabelMap">
<result property="id" column="id" jdbcType="INTEGER"/>
<result property="labelName" column="label_name" jdbcType="VARCHAR"/>
<result property="sortNum" column="sort_num" jdbcType="INTEGER"/>
<result property="categoryId" column="category_id" jdbcType="INTEGER"/>
<result property="createdBy" column="created_by" jdbcType="VARCHAR"/>
<result property="createdTime" column="created_time" jdbcType="TIMESTAMP"/>
<result property="updateBy" column="update_by" jdbcType="VARCHAR"/>
<result property="updateTime" column="update_time" jdbcType="TIMESTAMP"/>
<result property="isDeleted" column="is_deleted" jdbcType="INTEGER"/>
</resultMap>
<!--查询单个-->
<select id="queryById" resultMap="SubjectLabelMap">
select id,label_name,sort_num,category_id,created_by,created_time,update_by,update_time,is_deleted
from subject_label
where id = #{id}
</select>
<!--查询指定行数据-->
<select id="queryByCondition" resultMap="SubjectLabelMap">
select
id,label_name,sort_num,category_id,created_by,created_time,update_by,update_time,is_deleted
from subject_label
<where>
<if test="id != null">
and id = #{id}
</if>
<if test="labelName != null and labelName != ''">
and label_name = #{labelName}
</if>
<if test="sortNum != null">
and sort_num = #{sortNum}
</if>
<if test="categoryId != null">
and category_id = #{categoryId}
</if>
<if test="createdBy != null and createdBy != ''">
and created_by = #{createdBy}
</if>
<if test="createdTime != null">
and created_time = #{createdTime}
</if>
<if test="updateBy != null and updateBy != ''">
and update_by = #{updateBy}
</if>
<if test="updateTime != null">
and update_time = #{updateTime}
</if>
<if test="isDeleted != null">
and is_deleted = #{isDeleted}
</if>
</where>
</select>
<!--统计总行数-->
<select id="count" resultType="java.lang.Long">
select count(1)
from subject_label
<where>
<if test="id != null">
and id = #{id}
</if>
<if test="labelName != null and labelName != ''">
and label_name = #{labelName}
</if>
<if test="sortNum != null">
and sort_num = #{sortNum}
</if>
<if test="categoryId != null">
and category_id = #{categoryId}
</if>
<if test="createdBy != null and createdBy != ''">
and created_by = #{createdBy}
</if>
<if test="createdTime != null">
and created_time = #{createdTime}
</if>
<if test="updateBy != null and updateBy != ''">
and update_by = #{updateBy}
</if>
<if test="updateTime != null">
and update_time = #{updateTime}
</if>
<if test="isDeleted != null">
and is_deleted = #{isDeleted}
</if>
</where>
</select>
<select id="batchQueryById" resultMap="SubjectLabelMap">
select
id,label_name,sort_num,category_id,created_by,created_time,update_by,update_time,is_deleted
from subject_label
where id in
<foreach open="(" close=")" collection="list" item="id" separator=",">
#{id}
</foreach>
</select>
<!--新增所有列-->
<insert id="insert" keyProperty="id" useGeneratedKeys="true">
insert into subject_label(label_name,sort_num,category_id,created_by,created_time,update_by,update_time,is_deleted)
values (#{labelName},#{sortNum},#{categoryId},#{createdBy},#{createdTime},#{updateBy},#{updateTime},#{isDeleted})
</insert>
<insert id="insertBatch" keyProperty="id" useGeneratedKeys="true">
insert into subject_label(label_name,sort_num,category_id,created_by,created_time,update_by,update_time,is_deleted)
values
<foreach collection="entities" item="entity" separator=",">
(#{entity.labelName},#{entity.sortNum},#{entity.categoryId},#{entity.createdBy},#{entity.createdTime},#{entity.updateBy},#{entity.updateTime},#{entity.isDeleted})
</foreach>
</insert>
<insert id="insertOrUpdateBatch" keyProperty="id" useGeneratedKeys="true">
insert into subject_label(label_name,sort_num,category_id,created_by,created_time,update_by,update_time,is_deleted)
values
<foreach collection="entities" item="entity" separator=",">
(#{entity.labelName},#{entity.sortNum},#{entity.categoryId},#{entity.createdBy},#{entity.createdTime},#{entity.updateBy},#{entity.updateTime},#{entity.isDeleted})
</foreach>
on duplicate key update
label_name = values(label_name)sort_num = values(sort_num)category_id = values(category_id)created_by =
values(created_by)created_time = values(created_time)update_by = values(update_by)update_time =
values(update_time)is_deleted = values(is_deleted)
</insert>
<!--通过主键修改数据-->
<update id="update">
update subject_label
<set>
<if test="labelName != null and labelName != ''">
label_name = #{labelName},
</if>
<if test="sortNum != null">
sort_num = #{sortNum},
</if>
<if test="categoryId != null">
category_id = #{categoryId},
</if>
<if test="createdBy != null and createdBy != ''">
created_by = #{createdBy},
</if>
<if test="createdTime != null">
created_time = #{createdTime},
</if>
<if test="updateBy != null and updateBy != ''">
update_by = #{updateBy},
</if>
<if test="updateTime != null">
update_time = #{updateTime},
</if>
<if test="isDeleted != null">
is_deleted = #{isDeleted},
</if>
</set>
where id = #{id}
</update>
<!--通过主键删除-->
<delete id="deleteById">
delete
from subject_label
where id = #{id}
</delete>
</mapper>

View File

@@ -0,0 +1,196 @@
<?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.landaiqing.subject.infra.basic.mapper.SubjectMappingDao">
<resultMap type="com.landaiqing.subject.infra.basic.entity.SubjectMapping" id="SubjectMappingMap">
<result property="id" column="id" jdbcType="INTEGER"/>
<result property="subjectId" column="subject_id" jdbcType="INTEGER"/>
<result property="categoryId" column="category_id" jdbcType="INTEGER"/>
<result property="labelId" column="label_id" jdbcType="INTEGER"/>
<result property="createdBy" column="created_by" jdbcType="VARCHAR"/>
<result property="createdTime" column="created_time" jdbcType="TIMESTAMP"/>
<result property="updateBy" column="update_by" jdbcType="VARCHAR"/>
<result property="updateTime" column="update_time" jdbcType="TIMESTAMP"/>
<result property="isDeleted" column="is_deleted" jdbcType="INTEGER"/>
</resultMap>
<!--查询单个-->
<select id="queryById" resultMap="SubjectMappingMap">
select id,subject_id,category_id,label_id,created_by,created_time,update_by,update_time,is_deleted
from subject_mapping
where id = #{id}
</select>
<!--查询指定行数据-->
<select id="queryAllByLimit" resultMap="SubjectMappingMap">
select
id,subject_id,category_id,label_id,created_by,created_time,update_by,update_time,is_deleted
from subject_mapping
<where>
<if test="id != null">
and id = #{id}
</if>
<if test="subjectId != null">
and subject_id = #{subjectId}
</if>
<if test="categoryId != null">
and category_id = #{categoryId}
</if>
<if test="labelId != null">
and label_id = #{labelId}
</if>
<if test="createdBy != null and createdBy != ''">
and created_by = #{createdBy}
</if>
<if test="createdTime != null">
and created_time = #{createdTime}
</if>
<if test="updateBy != null and updateBy != ''">
and update_by = #{updateBy}
</if>
<if test="updateTime != null">
and update_time = #{updateTime}
</if>
<if test="isDeleted != null">
and is_deleted = #{isDeleted}
</if>
</where>
limit #{pageable.offset}, #{pageable.pageSize}
</select>
<!--统计总行数-->
<select id="count" resultType="java.lang.Long">
select count(1)
from subject_mapping
<where>
<if test="id != null">
and id = #{id}
</if>
<if test="subjectId != null">
and subject_id = #{subjectId}
</if>
<if test="categoryId != null">
and category_id = #{categoryId}
</if>
<if test="labelId != null">
and label_id = #{labelId}
</if>
<if test="createdBy != null and createdBy != ''">
and created_by = #{createdBy}
</if>
<if test="createdTime != null">
and created_time = #{createdTime}
</if>
<if test="updateBy != null and updateBy != ''">
and update_by = #{updateBy}
</if>
<if test="updateTime != null">
and update_time = #{updateTime}
</if>
<if test="isDeleted != null">
and is_deleted = #{isDeleted}
</if>
</where>
</select>
<select id="queryDistinctLabelId" resultMap="SubjectMappingMap">
select
distinct label_id
from subject_mapping
<where>
<if test="id != null">
and id = #{id}
</if>
<if test="subjectId != null">
and subject_id = #{subjectId}
</if>
<if test="categoryId != null">
and category_id = #{categoryId}
</if>
<if test="labelId != null">
and label_id = #{labelId}
</if>
<if test="createdBy != null and createdBy != ''">
and created_by = #{createdBy}
</if>
<if test="createdTime != null">
and created_time = #{createdTime}
</if>
<if test="updateBy != null and updateBy != ''">
and update_by = #{updateBy}
</if>
<if test="updateTime != null">
and update_time = #{updateTime}
</if>
<if test="isDeleted != null">
and is_deleted = #{isDeleted}
</if>
</where>
</select>
<!--新增所有列-->
<insert id="insert" keyProperty="id" useGeneratedKeys="true">
insert into subject_mapping(subject_id,category_id,label_id,created_by,created_time,update_by,update_time,is_deleted)
values (#{subjectId},#{categoryId},#{labelId},#{createdBy},#{createdTime},#{updateBy},#{updateTime},#{isDeleted})
</insert>
<insert id="insertBatch" keyProperty="id" useGeneratedKeys="true">
insert into subject_mapping(subject_id,category_id,label_id,created_by,created_time,update_by,update_time,is_deleted)
values
<foreach collection="entities" item="entity" separator=",">
(#{entity.subjectId},#{entity.categoryId},#{entity.labelId},#{entity.createdBy},#{entity.createdTime},#{entity.updateBy},#{entity.updateTime},#{entity.isDeleted})
</foreach>
</insert>
<insert id="insertOrUpdateBatch" keyProperty="id" useGeneratedKeys="true">
insert into subject_mapping(subject_id,category_id,label_id,created_by,created_time,update_by,update_time,is_deleted)
values
<foreach collection="entities" item="entity" separator=",">
(#{entity.subjectId},#{entity.categoryId},#{entity.labelId},#{entity.createdBy},#{entity.createdTime},#{entity.updateBy},#{entity.updateTime},#{entity.isDeleted})
</foreach>
on duplicate key update
subject_id = values(subject_id)category_id = values(category_id)label_id = values(label_id)created_by =
values(created_by)created_time = values(created_time)update_by = values(update_by)update_time =
values(update_time)is_deleted = values(is_deleted)
</insert>
<!--通过主键修改数据-->
<update id="update">
update subject_mapping
<set>
<if test="subjectId != null">
subject_id = #{subjectId},
</if>
<if test="categoryId != null">
category_id = #{categoryId},
</if>
<if test="labelId != null">
label_id = #{labelId},
</if>
<if test="createdBy != null and createdBy != ''">
created_by = #{createdBy},
</if>
<if test="createdTime != null">
created_time = #{createdTime},
</if>
<if test="updateBy != null and updateBy != ''">
update_by = #{updateBy},
</if>
<if test="updateTime != null">
update_time = #{updateTime},
</if>
<if test="isDeleted != null">
is_deleted = #{isDeleted},
</if>
</set>
where id = #{id}
</update>
<!--通过主键删除-->
<delete id="deleteById">
delete
from subject_mapping
where id = #{id}
</delete>
</mapper>

View File

@@ -0,0 +1,174 @@
<?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.landaiqing.subject.infra.basic.mapper.SubjectMultipleDao">
<resultMap type="com.landaiqing.subject.infra.basic.entity.SubjectMultiple" id="SubjectMultipleMap">
<result property="id" column="id" jdbcType="INTEGER"/>
<result property="subjectId" column="subject_id" jdbcType="INTEGER"/>
<result property="optionType" column="option_type" jdbcType="INTEGER"/>
<result property="optionContent" column="option_content" jdbcType="VARCHAR"/>
<result property="isCorrect" column="is_correct" jdbcType="INTEGER"/>
<result property="createdBy" column="created_by" jdbcType="VARCHAR"/>
<result property="createdTime" column="created_time" jdbcType="TIMESTAMP"/>
<result property="updateBy" column="update_by" jdbcType="VARCHAR"/>
<result property="updateTime" column="update_time" jdbcType="TIMESTAMP"/>
<result property="isDeleted" column="is_deleted" jdbcType="INTEGER"/>
</resultMap>
<!--查询单个-->
<select id="queryById" resultMap="SubjectMultipleMap">
select id,subject_id,option_type,option_content,is_correct,created_by,created_time,update_by,update_time,is_deleted
from subject_multiple
where id = #{id}
</select>
<!--查询指定行数据-->
<select id="queryAllByLimit" resultMap="SubjectMultipleMap">
select
id,subject_id,option_type,option_content,is_correct,created_by,created_time,update_by,update_time,is_deleted
from subject_multiple
<where>
<if test="id != null">
and id = #{id}
</if>
<if test="subjectId != null">
and subject_id = #{subjectId}
</if>
<if test="optionType != null">
and option_type = #{optionType}
</if>
<if test="optionContent != null and optionContent != ''">
and option_content = #{optionContent}
</if>
<if test="isCorrect != null">
and is_correct = #{isCorrect}
</if>
<if test="createdBy != null and createdBy != ''">
and created_by = #{createdBy}
</if>
<if test="createdTime != null">
and created_time = #{createdTime}
</if>
<if test="updateBy != null and updateBy != ''">
and update_by = #{updateBy}
</if>
<if test="updateTime != null">
and update_time = #{updateTime}
</if>
<if test="isDeleted != null">
and is_deleted = #{isDeleted}
</if>
</where>
</select>
<!--统计总行数-->
<select id="count" resultType="java.lang.Long">
select count(1)
from subject_multiple
<where>
<if test="id != null">
and id = #{id}
</if>
<if test="subjectId != null">
and subject_id = #{subjectId}
</if>
<if test="optionType != null">
and option_type = #{optionType}
</if>
<if test="optionContent != null and optionContent != ''">
and option_content = #{optionContent}
</if>
<if test="isCorrect != null">
and is_correct = #{isCorrect}
</if>
<if test="createdBy != null and createdBy != ''">
and created_by = #{createdBy}
</if>
<if test="createdTime != null">
and created_time = #{createdTime}
</if>
<if test="updateBy != null and updateBy != ''">
and update_by = #{updateBy}
</if>
<if test="updateTime != null">
and update_time = #{updateTime}
</if>
<if test="isDeleted != null">
and is_deleted = #{isDeleted}
</if>
</where>
</select>
<!--新增所有列-->
<insert id="insert" keyProperty="id" useGeneratedKeys="true">
insert into subject_multiple(subject_id,option_type,option_content,is_correct,created_by,created_time,update_by,update_time,is_deleted)
values (#{subjectId},#{optionType},#{optionContent},#{isCorrect},#{createdBy},#{createdTime},#{updateBy},#{updateTime},#{isDeleted})
</insert>
<insert id="insertBatch" keyProperty="id" useGeneratedKeys="true">
insert into
subject_multiple(subject_id,option_type,option_content,is_correct,created_by,created_time,update_by,update_time,is_deleted)
values
<foreach collection="entities" item="entity" separator=",">
(#{entity.subjectId},#{entity.optionType},#{entity.optionContent},#{entity.isCorrect},#{entity.createdBy},#{entity.createdTime},#{entity.updateBy},#{entity.updateTime},#{entity.isDeleted})
</foreach>
</insert>
<insert id="insertOrUpdateBatch" keyProperty="id" useGeneratedKeys="true">
insert into
subject_multiple(subject_id,option_type,option_content,is_correct,created_by,created_time,update_by,update_time,is_deleted)
values
<foreach collection="entities" item="entity" separator=",">
(#{entity.subjectId},#{entity.optionType},#{entity.optionContent},#{entity.isCorrect},#{entity.createdBy},#{entity.createdTime},#{entity.updateBy},#{entity.updateTime},#{entity.isDeleted})
</foreach>
on duplicate key update
subject_id = values(subject_id)option_type = values(option_type)option_content =
values(option_content)is_correct = values(is_correct)created_by = values(created_by)created_time =
values(created_time)update_by = values(update_by)update_time = values(update_time)is_deleted =
values(is_deleted)
</insert>
<!--通过主键修改数据-->
<update id="update">
update subject_multiple
<set>
<if test="subjectId != null">
subject_id = #{subjectId},
</if>
<if test="optionType != null">
option_type = #{optionType},
</if>
<if test="optionContent != null and optionContent != ''">
option_content = #{optionContent},
</if>
<if test="isCorrect != null">
is_correct = #{isCorrect},
</if>
<if test="createdBy != null and createdBy != ''">
created_by = #{createdBy},
</if>
<if test="createdTime != null">
created_time = #{createdTime},
</if>
<if test="updateBy != null and updateBy != ''">
update_by = #{updateBy},
</if>
<if test="updateTime != null">
update_time = #{updateTime},
</if>
<if test="isDeleted != null">
is_deleted = #{isDeleted},
</if>
</set>
where id = #{id}
</update>
<!--通过主键删除-->
<delete id="deleteById">
delete
from subject_multiple
where id = #{id}
</delete>
</mapper>

View File

@@ -0,0 +1,174 @@
<?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.landaiqing.subject.infra.basic.mapper.SubjectRadioDao">
<resultMap type="com.landaiqing.subject.infra.basic.entity.SubjectRadio" id="SubjectRadioMap">
<result property="id" column="id" jdbcType="INTEGER"/>
<result property="subjectId" column="subject_id" jdbcType="INTEGER"/>
<result property="optionType" column="option_type" jdbcType="INTEGER"/>
<result property="optionContent" column="option_content" jdbcType="VARCHAR"/>
<result property="isCorrect" column="is_correct" jdbcType="INTEGER"/>
<result property="createdBy" column="created_by" jdbcType="VARCHAR"/>
<result property="createdTime" column="created_time" jdbcType="TIMESTAMP"/>
<result property="updateBy" column="update_by" jdbcType="VARCHAR"/>
<result property="updateTime" column="update_time" jdbcType="TIMESTAMP"/>
<result property="isDeleted" column="is_deleted" jdbcType="INTEGER"/>
</resultMap>
<!--查询单个-->
<select id="queryById" resultMap="SubjectRadioMap">
select id,subject_id,option_type,option_content,is_correct,created_by,created_time,update_by,update_time,is_deleted
from subject_radio
where id = #{id}
</select>
<!--查询指定行数据-->
<select id="queryAllByLimit" resultMap="SubjectRadioMap">
select
id,subject_id,option_type,option_content,is_correct,created_by,created_time,update_by,update_time,is_deleted
from subject_radio
<where>
<if test="id != null">
and id = #{id}
</if>
<if test="subjectId != null">
and subject_id = #{subjectId}
</if>
<if test="optionType != null">
and option_type = #{optionType}
</if>
<if test="optionContent != null and optionContent != ''">
and option_content = #{optionContent}
</if>
<if test="isCorrect != null">
and is_correct = #{isCorrect}
</if>
<if test="createdBy != null and createdBy != ''">
and created_by = #{createdBy}
</if>
<if test="createdTime != null">
and created_time = #{createdTime}
</if>
<if test="updateBy != null and updateBy != ''">
and update_by = #{updateBy}
</if>
<if test="updateTime != null">
and update_time = #{updateTime}
</if>
<if test="isDeleted != null">
and is_deleted = #{isDeleted}
</if>
</where>
</select>
<!--统计总行数-->
<select id="count" resultType="java.lang.Long">
select count(1)
from subject_radio
<where>
<if test="id != null">
and id = #{id}
</if>
<if test="subjectId != null">
and subject_id = #{subjectId}
</if>
<if test="optionType != null">
and option_type = #{optionType}
</if>
<if test="optionContent != null and optionContent != ''">
and option_content = #{optionContent}
</if>
<if test="isCorrect != null">
and is_correct = #{isCorrect}
</if>
<if test="createdBy != null and createdBy != ''">
and created_by = #{createdBy}
</if>
<if test="createdTime != null">
and created_time = #{createdTime}
</if>
<if test="updateBy != null and updateBy != ''">
and update_by = #{updateBy}
</if>
<if test="updateTime != null">
and update_time = #{updateTime}
</if>
<if test="isDeleted != null">
and is_deleted = #{isDeleted}
</if>
</where>
</select>
<!--新增所有列-->
<insert id="insert" keyProperty="id" useGeneratedKeys="true">
insert into subject_radio(subject_id,option_type,option_content,is_correct,created_by,created_time,update_by,update_time,is_deleted)
values (#{subjectId},#{optionType},#{optionContent},#{isCorrect},#{createdBy},#{createdTime},#{updateBy},#{updateTime},#{isDeleted})
</insert>
<insert id="insertBatch" keyProperty="id" useGeneratedKeys="true">
insert into
subject_radio(subject_id,option_type,option_content,is_correct,created_by,created_time,update_by,update_time,is_deleted)
values
<foreach collection="entities" item="entity" separator=",">
(#{entity.subjectId},#{entity.optionType},#{entity.optionContent},#{entity.isCorrect},#{entity.createdBy},#{entity.createdTime},#{entity.updateBy},#{entity.updateTime},#{entity.isDeleted})
</foreach>
</insert>
<insert id="insertOrUpdateBatch" keyProperty="id" useGeneratedKeys="true">
insert into
subject_radio(subject_id,option_type,option_content,is_correct,created_by,created_time,update_by,update_time,is_deleted)
values
<foreach collection="entities" item="entity" separator=",">
(#{entity.subjectId},#{entity.optionType},#{entity.optionContent},#{entity.isCorrect},#{entity.createdBy},#{entity.createdTime},#{entity.updateBy},#{entity.updateTime},#{entity.isDeleted})
</foreach>
on duplicate key update
subject_id = values(subject_id)option_type = values(option_type)option_content =
values(option_content)is_correct = values(is_correct)created_by = values(created_by)created_time =
values(created_time)update_by = values(update_by)update_time = values(update_time)is_deleted =
values(is_deleted)
</insert>
<!--通过主键修改数据-->
<update id="update">
update subject_radio
<set>
<if test="subjectId != null">
subject_id = #{subjectId},
</if>
<if test="optionType != null">
option_type = #{optionType},
</if>
<if test="optionContent != null and optionContent != ''">
option_content = #{optionContent},
</if>
<if test="isCorrect != null">
is_correct = #{isCorrect},
</if>
<if test="createdBy != null and createdBy != ''">
created_by = #{createdBy},
</if>
<if test="createdTime != null">
created_time = #{createdTime},
</if>
<if test="updateBy != null and updateBy != ''">
update_by = #{updateBy},
</if>
<if test="updateTime != null">
update_time = #{updateTime},
</if>
<if test="isDeleted != null">
is_deleted = #{isDeleted},
</if>
</set>
where id = #{id}
</update>
<!--通过主键删除-->
<delete id="deleteById">
delete
from subject_radio
where id = #{id}
</delete>
</mapper>