fix: remove curly braces from column name in quit query
This commit is contained in:
parent
95227ecf4e
commit
431ee1eb35
1 changed files with 10 additions and 4 deletions
|
|
@ -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);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue