⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 jhmylistpage.java

📁 用JSP JAVA 做的 系统 只是初来扎到还望西黄!别乱来哦!
💻 JAVA
字号:
package com.chis.model.etjz;

import java.util.List;

import com.stframe.dao.DaoUtil;
import com.stframe.dao.PageUtil;
import com.stframe.form.ActionForm;
import com.stframe.form.DataForm;
import com.stframe.servlet.ActionInstance;
/**
 * 儿童计划免疫列表分页
 * @author zxh
 *
 */
public class JhmyListPage extends ActionInstance{

	@Override
	public int execute(ActionForm af) throws Exception {
		String corp_code =af.getHttpSession().getAttribute("CORP_CODE").toString();
		String YMMC = af.getHttpRequest().getParameter("YMMC");
		String SL = af.getHttpRequest().getParameter("SL");
		String SL2 = af.getHttpRequest().getParameter("SL2");
		String YL = af.getHttpRequest().getParameter("YL");
		String YL2 = af.getHttpRequest().getParameter("YL2");
		String MYLX = af.getHttpRequest().getParameter("MYLX");
		String ZC = af.getHttpRequest().getParameter("ZC");
		int currentpage = 0;
		int pagesize = 15;
		
		StringBuffer sbsql = new StringBuffer();
		StringBuffer sbpath = new StringBuffer();
		
		//拼凑SQL语句和PATH路径
		sbsql.append("SELECT * FROM MY_JHMY  WHERE 1=1 \n");
		if (!(YMMC == null) && !YMMC.equals("")) {
			sbsql.append(" and MYZPMC like '%" + YMMC + "%' \n");
		}
		if (SL != null && !SL.equals("")) {
			sbsql.append(" and SL >= " + SL + " \n");
		}
		if (SL2 != null && !SL2.equals("")) {
			sbsql.append(" and SL <= " + SL2 + " \n");
		}
		if (YL != null && !YL.equals("")) {
			sbsql.append(" and YL >= " + YL + " \n");
		}
		if (YL2 != null && !YL2.equals("")) {
			sbsql.append(" and YL <= " + YL2 + " \n");
		}
		if (MYLX != null && !MYLX.equals("")) {
			sbsql.append(" and MYLX like '%" + MYLX + "%' \n");
		}
		if (ZC != null && !ZC.equals("")) {
			sbsql.append(" and ZC like '%" + ZC + "%' \n");
		}
		sbsql.append(" and CORP_CODE='"+corp_code+"' \n");
		sbsql.append("  order by MYZPDM,CREATE_DATE asc \n");
		
		sbpath.append(af.getHttpRequest().getContextPath()+"/Selevet.do?action=Selevet.do?action=JHMY_LIST_PAGE");

		try {
			currentpage = Integer.parseInt(af.getHttpRequest().getParameter("currentpage"));
		} catch (Exception e) {
			currentpage = 1;
		}
		
//		PageUtil pageUtil = (PageUtil)DaoUtil.selectPage(af.getConnection(),sbsql.toString(),currentpage, pagesize);
//		pageUtil.setPath(sbpath.toString());
//		List list= pageUtil.getContext();
		
		
		DataForm df=new DataForm("MY_JHMY","ID");
		List etmy_list=DaoUtil.select(af.getConnection(),sbsql.toString(), df);
		
		af.getHttpRequest().setAttribute("YMMC", YMMC);
		af.getHttpRequest().setAttribute("SL", SL);
		af.getHttpRequest().setAttribute("YL", YL);
		af.getHttpRequest().setAttribute("SL2", SL2);
		af.getHttpRequest().setAttribute("YL2", YL2);
		af.getHttpRequest().setAttribute("MYLX", MYLX);
		af.getHttpRequest().setAttribute("ZC", ZC);
		af.getHttpRequest().setAttribute("etmy_list",etmy_list);
//		af.getHttpRequest().setAttribute("num", pageUtil.getContext().size());
//		af.getHttpRequest().setAttribute("pagebar", pageUtil.pageBar());
		return 1;
	}

}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -