📄 bo.java
字号:
package com.ksgl.body.member.hzjh;
import java.util.*;
import com.core.web.Paging;
import com.core.persistence.PersistenceManager;
import com.core.persistence.TransactionPM;
import com.core.web.*;
import org.apache.commons.logging.LogFactory;
import org.apache.commons.logging.Log;
import com.core.business.SequenceMng;
import org.apache.commons.beanutils.BeanUtils;
import com.ksgl.map.*;
import com.opensymphony.xwork.ActionContext;
/**
* <p>Title: 文字信息BO类</p>
* <p>Description: </p>
* <p>Copyright: Copyright (c) 2006</p>
* <p>Company: 新闻信息</p>
* @author hj
* @version 1.0
*/
public class BO {
private static Log log = LogFactory.getLog(BO.class);
PersistenceManager pm = new PersistenceManager();
TransactionPM tm = new TransactionPM();
public BO() {
}
/**
* add
* */
public void add(T_sys_news objmap) {
try {
objmap.setId(new SequenceMng().getSequence("t_sys_news", "信息"));
objmap.setHj("0");
// new com.core.log.RecLog().add(((com.ksgl.map.T_sys_gly)ActionContext.getContext().get("user")).getBm(),"信息增加操作,id:"+objmap.getId());
pm.saveObj(objmap);
}
catch (Exception ex) {
log.error("添加add T_sys_news出错!");
ex.printStackTrace();
}
}
/**
* 查询全部省内科技信息
*/
public List queryList(Paging paging, Condition condition, UserInfo user) {
List ret = null;
String hql = " from T_sys_news where 1=1 and mkid in (60,61,62,63) and username='"+user.getStrUserName()+"' ";
if (!condition.getCondition().equals("")) {
hql += " " + condition.getCondition();
}
hql = hql + " order by mkid,updatetime DESC";
try {
ret = pm.queryPageObjs(hql, paging);
}
catch (Exception e) {
log.error("查询queryLbList T_sys_news出错!");
e.printStackTrace();
}
return ret;
}
/**
* no turn page query
*/
public List queryList(Condition condition) {
List ret = null;
String hql = " from T_sys_news where 1=1 and mkid=0 and mkid in (5,6,7,8,9,10)";
if (!condition.getCondition().equals("")) {
hql += " " + condition.getCondition();
}
hql = hql + " order by mkid,updatetime DESC";
try {
ret = pm.queryObjs(hql);
}
catch (Exception e) {
log.error("查询queryList T_sys_news出错!");
e.printStackTrace();
}
return ret;
}
/**
* query one
* */
public T_sys_news queryList1(String id) {
List ret = null;
T_sys_news T_sys_news = new T_sys_news();
String hql = " from T_sys_news where id='" + id + "'";
try {
ret = pm.queryObjs(hql);
T_sys_news = (T_sys_news) ret.get(0);
}
catch (Exception e) {
log.error("查询id = " + id + " queryList1 T_sys_news出错!");
e.printStackTrace();
}
return T_sys_news;
}
/**
* update one
* */
public void update(T_sys_news objmap) {
try {
// new com.core.log.RecLog().add(((com.ksgl.map.T_sys_gly)ActionContext.getContext().getSession().get("user")).getBm(),"信息修改操作,id:"+objmap.getId());
pm.updateObj(objmap);
}
catch (Exception ex) {
log.error("修改update T_sys_news出错!");
ex.printStackTrace();
}
}
/**
* delete more one
* */
public void delete() {
try {
String names[] = (String[]) ActionContext.getContext().getParameters().
get("id");
for (int i = 0; i < names.length; i++) {
//new com.core.log.RecLog().add(((com.ksgl.map.T_sys_gly)ActionContext.getContext().getSession().get("user")).getBm(),"信息删除操作,id:"+names[i]);
pm.deleteObjs(pm.queryObjs(" from T_sys_news where id='" + names[i] +
"'"));
}
}
catch (Exception ex) {
log.error("删除delete 会员信息 T_sys_news出错!");
ex.printStackTrace();
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -