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
|
||||
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>",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue