whh
4 months ago
10 changed files with 114 additions and 9 deletions
@ -0,0 +1,14 @@ |
|||||
|
package com.haihang.entity; |
||||
|
|
||||
|
|
||||
|
import lombok.Data; |
||||
|
|
||||
|
import java.io.Serializable; |
||||
|
|
||||
|
//用例分页查询DTO
|
||||
|
@Data |
||||
|
public class CasePageQueryDTO implements Serializable { |
||||
|
private String caseName; |
||||
|
private int page;//当前页码
|
||||
|
private int pageSize;//每页有多大?
|
||||
|
} |
@ -0,0 +1,21 @@ |
|||||
|
package com.haihang.entity; |
||||
|
|
||||
|
|
||||
|
import lombok.AllArgsConstructor; |
||||
|
import lombok.Data; |
||||
|
import lombok.NoArgsConstructor; |
||||
|
|
||||
|
import java.util.List; |
||||
|
|
||||
|
//分页结果
|
||||
|
@Data |
||||
|
@NoArgsConstructor |
||||
|
public class PageResult { |
||||
|
private int total; |
||||
|
private List records; |
||||
|
|
||||
|
public PageResult(int total, List records) { |
||||
|
this.total = total; |
||||
|
this.records = records; |
||||
|
} |
||||
|
} |
@ -0,0 +1,17 @@ |
|||||
|
<?xml version="1.0" encoding="UTF-8"?> |
||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
||||
|
<mapper namespace="com.haihang.mapper.CaseMapper"> |
||||
|
|
||||
|
<select id="pageQuery" resultType="com.haihang.entity.Case"> |
||||
|
select * from case_table |
||||
|
<where> |
||||
|
<if test="caseName!= '' and caseName != null"> |
||||
|
and case_name like concat('%',#{caseName},'%') |
||||
|
</if> |
||||
|
</where> |
||||
|
|
||||
|
</select> |
||||
|
|
||||
|
|
||||
|
|
||||
|
</mapper> |
Loading…
Reference in new issue