Browse Source

作业定时任务UNIX_TIMESTAMP改为调用工具类获取参数

tags/正式版本
雍文秀 2 years ago
parent
commit
531ec7e8af

+ 2
- 1
sstudy/src/main/java/com/xhkjedu/sstudy/mapper/paperstudent/PaperStudentMapper.java View File

143
      * @author WN
143
      * @author WN
144
      * @date 2020/10/13
144
      * @date 2020/10/13
145
      * @param  * @param
145
      * @param  * @param
146
+     * @param stoptime
146
      * @return void
147
      * @return void
147
      */
148
      */
148
-    void updateShowanswer();
149
+    void updateShowanswer(@Param("stoptime") int stoptime);
149
 
150
 
150
 
151
 
151
     //////////////////////////////////////////////学生WEB端//////////////////////////////////////////////
152
     //////////////////////////////////////////////学生WEB端//////////////////////////////////////////////

+ 2
- 1
sstudy/src/main/java/com/xhkjedu/sstudy/service/paperstudent/PaperStudentService.java View File

788
      * @return void
788
      * @return void
789
      */
789
      */
790
     public void updateShowanswer(){
790
     public void updateShowanswer(){
791
-        paperStudentMapper.updateShowanswer();
791
+        int timestamp = N_Utils.getSecondTimestamp();
792
+        paperStudentMapper.updateShowanswer(timestamp);
792
     }
793
     }
793
 
794
 
794
 
795
 

+ 1
- 1
sstudy/src/main/resources/mapper/paperstudent/PaperStudentMapper.xml View File

179
 
179
 
180
     <update id="updateShowanswer">
180
     <update id="updateShowanswer">
181
         update t_paper_student ps left join t_paper_group pg on ps.paperid=pg.paperid
181
         update t_paper_student ps left join t_paper_group pg on ps.paperid=pg.paperid
182
-        set ps.showanswer=1 where pg.pgstate=22 AND pg.showtype=1 and ps.showanswer=0 and pg.stoptime <![CDATA[ <= ]]> UNIX_TIMESTAMP(NOW())
182
+        set ps.showanswer=1 where pg.pgstate=22 AND pg.showtype=1 and ps.showanswer=0 and pg.stoptime <![CDATA[ <= ]]> #{stoptime}
183
     </update>
183
     </update>
184
 
184
 
185
 
185
 

Loading…
Cancel
Save