136 lines
7.4 KiB
XML
136 lines
7.4 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="com.yanzhu.manage.mapper.BusTrainingVideoMapper">
|
|
|
|
<resultMap type="BusTrainingVideo" id="BusTrainingVideoResult">
|
|
<result property="id" column="id" />
|
|
<result property="deptId" column="dept_id" />
|
|
<result property="deptName" column="dept_name"/>
|
|
<result property="projectId" column="project_id" />
|
|
<result property="trainTitle" column="train_title" />
|
|
<result property="trainType" column="train_type" />
|
|
<result property="trainLevel" column="train_level" />
|
|
<result property="craftType" column="craft_type" />
|
|
<result property="craftPost" column="craft_post" />
|
|
<result property="trainFileType" column="train_file_type" />
|
|
<result property="trainFilePath" column="train_file_path" />
|
|
<result property="trainFileImage" column="train_file_image" />
|
|
<result property="trainFileTimes" column="train_file_times" />
|
|
<result property="ord" column="ord"/>
|
|
<result property="isDel" column="is_del" />
|
|
<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="selectBusTrainingVideoVo">
|
|
select bus_training_video.*,sys_dept.dept_name
|
|
from bus_training_video
|
|
left join sys_dept on bus_training_video.dept_id=sys_dept.dept_id
|
|
</sql>
|
|
|
|
<select id="selectBusTrainingVideoList" parameterType="BusTrainingVideo" resultMap="BusTrainingVideoResult">
|
|
<include refid="selectBusTrainingVideoVo"/>
|
|
<where>
|
|
<if test="deptId != null "> and dept_id = #{deptId}</if>
|
|
<if test="projectId != null "> and project_id = #{projectId}</if>
|
|
<if test="trainTitle != null and trainTitle != ''"> and train_title like concat('%', #{trainTitle}, '%')</if>
|
|
<if test="trainType != null and trainType != ''"> and train_type = #{trainType}</if>
|
|
<if test="trainLevel != null and trainLevel != ''"> and train_level = #{trainLevel}</if>
|
|
<if test="craftType != null and craftType != ''"> and craft_type = #{craftType}</if>
|
|
<if test="craftPost != null and craftPost != ''"> and craft_post = #{craftPost}</if>
|
|
<if test="trainFileType != null and trainFileType != ''"> and train_file_type = #{trainFileType}</if>
|
|
<if test="isDel != null "> and is_del = #{isDel}</if>
|
|
</where>
|
|
order by ord
|
|
</select>
|
|
|
|
<select id="selectBusTrainingVideoById" parameterType="Long" resultMap="BusTrainingVideoResult">
|
|
<include refid="selectBusTrainingVideoVo"/>
|
|
where id = #{id}
|
|
</select>
|
|
|
|
<insert id="insertBusTrainingVideo" parameterType="BusTrainingVideo" useGeneratedKeys="true" keyProperty="id">
|
|
insert into bus_training_video
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
<if test="deptId != null">dept_id,</if>
|
|
<if test="projectId != null">project_id,</if>
|
|
<if test="trainTitle != null">train_title,</if>
|
|
<if test="trainType != null">train_type,</if>
|
|
<if test="trainLevel != null">train_level,</if>
|
|
<if test="craftType != null">craft_type,</if>
|
|
<if test="craftPost != null">craft_post,</if>
|
|
<if test="trainFileType != null">train_file_type,</if>
|
|
<if test="trainFilePath != null">train_file_path,</if>
|
|
<if test="trainFileImage != null">train_file_image,</if>
|
|
<if test="trainFileTimes != null">train_file_times,</if>
|
|
<if test="ord != null and ord>=0">ord,</if>
|
|
<if test="isDel != null">is_del,</if>
|
|
<if test="createBy != null">create_by,</if>
|
|
<if test="createTime != null">create_time,</if>
|
|
<if test="updateBy != null">update_by,</if>
|
|
<if test="updateTime != null">update_time,</if>
|
|
<if test="remark != null">remark,</if>
|
|
</trim>
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
<if test="deptId != null">#{deptId},</if>
|
|
<if test="projectId != null">#{projectId},</if>
|
|
<if test="trainTitle != null">#{trainTitle},</if>
|
|
<if test="trainType != null">#{trainType},</if>
|
|
<if test="trainLevel != null">#{trainLevel},</if>
|
|
<if test="craftType != null">#{craftType},</if>
|
|
<if test="craftPost != null">#{craftPost},</if>
|
|
<if test="trainFileType != null">#{trainFileType},</if>
|
|
<if test="trainFilePath != null">#{trainFilePath},</if>
|
|
<if test="trainFileImage != null">#{trainFileImage},</if>
|
|
<if test="trainFileTimes != null">#{trainFileTimes},</if>
|
|
<if test="ord != null and ord>=0">#{ord},</if>
|
|
<if test="isDel != null">#{isDel},</if>
|
|
<if test="createBy != null">#{createBy},</if>
|
|
<if test="createTime != null">#{createTime},</if>
|
|
<if test="updateBy != null">#{updateBy},</if>
|
|
<if test="updateTime != null">#{updateTime},</if>
|
|
<if test="remark != null">#{remark},</if>
|
|
</trim>
|
|
</insert>
|
|
|
|
<update id="updateBusTrainingVideo" parameterType="BusTrainingVideo">
|
|
update bus_training_video
|
|
<trim prefix="SET" suffixOverrides=",">
|
|
<if test="deptId != null">dept_id = #{deptId},</if>
|
|
<if test="projectId != null">project_id = #{projectId},</if>
|
|
<if test="trainTitle != null">train_title = #{trainTitle},</if>
|
|
<if test="trainType != null">train_type = #{trainType},</if>
|
|
<if test="trainLevel != null">train_level = #{trainLevel},</if>
|
|
<if test="craftType != null">craft_type = #{craftType},</if>
|
|
<if test="craftPost != null">craft_post = #{craftPost},</if>
|
|
<if test="trainFileType != null">train_file_type = #{trainFileType},</if>
|
|
<if test="trainFilePath != null">train_file_path = #{trainFilePath},</if>
|
|
<if test="trainFileImage != null">train_file_image = #{trainFileImage},</if>
|
|
<if test="trainFileTimes != null">train_file_times = #{trainFileTimes},</if>
|
|
<if test="ord != null and ord>=0">ord = #{ord},</if>
|
|
<if test="isDel != null">is_del = #{isDel},</if>
|
|
<if test="createBy != null">create_by = #{createBy},</if>
|
|
<if test="createTime != null">create_time = #{createTime},</if>
|
|
<if test="updateBy != null">update_by = #{updateBy},</if>
|
|
<if test="updateTime != null">update_time = #{updateTime},</if>
|
|
<if test="remark != null">remark = #{remark},</if>
|
|
</trim>
|
|
where id = #{id}
|
|
</update>
|
|
|
|
<delete id="deleteBusTrainingVideoById" parameterType="Long">
|
|
delete from bus_training_video where id = #{id}
|
|
</delete>
|
|
|
|
<delete id="deleteBusTrainingVideoByIds" parameterType="String">
|
|
delete from bus_training_video where id in
|
|
<foreach item="id" collection="array" open="(" separator="," close=")">
|
|
#{id}
|
|
</foreach>
|
|
</delete>
|
|
</mapper> |