<?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.mindskip.xzs.repository.OnlineStudyMapper">
|
|
<select id="page" resultType="com.mindskip.xzs.domain.vo.OnlineStudyVO">
|
SELECT
|
id,content_type, content_url, belong_type, subject, create_time, update_time, attachment
|
FROM
|
t_online_study
|
<where>
|
AND deleted = 0
|
<if test="query.subject != null and query.subject != ''">
|
AND subject like concat('%', #{query.subject}, '%')
|
</if>
|
</where>
|
ORDER BY
|
create_time DESC
|
</select>
|
|
<insert id="add" keyColumn="id" useGeneratedKeys="true" parameterType="com.mindskip.xzs.domain.OnlineStudy">
|
INSERT INTO t_online_study(content_type, content_url, belong_type, subject, create_time, update_time,
|
attachment)
|
value (#{form.contentType}, #{form.contentUrl}, #{form.belongType}, #{form.subject}, #{form.createTime}, #{form.updateTime}, #{form.attachment})
|
</insert>
|
|
<update id="update" parameterType="com.mindskip.xzs.domain.vo.OnlineStudyVO">
|
UPDATE
|
t_online_study
|
<set>
|
<if test="form.contentType != null and form.contentType != ''">content_type = #{form.contentType},</if>
|
<if test="form.contentUrl != null and form.contentUrl != ''">content_url = #{form.contentUrl},</if>
|
<if test="form.belong_type != null and form.belong_type != ''">belong_type = #{form.belongType},</if>
|
<if test="form.belongType != null and form.belongType != ''">belong_type = #{form.belongType},</if>
|
<if test="form.subject != null and form.subject != ''">subject = #{form.subject},</if>
|
<if test="form.updateTime != null">update_time = #{form.updateTime},</if>
|
<if test="form.attachment != null and form.attachment != ''">attachment = #{form.attachment},</if>
|
</set>
|
WHERE
|
id = #{vo.id}
|
</update>
|
|
<update id="remove">
|
UPDATE t_online_study SET deleted = 1 WHERE id IN
|
<foreach collection="ids" open="(" separator="," close=")" item="id">#{id}</foreach>
|
</update>
|
|
|
</mapper>
|