|
|
@@ -1,164 +1,192 @@
|
|
|
<?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.usoftchina.smartschool.school.mapper.HomeWorkMapper" >
|
|
|
- <resultMap id="BaseResultMap" type="com.usoftchina.smartschool.school.po.HomeWork" >
|
|
|
- <id column="task_id" property="task_id" jdbcType="BIGINT" />
|
|
|
- <result column="subject_id" property="subject_id" jdbcType="BIGINT" />
|
|
|
- <result column="task_title" property="task_title" jdbcType="VARCHAR" />
|
|
|
- <result column="task_status" property="task_status" jdbcType="INTEGER" />
|
|
|
- <result column="create_date" property="create_date" jdbcType="TIMESTAMP" />
|
|
|
- <result column="start_date" property="start_date" jdbcType="TIMESTAMP" />
|
|
|
- <result column="end_date" property="end_date" jdbcType="TIMESTAMP" />
|
|
|
- <result column="task_creator" property="task_creator" jdbcType="BIGINT" />
|
|
|
- <result column="school_id" property="school_id" jdbcType="BIGINT" />
|
|
|
- <result column="task_context" property="task_context" jdbcType="LONGVARCHAR" />
|
|
|
- <result column="task_files" property="task_files" jdbcType="LONGVARCHAR" />
|
|
|
- <result column="task_notifier" property="task_notifier" jdbcType="LONGVARCHAR" />
|
|
|
- <result column="classz_name" property="classz_name" jdbcType="VARCHAR" />
|
|
|
- <result column="grade_name" property="grade_name" jdbcType="VARCHAR" />
|
|
|
- <result column="publish_date" property="publish_date" jdbcType="TIMESTAMP" />
|
|
|
- </resultMap>
|
|
|
+<mapper namespace="com.usoftchina.smartschool.school.mapper.HomeWorkMapper">
|
|
|
+ <resultMap id="BaseResultMap" type="com.usoftchina.smartschool.school.po.HomeWork">
|
|
|
+ <id column="task_id" property="task_id" jdbcType="BIGINT"/>
|
|
|
+ <result column="subject_id" property="subject_id" jdbcType="BIGINT"/>
|
|
|
+ <result column="task_title" property="task_title" jdbcType="VARCHAR"/>
|
|
|
+ <result column="task_status" property="task_status" jdbcType="INTEGER"/>
|
|
|
+ <result column="create_date" property="create_date" jdbcType="TIMESTAMP"/>
|
|
|
+ <result column="start_date" property="start_date" jdbcType="TIMESTAMP"/>
|
|
|
+ <result column="end_date" property="end_date" jdbcType="TIMESTAMP"/>
|
|
|
+ <result column="task_creator" property="task_creator" jdbcType="BIGINT"/>
|
|
|
+ <result column="school_id" property="school_id" jdbcType="BIGINT"/>
|
|
|
+ <result column="task_context" property="task_context" jdbcType="LONGVARCHAR"/>
|
|
|
+ <result column="task_files" property="task_files" jdbcType="LONGVARCHAR"/>
|
|
|
+ <result column="task_notifier" property="task_notifier" jdbcType="LONGVARCHAR"/>
|
|
|
+ <result column="classz_name" property="classz_name" jdbcType="VARCHAR"/>
|
|
|
+ <result column="grade_name" property="grade_name" jdbcType="VARCHAR"/>
|
|
|
+ <result column="publish_date" property="publish_date" jdbcType="TIMESTAMP"/>
|
|
|
+ <result column="creator" property="creator" jdbcType="VARCHAR"/>
|
|
|
+ </resultMap>
|
|
|
|
|
|
- <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Long" >
|
|
|
+ <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Long">
|
|
|
select
|
|
|
*
|
|
|
from task_notify
|
|
|
where task_id = #{task_id,jdbcType=BIGINT}
|
|
|
</select>
|
|
|
- <delete id="deleteByPrimaryKey" parameterType="java.lang.Long" >
|
|
|
+ <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
|
|
|
delete from task_notify
|
|
|
where task_id = #{task_id,jdbcType=BIGINT}
|
|
|
</delete>
|
|
|
- <insert id="insert" parameterType="com.usoftchina.smartschool.school.po.HomeWork" >
|
|
|
+ <insert id="insert" parameterType="com.usoftchina.smartschool.school.po.HomeWork">
|
|
|
insert into task_notify (subject_id, task_title,
|
|
|
task_status, create_date, start_date,
|
|
|
end_date, task_creator, school_id,
|
|
|
task_context, task_files, task_notifier,
|
|
|
- classz_name, grade_name
|
|
|
+ classz_name, grade_name,creator
|
|
|
)
|
|
|
values (#{subject_id,jdbcType=BIGINT}, #{task_title,jdbcType=VARCHAR},
|
|
|
#{task_status,jdbcType=INTEGER}, #{create_date,jdbcType=TIMESTAMP}, #{start_date,jdbcType=TIMESTAMP},
|
|
|
#{end_date,jdbcType=TIMESTAMP}, #{task_creator,jdbcType=BIGINT}, #{school_id,jdbcType=BIGINT},
|
|
|
#{task_context,jdbcType=LONGVARCHAR}, #{task_files,jdbcType=LONGVARCHAR}, #{task_notifier,jdbcType=LONGVARCHAR},
|
|
|
- #{task_title,jdbcType=VARCHAR},#{task_title,jdbcType=VARCHAR}
|
|
|
+ #{task_title,jdbcType=VARCHAR},#{task_title,jdbcType=VARCHAR}, #{creator,jdbcType=VARCHAR}
|
|
|
)
|
|
|
</insert>
|
|
|
- <insert id="insertSelective" parameterType="com.usoftchina.smartschool.school.po.HomeWork" >
|
|
|
- <selectKey resultType="java.lang.Long" keyProperty="task_id">
|
|
|
- SELECT LAST_INSERT_ID() AS ID
|
|
|
- </selectKey>
|
|
|
- insert into task_notify
|
|
|
- <trim prefix="(" suffix=")" suffixOverrides="," >
|
|
|
- <if test="subject_id != null" >
|
|
|
- subject_id,
|
|
|
- </if>
|
|
|
- <if test="task_title != null" >
|
|
|
- task_title,
|
|
|
- </if>
|
|
|
- <if test="task_status != null" >
|
|
|
- task_status,
|
|
|
- </if>
|
|
|
- <if test="create_date != null" >
|
|
|
- create_date,
|
|
|
- </if>
|
|
|
- <if test="start_date != null" >
|
|
|
- start_date,
|
|
|
- </if>
|
|
|
- <if test="end_date != null" >
|
|
|
- end_date,
|
|
|
- </if>
|
|
|
- <if test="task_creator != null" >
|
|
|
- task_creator,
|
|
|
- </if>
|
|
|
- <if test="school_id != null" >
|
|
|
- school_id,
|
|
|
- </if>
|
|
|
- <if test="task_context != null" >
|
|
|
- task_context,
|
|
|
- </if>
|
|
|
- <if test="task_files != null" >
|
|
|
- task_files,
|
|
|
- </if>
|
|
|
- <if test="task_notifier != null" >
|
|
|
- task_notifier,
|
|
|
- </if>
|
|
|
- </trim>
|
|
|
- <trim prefix="values (" suffix=")" suffixOverrides="," >
|
|
|
- <if test="subject_id != null" >
|
|
|
- #{subject_id,jdbcType=BIGINT},
|
|
|
- </if>
|
|
|
- <if test="task_title != null" >
|
|
|
- #{task_title,jdbcType=VARCHAR},
|
|
|
- </if>
|
|
|
- <if test="task_status != null" >
|
|
|
- #{task_status,jdbcType=INTEGER},
|
|
|
- </if>
|
|
|
- <if test="create_date != null" >
|
|
|
- #{create_date,jdbcType=TIMESTAMP},
|
|
|
- </if>
|
|
|
- <if test="start_date != null" >
|
|
|
- #{start_date,jdbcType=TIMESTAMP},
|
|
|
- </if>
|
|
|
- <if test="end_date != null" >
|
|
|
- #{end_date,jdbcType=TIMESTAMP},
|
|
|
- </if>
|
|
|
- <if test="task_creator != null" >
|
|
|
- #{task_creator,jdbcType=BIGINT},
|
|
|
- </if>
|
|
|
- <if test="school_id != null" >
|
|
|
- #{school_id,jdbcType=BIGINT},
|
|
|
- </if>
|
|
|
- <if test="task_context != null" >
|
|
|
- #{task_context,jdbcType=LONGVARCHAR},
|
|
|
- </if>
|
|
|
- <if test="task_files != null" >
|
|
|
- #{task_files,jdbcType=LONGVARCHAR},
|
|
|
- </if>
|
|
|
- <if test="task_notifier != null" >
|
|
|
- #{task_notifier,jdbcType=LONGVARCHAR},
|
|
|
- </if>
|
|
|
- </trim>
|
|
|
- </insert>
|
|
|
- <update id="updateByPrimaryKeySelective" parameterType="com.usoftchina.smartschool.school.po.HomeWork" >
|
|
|
- update task_notify
|
|
|
- <set >
|
|
|
- <if test="subject_id != null" >
|
|
|
- subject_id = #{subject_id,jdbcType=BIGINT},
|
|
|
- </if>
|
|
|
- <if test="task_title != null" >
|
|
|
- task_title = #{task_title,jdbcType=VARCHAR},
|
|
|
- </if>
|
|
|
- <if test="task_status != null" >
|
|
|
- task_status = #{task_status,jdbcType=INTEGER},
|
|
|
- </if>
|
|
|
- <if test="create_date != null" >
|
|
|
- create_date = #{create_date,jdbcType=TIMESTAMP},
|
|
|
- </if>
|
|
|
- <if test="start_date != null" >
|
|
|
- start_date = #{start_date,jdbcType=TIMESTAMP},
|
|
|
- </if>
|
|
|
- <if test="end_date != null" >
|
|
|
- end_date = #{end_date,jdbcType=TIMESTAMP},
|
|
|
- </if>
|
|
|
- <if test="task_creator != null" >
|
|
|
- task_creator = #{task_creator,jdbcType=BIGINT},
|
|
|
- </if>
|
|
|
- <if test="school_id != null" >
|
|
|
- school_id = #{school_id,jdbcType=BIGINT},
|
|
|
- </if>
|
|
|
- <if test="task_context != null" >
|
|
|
- task_context = #{task_context,jdbcType=LONGVARCHAR},
|
|
|
- </if>
|
|
|
- <if test="task_files != null" >
|
|
|
- task_files = #{task_files,jdbcType=LONGVARCHAR},
|
|
|
- </if>
|
|
|
- <if test="task_notifier != null" >
|
|
|
- task_notifier = #{task_notifier,jdbcType=LONGVARCHAR},
|
|
|
- </if>
|
|
|
- </set>
|
|
|
- where task_id = #{task_id,jdbcType=BIGINT}
|
|
|
- </update>
|
|
|
- <update id="updateByPrimaryKeyWithBLOBs" parameterType="com.usoftchina.smartschool.school.po.HomeWork" >
|
|
|
+ <insert id="insertSelective" parameterType="com.usoftchina.smartschool.school.po.HomeWork">
|
|
|
+ <selectKey resultType="java.lang.Long" keyProperty="task_id">
|
|
|
+ SELECT LAST_INSERT_ID() AS ID
|
|
|
+ </selectKey>
|
|
|
+ insert into task_notify
|
|
|
+ <trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
+ <if test="subject_id != null">
|
|
|
+ subject_id,
|
|
|
+ </if>
|
|
|
+ <if test="task_title != null">
|
|
|
+ task_title,
|
|
|
+ </if>
|
|
|
+ <if test="task_status != null">
|
|
|
+ task_status,
|
|
|
+ </if>
|
|
|
+ <if test="create_date != null">
|
|
|
+ create_date,
|
|
|
+ </if>
|
|
|
+ <if test="start_date != null">
|
|
|
+ start_date,
|
|
|
+ </if>
|
|
|
+ <if test="end_date != null">
|
|
|
+ end_date,
|
|
|
+ </if>
|
|
|
+ <if test="task_creator != null">
|
|
|
+ task_creator,
|
|
|
+ </if>
|
|
|
+ <if test="school_id != null">
|
|
|
+ school_id,
|
|
|
+ </if>
|
|
|
+ <if test="task_context != null">
|
|
|
+ task_context,
|
|
|
+ </if>
|
|
|
+ <if test="task_files != null">
|
|
|
+ task_files,
|
|
|
+ </if>
|
|
|
+ <if test="task_notifier != null">
|
|
|
+ task_notifier,
|
|
|
+ </if>
|
|
|
+ <if test="classz_name != null">
|
|
|
+ classz_name,
|
|
|
+ </if>
|
|
|
+ <if test="grade_name != null">
|
|
|
+ grade_name,
|
|
|
+ </if>
|
|
|
+ <if test="creator != null">
|
|
|
+ creator,
|
|
|
+ </if>
|
|
|
+ </trim>
|
|
|
+ <trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
+ <if test="subject_id != null">
|
|
|
+ #{subject_id,jdbcType=BIGINT},
|
|
|
+ </if>
|
|
|
+ <if test="task_title != null">
|
|
|
+ #{task_title,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="task_status != null">
|
|
|
+ #{task_status,jdbcType=INTEGER},
|
|
|
+ </if>
|
|
|
+ <if test="create_date != null">
|
|
|
+ #{create_date,jdbcType=TIMESTAMP},
|
|
|
+ </if>
|
|
|
+ <if test="start_date != null">
|
|
|
+ #{start_date,jdbcType=TIMESTAMP},
|
|
|
+ </if>
|
|
|
+ <if test="end_date != null">
|
|
|
+ #{end_date,jdbcType=TIMESTAMP},
|
|
|
+ </if>
|
|
|
+ <if test="task_creator != null">
|
|
|
+ #{task_creator,jdbcType=BIGINT},
|
|
|
+ </if>
|
|
|
+ <if test="school_id != null">
|
|
|
+ #{school_id,jdbcType=BIGINT},
|
|
|
+ </if>
|
|
|
+ <if test="task_context != null">
|
|
|
+ #{task_context,jdbcType=LONGVARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="task_files != null">
|
|
|
+ #{task_files,jdbcType=LONGVARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="task_notifier != null">
|
|
|
+ #{task_notifier,jdbcType=LONGVARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="classz_name != null">
|
|
|
+ #{classz_name,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="grade_name != null">
|
|
|
+ #{grade_name,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="creator != null">
|
|
|
+ #{creator,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ </trim>
|
|
|
+ </insert>
|
|
|
+ <update id="updateByPrimaryKeySelective" parameterType="com.usoftchina.smartschool.school.po.HomeWork">
|
|
|
+ update task_notify
|
|
|
+ <set>
|
|
|
+ <if test="subject_id != null">
|
|
|
+ subject_id = #{subject_id,jdbcType=BIGINT},
|
|
|
+ </if>
|
|
|
+ <if test="task_title != null">
|
|
|
+ task_title = #{task_title,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="task_status != null">
|
|
|
+ task_status = #{task_status,jdbcType=INTEGER},
|
|
|
+ </if>
|
|
|
+ <if test="create_date != null">
|
|
|
+ create_date = #{create_date,jdbcType=TIMESTAMP},
|
|
|
+ </if>
|
|
|
+ <if test="start_date != null">
|
|
|
+ start_date = #{start_date,jdbcType=TIMESTAMP},
|
|
|
+ </if>
|
|
|
+ <if test="end_date != null">
|
|
|
+ end_date = #{end_date,jdbcType=TIMESTAMP},
|
|
|
+ </if>
|
|
|
+ <if test="task_creator != null">
|
|
|
+ task_creator = #{task_creator,jdbcType=BIGINT},
|
|
|
+ </if>
|
|
|
+ <if test="school_id != null">
|
|
|
+ school_id = #{school_id,jdbcType=BIGINT},
|
|
|
+ </if>
|
|
|
+ <if test="task_context != null">
|
|
|
+ task_context = #{task_context,jdbcType=LONGVARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="task_files != null">
|
|
|
+ task_files = #{task_files,jdbcType=LONGVARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="task_notifier != null">
|
|
|
+ task_notifier = #{task_notifier,jdbcType=LONGVARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="classz_name != null">
|
|
|
+ classz_name = #{classz_name,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="grade_name != null">
|
|
|
+ grade_name = #{grade_name,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="creator != null">
|
|
|
+ creator = #{creator,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ </set>
|
|
|
+ where task_id = #{task_id,jdbcType=BIGINT}
|
|
|
+ </update>
|
|
|
+ <update id="updateByPrimaryKeyWithBLOBs" parameterType="com.usoftchina.smartschool.school.po.HomeWork">
|
|
|
update task_notify
|
|
|
set subject_id = #{subject_id,jdbcType=BIGINT},
|
|
|
task_title = #{task_title,jdbcType=VARCHAR},
|
|
|
@@ -170,10 +198,13 @@
|
|
|
school_id = #{school_id,jdbcType=BIGINT},
|
|
|
task_context = #{task_context,jdbcType=LONGVARCHAR},
|
|
|
task_files = #{task_files,jdbcType=LONGVARCHAR},
|
|
|
- task_notifier = #{task_notifier,jdbcType=LONGVARCHAR}
|
|
|
+ task_notifier = #{task_notifier,jdbcType=LONGVARCHAR},
|
|
|
+ classz_name = #{classz_name,jdbcType=VARCHAR},
|
|
|
+ grade_name = #{grade_name,jdbcType=VARCHAR},
|
|
|
+ creator = #{creator,jdbcType=VARCHAR}
|
|
|
where task_id = #{task_id,jdbcType=BIGINT}
|
|
|
</update>
|
|
|
- <update id="updateByPrimaryKey" parameterType="com.usoftchina.smartschool.school.po.HomeWork" >
|
|
|
+ <update id="updateByPrimaryKey" parameterType="com.usoftchina.smartschool.school.po.HomeWork">
|
|
|
update task_notify
|
|
|
set subject_id = #{subject_id,jdbcType=BIGINT},
|
|
|
task_title = #{task_title,jdbcType=VARCHAR},
|
|
|
@@ -186,19 +217,19 @@
|
|
|
where task_id = #{task_id,jdbcType=BIGINT}
|
|
|
</update>
|
|
|
|
|
|
- <select id="selectByConditon" resultMap="BaseResultMap">
|
|
|
- select * from task_notify
|
|
|
- <where>
|
|
|
- <if test="con != null">
|
|
|
- ${con}
|
|
|
- </if>
|
|
|
- <if test="school_id != null">
|
|
|
- and school_id=#{school_id}
|
|
|
- </if>
|
|
|
- </where>
|
|
|
- ORDER BY task_id DESC
|
|
|
- </select>
|
|
|
- <update id="updateByPublish" parameterType="java.lang.Long">
|
|
|
+ <select id="selectByConditon" resultMap="BaseResultMap">
|
|
|
+ select * from task_notify
|
|
|
+ <where>
|
|
|
+ <if test="con != null">
|
|
|
+ ${con}
|
|
|
+ </if>
|
|
|
+ <if test="school_id != null">
|
|
|
+ and school_id=#{school_id}
|
|
|
+ </if>
|
|
|
+ </where>
|
|
|
+ ORDER BY task_id DESC
|
|
|
+ </select>
|
|
|
+ <update id="updateByPublish" parameterType="java.lang.Long">
|
|
|
update task_notify
|
|
|
set task_status = 1 ,
|
|
|
publish_date = now()
|