Commit fd8ca900 authored by W_Y's avatar W_Y

标准表相关

parent e0759728
package com.ruoyi.domain;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.experimental.Accessors;
/**
* 标准
* @TableName t_standard
*/
@ApiModel(value = "Standard", description = "标准")
@TableName(value ="t_standard", autoResultMap = true)
@Accessors(chain = true)
@Data
public class Standard {
/**
* 主键
*/
@ApiModelProperty("主键")
@TableId(type = IdType.ASSIGN_ID)
private Long id;
/**
* 标准名称
*/
@ApiModelProperty("标准名称")
private String name;
/**
* 标准号
*/
@ApiModelProperty("标准号")
private String standardNo;
/**
* 文件路径
*/
@ApiModelProperty("文件路径")
private String file;
}
package com.ruoyi.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.ruoyi.domain.Standard;
import com.ruoyi.web.request.StandardListRequest;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;
import java.util.List;
@Repository
public interface StandardMapper extends BaseMapper<Standard> {
// 分页查询
List<Standard> findList(@Param("params") StandardListRequest request);
}
package com.ruoyi.web.request;
import com.ruoyi.common.core.page.PageDomain;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@ApiModel(value = "StandardListRequest", description = "查询标准")
@Data
public class StandardListRequest extends PageDomain {
/**
* 标准名称
*/
@ApiModelProperty("标准名称")
private String name;
/**
* 标准号
*/
@ApiModelProperty("标准号")
private String standardNo;
}
<?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.ruoyi.mapper.StandardMapper">
<resultMap id="BaseResultMap" type="com.ruoyi.domain.Standard">
<id property="id" column="id" jdbcType="BIGINT"/>
<result property="name" column="name" jdbcType="VARCHAR"/>
<result property="standardNo" column="standard_no" jdbcType="VARCHAR"/>
<result property="file" column="file" jdbcType="VARCHAR"/>
</resultMap>
<select id="findList" parameterType="com.ruoyi.domain.Standard" resultMap="BaseResultMap">
SELECT id, name, standardNo, file
FROM t_standard
<where>
<if test="name != null and name != ''">
name like concat('%',#{params.name},'%')
</if>
<if test="standardNo != null and standardNo != ''">
standard_no = #{params.standardNo}
</if>
</where>
</select>
</mapper>
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