dao
package gos.hzyg.hdgos.dao.secu;
import java.util.List;
/**
* @author renxh
* 针对平房完损等级评定做的接口
*/
public interface AroomLevelDao {
/**
* 方法 getAllaRoomLevel()
* 查询所有的相关信息
* @param cAreaid
*
*/
List getAllaRoomLevel();
}
接口实现
/**
* 作者:任喜海2007-4-27
*/
package gos.hzyg.hdgos.dao.imp.secu;
import java.util.List;
import gos.hzyg.hdgos.dao.secu.AroomLevelDao;
import org.hibernate.Query;
import org.hibernate.Session;
import org.springframework.orm.hibernate3.support.HibernateDaoSupport;
/**
* @author renxh
*
*/
public class AroomLevelDaoImp extends HibernateDaoSupport implements
AroomLevelDao {
public List getAllaRoomLevel() {
// TODO 自动生成方法存根
Session session = this.getSession();
Query query = null;
String hql = "from AroomLevel where 1=1";
query = session.createQuery(hql);
List info = query.list();
return info;
}
}
对应的controller
/**
* 作者:任喜海2007-4-28
*/
package gos.hzyg.hdgos.action.secu;
import java.util.List;
import gos.hzyg.hdgos.dao.secu.AroomLevelDao;
import gos.hzyg.hdgos.dao.secu.ChutDao;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import org.springframework.web.servlet.ModelAndView;
import org.springframework.web.servlet.mvc.Controller;
/**
* @author renxh
*
*/
public class AroomLeveListController implements Controller{
private String listview;
private AroomLevelDao arDao;
public AroomLevelDao getArDao() {
return arDao;
}
public void setArDao(AroomLevelDao arDao) {
this.arDao = arDao;
}
public String getListview() {
return listview;
}
public void setListview(String listview) {
this.listview = listview;
}
public ModelAndView handleRequest(HttpServletRequest request, HttpServletResponse response) throws Exception {
// TODO 自动生成方法存根
System.out.println("@@@@@aRoomLevel@@@@@@@");
List chinfo = arDao.getAllaRoomLevel();//取得所有平房信息
HttpSession s=request.getSession();
s.setAttribute("chinfo", chinfo);
System.out.println("@@@@@III@@@@@@@");
return new ModelAndView(this.getListview());
}
}
re: 数据库更新语句 源自有缘 2007-04-24 16:15
删除语句
delete from downwater1 where address!='志新小区'
delete from downwater2 where address!='志新小区'
delete from upwater1 where address!='志新小区'
delete from upwater2 where address!='志新小区'
re: 数据库更新语句 源自有缘 2007-04-24 16:09
修改属性列
alter table block alter column otherdept varchar(200);
alter table t_politic1 add column content varchar(500);