fix: CoachMapper query conditions

This commit is contained in:
Administrator 2026-07-10 14:46:12 +08:00
commit 95227ecf4e

View file

@ -11,16 +11,16 @@ import java.util.List;
@Mapper
public interface CoachMapper {
// 查询全部
@Select(value = "SELECT * FROM coach")
@Select(value = "SELECT * FROM coaches")
List<Coach> selectAll();
@Select(value = {
"<script>",
"SELECT * FROM `coach`",
"SELECT * FROM `coaches`",
"<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=\"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\">",
"<choose>",
"<when test=\"quitDate == 2\"> AND quit_date IS NULL</when>",
"<when test=\"quitDate == 3\"> AND quit_date IS NOT NULL</when>",