Commit 77bc284a authored by wdy's avatar wdy

标准库分页查询

parent 0fb39a1c
...@@ -9,6 +9,8 @@ import io.swagger.annotations.ApiModelProperty; ...@@ -9,6 +9,8 @@ import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
import lombok.experimental.Accessors; import lombok.experimental.Accessors;
import java.util.Date;
/** /**
* 标准 * 标准
* @TableName t_standard * @TableName t_standard
...@@ -45,4 +47,16 @@ public class Standard { ...@@ -45,4 +47,16 @@ public class Standard {
@ApiModelProperty("文件路径") @ApiModelProperty("文件路径")
private String file; private String file;
@ApiModelProperty("标准分类")
private String standardType;
@ApiModelProperty("标准状态")
private String standardStatus;
@ApiModelProperty("发布日期")
private Date releaseDate;
@ApiModelProperty("实施日期")
private Date implementationDate;
} }
...@@ -12,7 +12,7 @@ import java.util.List; ...@@ -12,7 +12,7 @@ import java.util.List;
public interface StandardMapper extends BaseMapper<Standard> { public interface StandardMapper extends BaseMapper<Standard> {
// 分页查询 // 分页查询
List<Standard> findList(@Param("params") StandardListRequest request); List<Standard> findList();
// 根据id查询 // 根据id查询
Standard findListById(@Param("id") Long Id); Standard findListById(@Param("id") Long Id);
......
...@@ -12,7 +12,7 @@ import java.util.List; ...@@ -12,7 +12,7 @@ import java.util.List;
public interface StandardService extends IService<Standard> { public interface StandardService extends IService<Standard> {
// 分页查询 // 分页查询
List<Standard> findList(StandardListRequest request); List<Standard> findList();
//根据id查询 //根据id查询
Standard findListById(Long id); Standard findListById(Long id);
......
...@@ -18,12 +18,12 @@ public class StandardServiceImpl extends ServiceImpl<StandardMapper, Standard> i ...@@ -18,12 +18,12 @@ public class StandardServiceImpl extends ServiceImpl<StandardMapper, Standard> i
/** /**
* 分页查询 * 分页查询
* @param request * @param
* @return * @return
*/ */
@Override @Override
public List<Standard> findList(StandardListRequest request) { public List<Standard> findList() {
return standardMapper.findList(request); return standardMapper.findList();
} }
/** /**
......
...@@ -31,12 +31,12 @@ public class StandardController extends BaseController { ...@@ -31,12 +31,12 @@ public class StandardController extends BaseController {
* 分页查询 * 分页查询
* @return * @return
*/ */
@ApiOperation("标准分页查询") @ApiOperation("标准分页查询")
@Trace @Trace
@Tags({@Tag(key = "param", value = "arg[0]"), @Tag(key = "result", value = "returnedObj")}) @Tags({@Tag(key = "param", value = "arg[0]"), @Tag(key = "result", value = "returnedObj")})
@RequestMapping(method = RequestMethod.POST, value = "/findStandardList") @RequestMapping(method = RequestMethod.POST, value = "/findStandardList")
public TableDataInfo<Standard> findList(@Validated @RequestBody StandardListRequest request) { public TableDataInfo<Standard> findList(@Validated @RequestBody StandardListRequest request) {
startPage(request); startPage(request);
return getDataTable(standardService.findList(request)); return getDataTable(standardService.findList());
} }
} }
...@@ -8,16 +8,4 @@ import lombok.Data; ...@@ -8,16 +8,4 @@ import lombok.Data;
@ApiModel(value = "StandardListRequest", description = "查询标准") @ApiModel(value = "StandardListRequest", description = "查询标准")
@Data @Data
public class StandardListRequest extends PageDomain { public class StandardListRequest extends PageDomain {
/**
* 标准名称
*/
@ApiModelProperty("标准名称")
private String name;
/**
* 标准号
*/
@ApiModelProperty("标准号")
private String standardNo;
} }
...@@ -9,19 +9,15 @@ ...@@ -9,19 +9,15 @@
<result property="name" column="name" jdbcType="VARCHAR"/> <result property="name" column="name" jdbcType="VARCHAR"/>
<result property="standardNo" column="standard_no" jdbcType="VARCHAR"/> <result property="standardNo" column="standard_no" jdbcType="VARCHAR"/>
<result property="file" column="file" jdbcType="VARCHAR"/> <result property="file" column="file" jdbcType="VARCHAR"/>
<result property="standardType" column="standard_type" jdbcType="VARCHAR"/>
<result property="standardStatus" column="standard_status" jdbcType="VARCHAR"/>
<result property="releaseDate" column="release_date" jdbcType="TIMESTAMP"/>
<result property="implementationDate" column="implementation_date" jdbcType="TIMESTAMP"/>
</resultMap> </resultMap>
<select id="findList" parameterType="com.ruoyi.web.request.StandardListRequest" resultMap="BaseResultMap"> <select id="findList" parameterType="com.ruoyi.web.request.StandardListRequest" resultMap="BaseResultMap">
SELECT id, name, standard_no, file SELECT id, name, standard_no, file,standard_type,standard_status,release_date,implementation_date
FROM t_standard FROM t_standard
<where>
<if test="params.name != null and params.name != ''">
and name like concat('%',#{params.name},'%')
</if>
<if test="params.standardNo != null and params.standardNo != ''">
and standard_no = #{params.standardNo}
</if>
</where>
</select> </select>
<select id="findListById" resultMap="BaseResultMap"> <select id="findListById" resultMap="BaseResultMap">
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment