You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
32 lines
1.4 KiB
32 lines
1.4 KiB
package com.zh.project0512.mapper;
|
|
|
|
import com.zh.project0512.model.Brand;
|
|
import com.zh.project0512.model.TeachingRefe;
|
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
|
import org.apache.ibatis.annotations.Update;
|
|
|
|
/**
|
|
* <p>
|
|
* Mapper 接口
|
|
* </p>
|
|
*
|
|
* @author zh
|
|
* @since 2022-06-14
|
|
*/
|
|
public interface TeachingRefeMapper extends BaseMapper<TeachingRefe> {
|
|
@Update("update teachingRefe set sortWeight = sortWeight + 1 where sortWeight <> 0;;\n" +
|
|
"insert into teachingRefe ( fileUrl,type,title, creatAt,sortWeight) VALUES ( #{fileUrl},#{type},#{title}, #{creatAt},1 );")
|
|
void addTeachingRefe(TeachingRefe teachingRefe);
|
|
@Update("<script>" +
|
|
"update teachingRefe set sortWeight = -1 where sortWeight = #{origin};\n" +
|
|
"<if test='originHigherCurrent'> " +
|
|
"update teachingRefe set sortWeight = sortWeight + 1 where sortWeight <> 0 and sortWeight >= #{current} and sortWeight < #{origin};"+
|
|
"</if>" +
|
|
"<if test='!originHigherCurrent'> " +
|
|
"update teachingRefe set sortWeight = sortWeight - 1 where sortWeight <> 0 and sortWeight > #{origin} and sortWeight <= #{current};\n" +
|
|
"</if>" +
|
|
"update teachingRefe set sortWeight = #{current} where sortWeight = -1;" +
|
|
"</script>")
|
|
void updSort(int origin, int current, boolean originHigherCurrent);
|
|
}
|