|
@@ -6,6 +6,8 @@
|
|
|
<result column="title_" property="title" jdbcType="VARCHAR" />
|
|
|
<result column="create_on_" property="createOn" jdbcType="TIMESTAMP" />
|
|
|
<result column="modify_on_" property="modifyOn" jdbcType="TIMESTAMP" />
|
|
|
+ <result column="release_time_" property="releaseTime" jdbcType="INTEGER" />
|
|
|
+ <result column="release_status_" property="releaseStatus" jdbcType="INTEGER" />
|
|
|
<result column="status_" property="status" jdbcType="INTEGER" />
|
|
|
<result column="order_" property="order" jdbcType="INTEGER" />
|
|
|
<result column="catalog_id_" property="catalogId" jdbcType="BIGINT" />
|
|
@@ -38,12 +40,12 @@
|
|
|
</sql>
|
|
|
|
|
|
<sql id="Base_Column_List">
|
|
|
- id_, title_, catalog_id_, create_on_, modify_on_,status_,order_
|
|
|
+ id_, title_, catalog_id_, create_on_, modify_on_,status_,order_,release_time_,release_status_
|
|
|
</sql>
|
|
|
|
|
|
<sql id="Base_Column_List_union">
|
|
|
content.id_, content.title_, content.catalog_id_,
|
|
|
- content.create_on_,
|
|
|
+ content.create_on_,content.release_time_,content.release_status_,
|
|
|
content.modify_on_,content.status_,content.content_,content.order_,
|
|
|
catalog.id_,
|
|
|
catalog.name_, catalog.parent_id_,content.catalog_type_,content.create_by_,content.update_by_
|
|
@@ -93,13 +95,13 @@
|
|
|
<insert id="insert" parameterType="com.yonge.cooleshow.cms.dal.entity.HelpCenterContent">
|
|
|
insert into help_center_content
|
|
|
(id_, title_, catalog_id_,
|
|
|
- create_on_, modify_on_, content_,status_,order_,update_by_,create_by_,catalog_type_
|
|
|
+ create_on_, modify_on_, content_,status_,order_,update_by_,create_by_,catalog_type_,release_time_,release_status_
|
|
|
)
|
|
|
values
|
|
|
(#{id,jdbcType=INTEGER}, #{title,jdbcType=VARCHAR},
|
|
|
#{catalogId,jdbcType=INTEGER},
|
|
|
#{createOn,jdbcType=TIMESTAMP},
|
|
|
- #{modifyOn,jdbcType=TIMESTAMP}, #{content,jdbcType=LONGVARCHAR},#{status,jdbcType=INTEGER},#{order,jdbcType=INTEGER},#{createBy},#{updateBy},#{catalogType}
|
|
|
+ #{modifyOn,jdbcType=TIMESTAMP}, #{content,jdbcType=LONGVARCHAR},#{status,jdbcType=INTEGER},#{order,jdbcType=INTEGER},#{createBy},#{updateBy},#{catalogType},#{releaseTime},#{releaseStatus}
|
|
|
)
|
|
|
</insert>
|
|
|
|
|
@@ -133,6 +135,12 @@
|
|
|
<if test="createBy != null">
|
|
|
create_by_ = #{createBy},
|
|
|
</if>
|
|
|
+ <if test="releaseStatus != null">
|
|
|
+ release_status_ = #{releaseStatus},
|
|
|
+ </if>
|
|
|
+ <if test="releaseTime != null">
|
|
|
+ release_time_ = #{releaseTime},
|
|
|
+ </if>
|
|
|
<if test="catalogType != null and catalogType != ''">
|
|
|
catalog_type_ = #{catalogType}
|
|
|
</if>
|
|
@@ -152,6 +160,8 @@
|
|
|
content_ =
|
|
|
#{content,jdbcType=LONGVARCHAR},
|
|
|
status_= #{status,jdbcType=INTEGER},
|
|
|
+ release_status_= #{releaseStatus,jdbcType=INTEGER},
|
|
|
+ release_time_= #{releaseTime,jdbcType=INTEGER},
|
|
|
order_= #{order,jdbcType=INTEGER}
|
|
|
where id_ = #{id,jdbcType=INTEGER}
|
|
|
</update>
|
|
@@ -167,6 +177,8 @@
|
|
|
#{modifyOn,jdbcType=TIMESTAMP},
|
|
|
status_ = #{status,jdbcType=INTEGER},
|
|
|
order_ = #{order,jdbcType=INTEGER},
|
|
|
+ release_time_ = #{releaseTime,jdbcType=INTEGER},
|
|
|
+ release_status_ = #{releaseStatus,jdbcType=INTEGER}
|
|
|
where id_ = #{id,jdbcType=INTEGER}
|
|
|
</update>
|
|
|
|
|
@@ -178,4 +190,51 @@
|
|
|
update help_center_content set status_=if(status_ =0,1,0) where id_=#{catalogId}
|
|
|
|
|
|
</update>
|
|
|
+
|
|
|
+ <insert id="noticeReleaseToTeacher">
|
|
|
+ insert into sys_message
|
|
|
+ (
|
|
|
+ user_id_,type_, title_, content_,status_, receiver_, send_time_, create_on_, modify_on_, group_, client_id_
|
|
|
+ )
|
|
|
+ SELECT
|
|
|
+ t.user_id_,
|
|
|
+ 3,
|
|
|
+ #{param.title},
|
|
|
+ #{param.content},
|
|
|
+ 2,
|
|
|
+ su.phone_,
|
|
|
+ #{param.releaseTime},
|
|
|
+ now(),now(),'NOTICE','TEACHER'
|
|
|
+ from teacher t
|
|
|
+ left join sys_user su on su.id_ = t.user_id_
|
|
|
+ </insert>
|
|
|
+
|
|
|
+ <insert id="noticeReleaseToStudent">
|
|
|
+ insert into sys_message
|
|
|
+ (
|
|
|
+ user_id_,type_, title_, content_,status_, receiver_, send_time_, create_on_, modify_on_, group_, client_id_
|
|
|
+ )
|
|
|
+ SELECT
|
|
|
+ t.user_id_,
|
|
|
+ 3,
|
|
|
+ #{param.title},
|
|
|
+ #{param.content},
|
|
|
+ 2,
|
|
|
+ su.phone_,
|
|
|
+ #{param.releaseTime},
|
|
|
+ now(),now(),'NOTICE','STUDENT'
|
|
|
+ from student t
|
|
|
+ left join sys_user su on su.id_ = t.user_id_
|
|
|
+ </insert>
|
|
|
+
|
|
|
+ <select id="selectNeedReleaseNotice" resultMap="HelpCenterContent">
|
|
|
+ select
|
|
|
+ <include refid="Base_Column_List_union" />
|
|
|
+ from help_center_content content
|
|
|
+ left join help_center_catalog catalog on
|
|
|
+ content.catalog_id_=catalog.id_
|
|
|
+ where content.status_ = 0
|
|
|
+ and content.release_time_ <= date_add(now(),interval 5 MINUTE)
|
|
|
+ and content.catalog_id_ = 2
|
|
|
+ </select>
|
|
|
</mapper>
|