Commit 5422ecd5 authored by wujipeng's avatar wujipeng
Browse files

元数据自定义查询

parent 264a621a
package com.ruzhoukj.integration.constant;
import lombok.Getter;
/**
* @author : wujipeng
* @date : 2026/3/4 10:17
* @Version: 1.0
* @Desc : 描述信息
*/
@Getter
public enum TimeOffset {
THE_SAME_PERIOD_LAST_YEAR("去年同期"),
THE_FIRST_HALF_OF_THIS_YEAR("本年上期");
private final String name;
TimeOffset(String name) {
this.name = name;
}
}
...@@ -3,9 +3,12 @@ package com.ruzhoukj.integration.pojo.entity; ...@@ -3,9 +3,12 @@ package com.ruzhoukj.integration.pojo.entity;
import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
import java.util.Date;
/** /**
* @author : wujipeng * @author : wujipeng
* @date : 2026/2/27 14:15 * @date : 2026/2/27 14:15
...@@ -39,4 +42,14 @@ public class MetaDataEntity { ...@@ -39,4 +42,14 @@ public class MetaDataEntity {
@ApiModelProperty(value = "版本") @ApiModelProperty(value = "版本")
private String version; private String version;
@ApiModelProperty(value = "所属厂")
private String factory;
@ApiModelProperty(value = "数据时间")
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
private Date date;
@ApiModelProperty(value = "所属部门")
private String dept;
} }
package com.ruzhoukj.integration.result; package com.ruzhoukj.integration.result;
import lombok.Getter;
/** /**
* 响应状态码枚举 * 响应状态码枚举
*/ */
@Getter
public enum ResultCode { public enum ResultCode {
SUCCESS(200, "操作成功"), SUCCESS(200, "操作成功"),
FAILED(500, "操作失败"), FAILED(500, "操作失败"),
VALIDATE_FAILED(400, "参数检验失败"), VALIDATE_FAILED(400, "参数检验失败"),
...@@ -16,20 +19,12 @@ public enum ResultCode { ...@@ -16,20 +19,12 @@ public enum ResultCode {
UNSUPPORTED_MEDIA_TYPE(415, "不支持的媒体类型"), UNSUPPORTED_MEDIA_TYPE(415, "不支持的媒体类型"),
INTERNAL_SERVER_ERROR(500, "服务器内部错误"), INTERNAL_SERVER_ERROR(500, "服务器内部错误"),
SERVICE_UNAVAILABLE(503, "服务不可用"); SERVICE_UNAVAILABLE(503, "服务不可用");
private Integer code; private final Integer code;
private String message; private final String message;
ResultCode(Integer code, String message) { ResultCode(Integer code, String message) {
this.code = code; this.code = code;
this.message = message; this.message = message;
} }
public Integer getCode() {
return code;
}
public String getMessage() {
return message;
}
} }
\ No newline at end of file
...@@ -64,17 +64,33 @@ ...@@ -64,17 +64,33 @@
hidden = 0 hidden = 0
</select> </select>
<select id="getPageData" resultType="com.ruzhoukj.integration.pojo.vo.MetaDataVO"> <select id="getPageData" resultType="com.ruzhoukj.integration.pojo.vo.MetaDataVO">
select id, select
name, id,
value, name,
reunite, value,
formula, reunite,
attribute, formula,
hidden, attribute,
version hidden,
version,
factory,
date,
dept
from from
meta_data meta_data
where where
hidden = 0 hidden = 0
<if test="name != null and name != ''">
and name like concat('%', #{name}, '%')
</if>
<if test="factory != null and factory != ''">
and factory like concat('%', #{factory}, '%')
</if>
<if test="date != null">
and date = #{date}
</if>
<if test="dept != null and dept != ''">
and dept like concat('%', #{dept}, '%')
</if>
</select> </select>
</mapper> </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