RuoYi/ruoyi-train/src/main/resources/mapper/train/course/TrainCourseMapper.xml

49 lines
2.7 KiB
XML
Raw Normal View History

<?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">
2018-12-24 11:09:21 +08:00
<mapper namespace="com.ruoyi.train.course.mapper.TrainCourseMapper">
<resultMap type="TrainCourse" id="TrainCourseResult">
<result property="id" column="id" />
<result property="deptId" column="dept_id" />
<result property="trainCourseCategoryId" column="train_course_category_id" />
<result property="name" column="name" />
2018-12-25 23:43:27 +08:00
<result property="price" column="price" />
<result property="cover" column="cover" />
<result property="description" column="description" />
<result property="state" column="state" />
<result property="delFlag" column="del_flag" />
<result property="createBy" column="create_by" />
<result property="createTime" column="create_time" />
<result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" />
<result property="remark" column="remark" />
</resultMap>
<sql id="selectTrainCourseVo">
2018-12-25 23:43:27 +08:00
id, dept_id, train_course_category_id, name,price, cover, description, state, del_flag, create_by, create_time, update_by, update_time, remark </sql>
<select id="selectTrainCourseList" parameterType="TrainCourse" resultMap="TrainCourseResult">
select
<include refid="selectTrainCourseVo"/>
from train_course
<where>
<if test="id != null "> and id = #{id}</if>
<if test="deptId != null "> and dept_id = #{deptId}</if>
<if test="trainCourseCategoryId != null "> and train_course_category_id = #{trainCourseCategoryId}</if>
<if test="name != null and name != '' "> and name = #{name}</if>
<if test="cover != null and cover != '' "> and cover = #{cover}</if>
<if test="description != null and description != '' "> and description = #{description}</if>
<if test="state != null and state != '' "> and state = #{state}</if>
<if test="delFlag != null and delFlag != '' "> and del_flag = #{delFlag}</if>
<if test="createBy != null and createBy != '' "> and create_by = #{createBy}</if>
<if test="createTime != null "> and create_time = #{createTime}</if>
<if test="updateBy != null and updateBy != '' "> and update_by = #{updateBy}</if>
<if test="updateTime != null "> and update_time = #{updateTime}</if>
<if test="remark != null and remark != '' "> and remark = #{remark}</if>
</where>
</select>
</mapper>