fix: CoachMapper query conditions
This commit is contained in:
parent
ba5069a346
commit
95227ecf4e
1 changed files with 5 additions and 5 deletions
|
|
@ -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>",
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue