fix: remove curly braces from column name in quit query

This commit is contained in:
Administrator 2026-07-10 16:54:07 +08:00
commit 431ee1eb35

View file

@ -3,8 +3,11 @@ package edu.situ.stlserver.dao;
import edu.situ.stlserver.model.entity.Coach;
import edu.situ.stlserver.model.query.CoachQuery;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import java.util.List;
@ -20,14 +23,17 @@ public interface CoachMapper {
"<where>",
"<if test=\"name != null and name != ''\"> AND `name` LIKE CONCAT('%', #{name}, '%')</if>",
"<if test=\"sex != null and sex != 0\"> AND `sex` = #{sex}</if>",
"<if test=\"quitDate != null and quitDate != 1\">",
"<if test=\"status != null and status != 1\">",
"<choose>",
"<when test=\"quitDate == 2\"> AND quit_date IS NULL</when>",
"<when test=\"quitDate == 3\"> AND quit_date IS NOT NULL</when>",
"<when test=\"status == 2\"> AND quit_date IS NULL</when>",
"<when test=\"status == 3\"> AND quit_date IS NOT NULL</when>",
"</choose>",
"</if>",
"</where>",
"</script>"
})
List<Coach> select(Coach coach);
List<Coach> select(CoachQuery coachQuery);
@Update(value = "UPDATE `coaches` SET `quit_date` = #{quitDate} WHERE `id` = #{id}")
void quit(@Param("id") Integer id,@Param("quitDate") String quitDate);
}