284 lines
8.6 KiB
XML
284 lines
8.6 KiB
XML
|
<?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="cn.com.tenlion.lesson.dao.lessons.ILessonsDao">
|
||
|
|
||
|
<resultMap id="lessonsDTO" type="cn.com.tenlion.lesson.pojo.dtos.lessons.LessonsDTO">
|
||
|
<result column="lesson_id" property="lessonId"/>
|
||
|
<result column="project_catalog_id" property="projectCatalogId"/>
|
||
|
<result column="lesson_name" property="lessonName"/>
|
||
|
<result column="lesson_type" property="lessonType"/>
|
||
|
<result column="teach_way" property="teachWay"/>
|
||
|
<result column="creator" property="creator"/>
|
||
|
<result column="gmt_create" property="gmtCreate"/>
|
||
|
<result column="modifier" property="modifier"/>
|
||
|
<result column="gmt_modified" property="gmtModified"/>
|
||
|
<result column="is_delete" property="isDelete"/>
|
||
|
</resultMap>
|
||
|
|
||
|
<resultMap id="lessonsBO" type="cn.com.tenlion.lesson.pojo.bos.lessons.LessonsBO">
|
||
|
<result column="lesson_id" property="lessonId"/>
|
||
|
<result column="project_catalog_id" property="projectCatalogId"/>
|
||
|
<result column="lesson_name" property="lessonName"/>
|
||
|
<result column="lesson_type" property="lessonType"/>
|
||
|
<result column="teach_way" property="teachWay"/>
|
||
|
<result column="creator" property="creator"/>
|
||
|
<result column="gmt_create" property="gmtCreate"/>
|
||
|
<result column="modifier" property="modifier"/>
|
||
|
<result column="gmt_modified" property="gmtModified"/>
|
||
|
<result column="is_delete" property="isDelete"/>
|
||
|
</resultMap>
|
||
|
|
||
|
<resultMap id="lessonsPO" type="cn.com.tenlion.lesson.pojo.pos.lessons.LessonsPO">
|
||
|
<result column="lesson_id" property="lessonId"/>
|
||
|
<result column="project_catalog_id" property="projectCatalogId"/>
|
||
|
<result column="lesson_name" property="lessonName"/>
|
||
|
<result column="lesson_type" property="lessonType"/>
|
||
|
<result column="teach_way" property="teachWay"/>
|
||
|
<result column="creator" property="creator"/>
|
||
|
<result column="gmt_create" property="gmtCreate"/>
|
||
|
<result column="modifier" property="modifier"/>
|
||
|
<result column="gmt_modified" property="gmtModified"/>
|
||
|
<result column="is_delete" property="isDelete"/>
|
||
|
</resultMap>
|
||
|
|
||
|
<!-- 新增 -->
|
||
|
<insert id="save" parameterType="map">
|
||
|
INSERT INTO e_lessons(
|
||
|
lesson_id,
|
||
|
project_catalog_id,
|
||
|
lesson_name,
|
||
|
lesson_type,
|
||
|
teach_way,
|
||
|
creator,
|
||
|
gmt_create,
|
||
|
modifier,
|
||
|
gmt_modified,
|
||
|
is_delete
|
||
|
) VALUES(
|
||
|
#{lessonId},
|
||
|
#{projectCatalogId},
|
||
|
#{lessonName},
|
||
|
#{lessonType},
|
||
|
#{teachWay},
|
||
|
#{creator},
|
||
|
#{gmtCreate},
|
||
|
#{modifier},
|
||
|
#{gmtModified},
|
||
|
#{isDelete}
|
||
|
)
|
||
|
</insert>
|
||
|
|
||
|
<!-- 删除 -->
|
||
|
<update id="remove" parameterType="map">
|
||
|
UPDATE
|
||
|
e_lessons
|
||
|
SET
|
||
|
gmt_modified = #{gmtModified},
|
||
|
modifier = #{modifier},
|
||
|
is_delete = 1
|
||
|
WHERE
|
||
|
<!-- 添加条件 -->
|
||
|
</update>
|
||
|
|
||
|
<!-- 删除(物理) -->
|
||
|
<update id="delete" parameterType="map">
|
||
|
DELETE FROM
|
||
|
e_lessons
|
||
|
WHERE
|
||
|
<!-- 添加条件 -->
|
||
|
</update>
|
||
|
|
||
|
<!-- 修改 -->
|
||
|
<update id="update" parameterType="map">
|
||
|
UPDATE
|
||
|
e_lessons
|
||
|
SET
|
||
|
<if test="lessonId != null and lessonId != ''">
|
||
|
lesson_id = #{lessonId},
|
||
|
</if>
|
||
|
<if test="projectCatalogId != null and projectCatalogId != ''">
|
||
|
project_catalog_id = #{projectCatalogId},
|
||
|
</if>
|
||
|
<if test="lessonName != null and lessonName != ''">
|
||
|
lesson_name = #{lessonName},
|
||
|
</if>
|
||
|
<if test="lessonType != null and lessonType != ''">
|
||
|
lesson_type = #{lessonType},
|
||
|
</if>
|
||
|
<if test="teachWay != null and teachWay != ''">
|
||
|
teach_way = #{teachWay},
|
||
|
</if>
|
||
|
gmt_modified = #{gmtModified},
|
||
|
modifier = #{modifier},
|
||
|
<!-- 填充条件 -->
|
||
|
WHERE
|
||
|
<!-- 添加条件 -->
|
||
|
</update>
|
||
|
|
||
|
<!-- 详情 -->
|
||
|
<select id="get" parameterType="map" resultMap="lessonsDTO">
|
||
|
SELECT
|
||
|
t1.lesson_id,
|
||
|
t1.project_catalog_id,
|
||
|
t1.lesson_name,
|
||
|
t1.lesson_type,
|
||
|
t1.teach_way,
|
||
|
1
|
||
|
FROM
|
||
|
e_lessons t1
|
||
|
WHERE
|
||
|
t1.is_delete = 0
|
||
|
<!-- 添加条件 -->
|
||
|
</select>
|
||
|
|
||
|
<!-- 详情 -->
|
||
|
<select id="getBO" parameterType="map" resultMap="lessonsBO">
|
||
|
SELECT
|
||
|
t1.lesson_id,
|
||
|
t1.project_catalog_id,
|
||
|
t1.lesson_name,
|
||
|
t1.lesson_type,
|
||
|
t1.teach_way,
|
||
|
t1.creator,
|
||
|
t1.gmt_create,
|
||
|
t1.modifier,
|
||
|
t1.gmt_modified,
|
||
|
t1.is_delete
|
||
|
FROM
|
||
|
e_lessons t1
|
||
|
WHERE
|
||
|
t1.is_delete = 0
|
||
|
<!-- 添加条件 -->
|
||
|
</select>
|
||
|
|
||
|
<!-- 详情 -->
|
||
|
<select id="getPO" parameterType="map" resultMap="lessonsPO">
|
||
|
SELECT
|
||
|
t1.lesson_id,
|
||
|
t1.project_catalog_id,
|
||
|
t1.lesson_name,
|
||
|
t1.lesson_type,
|
||
|
t1.teach_way,
|
||
|
t1.creator,
|
||
|
t1.gmt_create,
|
||
|
t1.modifier,
|
||
|
t1.gmt_modified,
|
||
|
t1.is_delete
|
||
|
FROM
|
||
|
e_lessons t1
|
||
|
WHERE
|
||
|
t1.is_delete = 0
|
||
|
<!-- 添加条件 -->
|
||
|
</select>
|
||
|
|
||
|
<!-- 列表 -->
|
||
|
<select id="list" parameterType="map" resultMap="lessonsDTO">
|
||
|
SELECT
|
||
|
t1.lesson_id,
|
||
|
t1.project_catalog_id,
|
||
|
t1.lesson_name,
|
||
|
t1.lesson_type,
|
||
|
t1.teach_way,
|
||
|
t1.creator,
|
||
|
t1.gmt_create,
|
||
|
t1.modifier,
|
||
|
t1.gmt_modified,
|
||
|
t1.is_delete,
|
||
|
1
|
||
|
FROM
|
||
|
e_lessons t1
|
||
|
WHERE
|
||
|
t1.is_delete = 0
|
||
|
<if test="keywords != null and keywords != ''">
|
||
|
AND (
|
||
|
<!-- 这里添加其他条件 -->
|
||
|
t1.id LIKE CONCAT('%', #{keywords}, '%')
|
||
|
)
|
||
|
</if>
|
||
|
<if test="startTime != null and startTime != ''">
|
||
|
AND
|
||
|
LEFT(t1.gmt_create, 10) <![CDATA[ >= ]]> #{startTime}
|
||
|
</if>
|
||
|
<if test="endTime != null and endTime != ''">
|
||
|
AND
|
||
|
LEFT(t1.gmt_create, 10) <![CDATA[ <= ]]> #{endTime}
|
||
|
</if>
|
||
|
</select>
|
||
|
|
||
|
<!-- 列表 -->
|
||
|
<select id="listBO" parameterType="map" resultMap="lessonsBO">
|
||
|
SELECT
|
||
|
t1.lesson_id,
|
||
|
t1.project_catalog_id,
|
||
|
t1.lesson_name,
|
||
|
t1.lesson_type,
|
||
|
t1.teach_way,
|
||
|
t1.creator,
|
||
|
t1.gmt_create,
|
||
|
t1.modifier,
|
||
|
t1.gmt_modified,
|
||
|
t1.is_delete
|
||
|
FROM
|
||
|
e_lessons t1
|
||
|
WHERE
|
||
|
t1.is_delete = 0
|
||
|
<if test="keywords != null and keywords != ''">
|
||
|
AND (
|
||
|
<!-- 这里添加其他条件 -->
|
||
|
t1.id LIKE CONCAT('%', #{keywords}, '%')
|
||
|
)
|
||
|
</if>
|
||
|
<if test="startTime != null and startTime != ''">
|
||
|
AND
|
||
|
LEFT(t1.gmt_create, 10) <![CDATA[ >= ]]> #{startTime}
|
||
|
</if>
|
||
|
<if test="endTime != null and endTime != ''">
|
||
|
AND
|
||
|
LEFT(t1.gmt_create, 10) <![CDATA[ <= ]]> #{endTime}
|
||
|
</if>
|
||
|
</select>
|
||
|
|
||
|
<!-- 列表 -->
|
||
|
<select id="listPO" parameterType="map" resultMap="lessonsPO">
|
||
|
SELECT
|
||
|
t1.lesson_id,
|
||
|
t1.project_catalog_id,
|
||
|
t1.lesson_name,
|
||
|
t1.lesson_type,
|
||
|
t1.teach_way,
|
||
|
t1.creator,
|
||
|
t1.gmt_create,
|
||
|
t1.modifier,
|
||
|
t1.gmt_modified,
|
||
|
t1.is_delete
|
||
|
FROM
|
||
|
e_lessons t1
|
||
|
WHERE
|
||
|
t1.is_delete = 0
|
||
|
<if test="keywords != null and keywords != ''">
|
||
|
AND (
|
||
|
<!-- 这里添加其他条件 -->
|
||
|
t1.id LIKE CONCAT('%', #{keywords}, '%')
|
||
|
)
|
||
|
</if>
|
||
|
<if test="startTime != null and startTime != ''">
|
||
|
AND
|
||
|
LEFT(t1.gmt_create, 10) <![CDATA[ >= ]]> #{startTime}
|
||
|
</if>
|
||
|
<if test="endTime != null and endTime != ''">
|
||
|
AND
|
||
|
LEFT(t1.gmt_create, 10) <![CDATA[ <= ]]> #{endTime}
|
||
|
</if>
|
||
|
</select>
|
||
|
|
||
|
<!-- 统计 -->
|
||
|
<select id="count" parameterType="map" resultType="Integer">
|
||
|
SELECT
|
||
|
COUNT(*)
|
||
|
FROM
|
||
|
e_lessons t1
|
||
|
WHERE
|
||
|
t1.is_delete = 0
|
||
|
</select>
|
||
|
|
||
|
</mapper>
|