295 lines
9.1 KiB
XML
295 lines
9.1 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.dao.lessons.ILessonsDao">
|
|
|
|
<resultMap id="lessonsDTO" type="cn.com.tenlion.pojo.dtos.lessons.LessonsDTO">
|
|
<result column="lesson_id" property="lessonId"/>
|
|
<result column="org_id" property="orgId"/>
|
|
<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.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.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,
|
|
org_id,
|
|
project_catalog_id,
|
|
lesson_name,
|
|
lesson_type,
|
|
teach_way,
|
|
creator,
|
|
gmt_create,
|
|
modifier,
|
|
gmt_modified,
|
|
is_delete
|
|
) VALUES(
|
|
#{lessonId},
|
|
#{orgId},
|
|
#{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
|
|
lesson_id IN
|
|
<foreach collection="lessonIds" index="index" open="(" separator="," close=")">
|
|
#{lessonIds[${index}]}
|
|
</foreach>
|
|
</update>
|
|
|
|
<!-- 删除(物理) -->
|
|
<update id="delete" parameterType="map">
|
|
DELETE FROM
|
|
e_lessons
|
|
WHERE
|
|
lesson_id IN
|
|
<foreach collection="lessonIds" index="index" open="(" separator="," close=")">
|
|
#{lessonIds[${index}]}
|
|
</foreach>
|
|
</update>
|
|
|
|
<!-- 修改 -->
|
|
<update id="update" parameterType="map">
|
|
UPDATE
|
|
e_lessons
|
|
SET
|
|
<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
|
|
lesson_id = #{lessonId}
|
|
</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
|
|
FROM
|
|
e_lessons t1
|
|
WHERE
|
|
t1.is_delete = 0
|
|
<if test="lessonId != null and lessonId != ''">
|
|
AND t1.lesson_id = #{lessonId}
|
|
</if>
|
|
</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
|
|
<if test="lessonId != null and lessonId != ''">
|
|
AND t1.lesson_id = #{lessonId}
|
|
</if>
|
|
</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
|
|
<if test="lessonId != null and lessonId != ''">
|
|
AND t1.lesson_id = #{lessonId}
|
|
</if>
|
|
</select>
|
|
|
|
<!-- 列表 -->
|
|
<select id="list" parameterType="map" resultMap="lessonsDTO">
|
|
SELECT
|
|
t1.lesson_id,
|
|
t1.org_id,
|
|
t1.project_catalog_id,
|
|
t1.lesson_name,
|
|
t1.lesson_type,
|
|
t1.teach_way
|
|
FROM
|
|
e_lessons t1
|
|
WHERE
|
|
t1.is_delete = 0
|
|
<if test="orgId != null">
|
|
AND t1.org_id = #{orgId}
|
|
</if>
|
|
<if test="projectCatalogId != null and projectCatalogId != ''">
|
|
AND t1.project_catalog_id = #{projectCatalogId}
|
|
</if>
|
|
<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> |