41 lines
1.2 KiB
Plaintext
41 lines
1.2 KiB
Plaintext
|
|
package com.nationalelectric.greenH5.service;
|
||
|
|
|
||
|
|
import java.io.Serializable;
|
||
|
|
import java.util.List;
|
||
|
|
import java.util.Map;
|
||
|
|
|
||
|
|
|
||
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
||
|
|
import org.springframework.jdbc.core.BeanPropertyRowMapper;
|
||
|
|
import org.springframework.stereotype.Service;
|
||
|
|
|
||
|
|
import com.nationalelectric.greenH5.po.GreenInfoGrather;
|
||
|
|
import com.nationalelectric.greenH5.po.GreenInternalUser;
|
||
|
|
import com.sgcc.uap.persistence.IHibernateDao;
|
||
|
|
|
||
|
|
@Service
|
||
|
|
public class InfoGratherService {
|
||
|
|
|
||
|
|
@Autowired
|
||
|
|
private IHibernateDao hibernateDao;
|
||
|
|
|
||
|
|
public Serializable insertInfoGrathe(GreenInfoGrather greenInfoGrather) {
|
||
|
|
Serializable object = hibernateDao.saveObject(greenInfoGrather);
|
||
|
|
return object;
|
||
|
|
}
|
||
|
|
|
||
|
|
public GreenInfoGrather getOne(String name, String phone) {
|
||
|
|
String sql = "select * from green_info_grather where name = ? and phone = ? ";
|
||
|
|
List<GreenInfoGrather> list = hibernateDao.queryForListWithSql(sql, new Object[]{name, phone},new BeanPropertyRowMapper<GreenInfoGrather>(GreenInfoGrather.class));
|
||
|
|
if (list.size() > 0) {
|
||
|
|
return list.get(0);
|
||
|
|
}
|
||
|
|
return null;
|
||
|
|
}
|
||
|
|
|
||
|
|
public void update(GreenInfoGrather greenInfoGrather) {
|
||
|
|
hibernateDao.updateObject(greenInfoGrather, greenInfoGrather.getId());
|
||
|
|
}
|
||
|
|
|
||
|
|
}
|