src/servlet/ReagentSearchServlet.java

(开头部分) 6KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

package servlet;

import java.io.IOException;
import java.io.PrintWriter;
import java.util.ArrayList;

import javax.servlet.RequestDispatcher;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import util.Validate;
import bean.SelectBean;

public class ReagentSearchServlet extends HttpServlet {

	/**
	 * Constructor of the object.
	 */
	public ReagentSearchServlet() {
		super();
	}

	/**
	 * Destruction of the servlet. <br>
	 */
	public void destroy() {
		super.destroy(); // Just puts "destroy" string in log
		// Put your code here
	}

	public void doGet(HttpServletRequest request, HttpServletResponse response)
			throws ServletException, IOException {
		Validate vd = new Validate();
		String flag = vd.getUnicode(request.getParameter("flag"));
		String begintime = vd.getUnicode(request.getParameter("begintime"));
		String endtime = vd.getUnicode(request.getParameter("endtime"));
		String smalltype = vd.getUnicode(request.getParameter("smalltype"));
		SelectBean sb = new SelectBean();
		
		if(flag != null && flag.equals("1")){
			String sql = "select a.id as aid,reagent,sums,times,b.* from readdstorage a,reagent b where a.reagent=b.id and datediff(day,'"+begintime+"',times)>0 and datediff(day,'"+endtime+"',times)<0";
			String[] args = {"aid","reagent","sums","times","id","name","property","spec","yieldly","storage","price","validity","smalltype"};
			ArrayList al = sb.select(sql, args);
			request.setAttribute("leaddstoragetime", al);
			String sql1 = "select b.name,sum(cast(sums as int)) as sums from readdstorage a,reagent b where a.reagent=b.id and datediff(day,'"+begintime+"',times)>0 and datediff(day,'"+endtime+"',times)<0 group by b.name";
			String[] args1 = {"name","sums"};
			ArrayList al1 = sb.select(sql1, args1);
			request.setAttribute("statistic", al1);
		}
		if(flag != null && flag.equals("2")){
			String sql = "select a.id as aid,reagent,sums,times,b.* from rereducestorage a,reagent b where a.reagent=b.id and datediff(day,'"+begintime+"',times)>0 and datediff(day,'"+endtime+"',times)<0";
			String[] args = {"aid","reagent","sums","times","id","name","property","spec","yieldly","storage","price","validity","smalltype"};
			ArrayList al = sb.select(sql, args);
			request.setAttribute("lereducestoragetime", al);
			String sql1 = "select b.name,sum(cast(sums as int)) as sums from rereducestorage a,reagent b where a.reagent=b.id and datediff(day,'"+begintime+"',times)>0 and datediff(day,'"+endtime+"',times)<0 group by b.name";
			String[] args1 = {"name","sums"};
			ArrayList al1 = sb.select(sql1, args1);
			request.setAttribute("statistic", al1);
后面还有 61 行代码,购买后查看完整代码

24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明

AI 解读 AI

登录后可用,每次 10 算力,解读结果公开显示在下面。

还没有人解读过这个文件。