首页>代码>JSP+servlet+maven疫情体温登记系统>/HealthSystem/src/main/java/xkng/dao/daoimpl/HealthRegisterImpl.java
package xkng.dao.daoimpl;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import xkng.dao.HealthRegisterDao;
import xkng.entity.TemperatureRegistration;
import xkng.util.JDBCUtil;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;
public class HealthRegisterImpl implements HealthRegisterDao {
@Override
public JSONObject HealthRegisterList() {
String sql = "SELECT * FROM temperature_registration";
JDBCUtil jdbcUtil = new JDBCUtil();
List<Object> mapList = jdbcUtil.excuteQuery(sql, null);
JSONArray jsonArray = JSONArray.parseArray(JSON.toJSONString(mapList));
JSONObject jsonObject = new JSONObject();
jsonObject.put("code","0");
jsonObject.put("msg","成功");
jsonObject.put("count",mapList.size());
jsonObject.put("data",jsonArray);
return jsonObject;
}
@Override
public int HealthRegisterAdd(TemperatureRegistration temperatureRegistration) {
Date date=new Date();
DateFormat simpleDateFormat= new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
String time = simpleDateFormat.format(date);
String sql = "insert into temperature_registration (name,temperature,isnormal,createtime,updatetime" +
",reson,explains) " +
"values " +
"(" +
"'"+temperatureRegistration.getName()+"',"+
"'"+temperatureRegistration.getTemperature()+"',"+
"'"+temperatureRegistration.getIsnormal()+"',"+
"'"+time+"',"+
"'"+time +"',"+
"'"+temperatureRegistration.getReson()+"',"+
"'"+temperatureRegistration.getExplain()+"')";
JDBCUtil jdbcUtil = new JDBCUtil();
return jdbcUtil.executeUpdate(sql,null);
}
}
最近下载更多
weilaizhisheng LV21
2023年10月10日
微信网友_6508798513811456 LV5
2023年6月9日
996171721 LV7
2023年5月31日
1755754535 LV5
2022年12月27日
wwb521 LV7
2022年11月18日
微信网友_6191697646571520 LV6
2022年10月28日
15904867178 LV4
2022年7月12日
zhangjian01 LV7
2022年4月26日
119892537 LV8
2022年4月18日
huaiyuejiu LV9
2022年4月14日
最近浏览更多
Phoebe_HUI LV5
2025年1月14日
梁小贤 LV1
2024年12月6日
hmf1989
2024年8月23日
暂无贡献等级
15719908287 LV10
2024年6月19日
ma406805131 LV19
2024年6月15日
80730176 LV7
2024年3月20日
weilaizhisheng LV21
2023年10月10日
zhumeng168 LV5
2023年7月6日
119892537 LV8
2023年6月14日
微信网友_6508798513811456 LV5
2023年6月9日

