主业务添加代码
This commit is contained in:
parent
6d6ac60646
commit
18fd896df4
@ -0,0 +1,51 @@
|
||||
package com.czlis.common.core.domain.entity.lis;
|
||||
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.util.Date;
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class LabPatlog {
|
||||
|
||||
private String wyh;
|
||||
private Date jyrq;
|
||||
private String yq;
|
||||
private String ybh;
|
||||
private Date xgrq;
|
||||
private String xgyhdh;
|
||||
private String yblx;
|
||||
private String fb;
|
||||
private String ksdh;
|
||||
private String sjys;
|
||||
private String hdys;
|
||||
private String yhdh;
|
||||
private String brdh;
|
||||
private String brxm;
|
||||
private String brxb;
|
||||
private String brly;
|
||||
private String ch;
|
||||
private Integer nl;
|
||||
private String nldw;
|
||||
private String sqh;
|
||||
private Date sqsj;
|
||||
private Date dysj;
|
||||
private String dybz;
|
||||
private String jgbz;
|
||||
private String bbbz;
|
||||
private String zd;
|
||||
private String bz;
|
||||
private String bz1;
|
||||
private String zjf;
|
||||
private Date cyrq;
|
||||
private String bq;
|
||||
private String czybh;
|
||||
private Integer shcs;
|
||||
private String ip;
|
||||
private String sendFlag;
|
||||
|
||||
|
||||
}
|
||||
@ -0,0 +1,31 @@
|
||||
package com.czlis.common.core.domain.entity.lis;
|
||||
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.util.Date;
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class LabResultlog {
|
||||
|
||||
private String wyh;
|
||||
private Date jyrq;
|
||||
private String yq;
|
||||
private String ybh;
|
||||
private String xmdh;
|
||||
private String csjg;
|
||||
private String od;
|
||||
private String cutoff;
|
||||
private String jgbz;
|
||||
private String bz1;
|
||||
private String bz2;
|
||||
private String yhdh;
|
||||
private Date xgrq;
|
||||
private String xgyhdh;
|
||||
|
||||
|
||||
|
||||
}
|
||||
@ -0,0 +1,9 @@
|
||||
package com.czlis.interfaceCommon.mapper;
|
||||
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
public interface LabPatlogMapper {
|
||||
int insertLabPatlog(@Param("jyrq") Date jyrq, @Param("yq")String yq, @Param("ybh") String ybh,@Param("xgrq")Date xgrq,@Param("xgyhdh")String xgyhdh,@Param("ip")String ip);
|
||||
}
|
||||
@ -9,4 +9,6 @@ import java.util.List;
|
||||
public interface LabReqsteplogMapper {
|
||||
LabReqsteplog getLabReqsteplogOne(@Param("sqh") String sqh,@Param("xh") Integer xh);
|
||||
List<LabReqsteplog> getLabReqsteplog(String sqh);
|
||||
Integer insertLabReqsteplog(LabReqsteplog labReqsteplog);
|
||||
Integer getLabReqsteplogMax(@Param("sqh") String sqh);
|
||||
}
|
||||
|
||||
@ -0,0 +1,10 @@
|
||||
package com.czlis.interfaceCommon.mapper;
|
||||
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
public interface LabResultlogMapper {
|
||||
int insertLabResultlog(@Param("jyrq") Date jyrq, @Param("yq")String yq, @Param("ybh") String ybh, @Param("xgrq")Date xgrq, @Param("xgyhdh")String xgyhdh, @Param("ip")String ip);
|
||||
|
||||
}
|
||||
@ -3,8 +3,10 @@ package com.czlis.interfaceCommon.utils;
|
||||
import com.czlis.common.utils.DateUtils;
|
||||
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.lang.reflect.Field;
|
||||
import java.math.BigDecimal;
|
||||
import java.math.RoundingMode;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.time.Duration;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.ZoneId;
|
||||
@ -271,4 +273,58 @@ public class LisUtil {
|
||||
public static long relativeMinute(Date pastDate) {
|
||||
return relativeMinute(pastDate,new Date());
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 获取实体类中指定字段的属性和值
|
||||
* @param obj 实体类对象
|
||||
* @param fieldName 要查询的字段名
|
||||
* @return 字段信息字符串
|
||||
*/
|
||||
public static String getFieldValue(Object obj, String fieldName) {
|
||||
if (obj == null || fieldName == null || fieldName.isEmpty()) {
|
||||
return "参数不能为空";
|
||||
}
|
||||
Class<?> clazz = obj.getClass();
|
||||
try {
|
||||
// 获取指定字段(包括私有字段)
|
||||
Field field = clazz.getDeclaredField(fieldName);
|
||||
// 设置访问权限(私有字段需要开启)
|
||||
field.setAccessible(true);
|
||||
// 1. 获取字段属性信息
|
||||
String fieldType = field.getType().getSimpleName(); // 字段类型(如String、Integer)
|
||||
// 2. 获取字段值
|
||||
Object fieldValue = field.get(obj); // 获取字段值
|
||||
String valueStr;
|
||||
// 处理特殊类型(如Date格式化)
|
||||
if (fieldValue instanceof Date) {
|
||||
valueStr = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format((Date) fieldValue);
|
||||
} else {
|
||||
valueStr = (fieldValue != null) ? fieldValue.toString() : "null";
|
||||
}
|
||||
return valueStr;
|
||||
} catch (NoSuchFieldException e) {
|
||||
return "字段不存在:" + fieldName;
|
||||
} catch (IllegalAccessException e) {
|
||||
return "无法访问字段:" + fieldName + ",原因:" + e.getMessage();
|
||||
}
|
||||
}
|
||||
public static String getFieldType(Object obj, String fieldName) {
|
||||
if (obj == null || fieldName == null || fieldName.isEmpty()) {
|
||||
return "参数不能为空";
|
||||
}
|
||||
Class<?> clazz = obj.getClass();
|
||||
try {
|
||||
// 获取指定字段(包括私有字段)
|
||||
Field field = clazz.getDeclaredField(fieldName);
|
||||
// 设置访问权限(私有字段需要开启)
|
||||
field.setAccessible(true);
|
||||
// 1. 获取字段属性信息
|
||||
return field.getType().getSimpleName(); // 字段类型(如String、Integer)
|
||||
} catch (NoSuchFieldException e) {
|
||||
return "字段不存在:" + fieldName;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -0,0 +1,19 @@
|
||||
<?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.czlis.interfaceCommon.mapper.LabPatlogMapper">
|
||||
<select id="getLabPatlog">
|
||||
select * from lab_patlog where jyrq = #{jyrq} and yq = #{yq} and ybh = #{ybh}
|
||||
</select>
|
||||
<insert id="insertLabPatlog">
|
||||
INSERT INTO lab_patlog ( wyh, jyrq, yq, ybh, xgrq, xgyhdh, yblx, fb, ksdh,
|
||||
sjys, hdys, yhdh, brdh, brxm, brxb, brly, ch, nl,
|
||||
nldw, sqh, sqsj, dysj, dybz, jgbz, bbbz, zd, bz,
|
||||
bz1, zjf, cyrq, bq, czybh,ip)
|
||||
SELECT wyh, jyrq, yq, ybh, #{xgrq}, #{xgyhdh}, yblx, fb, ksdh,
|
||||
sjys, hdys, yhdh, brdh, brxm, brxb, brly, ch, nl,
|
||||
nldw, sqh, sqsj, dysj, dybz, jgbz, bbbz, zd, bz,
|
||||
bz1, zjf, cyrq, bq, czybh,#{ip}
|
||||
FROM lab_pat WHERE jyrq = #{jyrq} and yq = #{yq} and ybh = #{ybh}
|
||||
</insert>
|
||||
</mapper>
|
||||
@ -8,7 +8,17 @@
|
||||
<select id="getLabReqsteplog" resultType="com.czlis.common.core.domain.entity.lis.LabReqsteplog">
|
||||
select * from lab_reqsteplog where sqh = #{sqh}
|
||||
</select>
|
||||
|
||||
<select id="getLabReqsteplogMax" resultType="Integer">
|
||||
select xh from lab_reqsteplog where sqh = #{sqh}
|
||||
</select>
|
||||
<insert id="insertLabReqsteplog" parameterType="com.czlis.common.core.domain.entity.lis.LabReqsteplog">
|
||||
insert into lab_reqsteplog (sqh, xh, zt, userid,
|
||||
changedate, logdate, comname,
|
||||
comip, bz)
|
||||
values (#{sqh}, #{xh}, #{zt}, #{userid},
|
||||
#{changedate}, #{logdate}, #{comname},
|
||||
#{comip}, #{bz})
|
||||
</insert>
|
||||
|
||||
|
||||
|
||||
|
||||
@ -0,0 +1,12 @@
|
||||
<?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.czlis.interfaceCommon.mapper.LabResultlogMapper">
|
||||
<insert id="insertLabResultlog">
|
||||
INSERT INTO lab_resultlog ( wyh, jyrq, yq, ybh, xmdh, csjg, od,
|
||||
cutoff, jgbz, bz1, bz2, yhdh, xgrq, xgyhdh )
|
||||
SELECT wyh, jyrq, yq, ybh, xmdh, csjg, od,
|
||||
cutoff, jgbz, bz1, bz2, yhdh, #{xgrq}, #{xgyhdh}
|
||||
From lab_result WHERE jyrq = #{jyrq} and yq = #{yq} and ybh = #{ybh}
|
||||
</insert>
|
||||
</mapper>
|
||||
Loading…
x
Reference in New Issue
Block a user