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 @Mapper
public interface CoachMapper { public interface CoachMapper {
// 查询全部 // 查询全部
@Select(value = "SELECT * FROM coach") @Select(value = "SELECT * FROM coaches")
List<Coach> selectAll(); List<Coach> selectAll();
@Select(value = { @Select(value = {
"<script>", "<script>",
"SELECT * FROM `coach`", "SELECT * FROM `coaches`",
"<where>", "<where>",
"<if test=\"name != null AND name != ''\"> AND `name` LIKE CONCAT('%', #{name}, '%')</if>", "<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=\"sex != null and sex != 0\"> AND `sex` = #{sex}</if>",
"<if test=\"quitDate != null AND quitDate != 1\">", "<if test=\"quitDate != null and quitDate != 1\">",
"<choose>", "<choose>",
"<when test=\"quitDate == 2\"> AND quit_date IS NULL</when>", "<when test=\"quitDate == 2\"> AND quit_date IS NULL</when>",
"<when test=\"quitDate == 3\"> AND quit_date IS NOT NULL</when>", "<when test=\"quitDate == 3\"> AND quit_date IS NOT NULL</when>",