示例#1
0
  /** 修改 */
  @Override
  protected void onModify() throws BusinessException {
    // TODO Auto-generated method stub
    // 检查重名
    Map<String, Object> params = new HashMap<String, Object>();
    params.put("schoolName", this.getSchoolName());
    params.put("areaAbb", this.getDaoAbb());
    List<XjSchoolInfo> xjSchool =
        (List<XjSchoolInfo>) MethodAdapter.invoker(this, "qeuryXjSchools", params);
    if (xjSchool != null && xjSchool.size() > 0) throw new BusinessException("此地区已经存在同名学校,不可增加");
    XjSchoolEntry xjSchoolEntry = new XjSchoolEntry();

    xjSchoolEntry.setId(this.getId());
    xjSchoolEntry.setTownId(this.getTownId());
    xjSchoolEntry.setSchoolName(this.getSchoolName());
    xjSchoolEntry.setSchoolType(this.getSchoolType());
    xjSchoolEntry.setEstablishDate(this.getEstablishDate());
    xjSchoolEntry.setSchoolMode(this.getSchoolMode());
    xjSchoolEntry.setAddress(this.getAddress());
    xjSchoolEntry.setSchoolClass(this.getSchoolClass());
    xjSchoolEntry.setSchoolBank(this.getSchoolBank());
    xjSchoolEntry.setSchoolAddr(this.getSchoolAddr());
    xjSchoolEntry.setPostCode(this.getPostCode());
    xjSchoolEntry.setPhone(this.getPhone());
    xjSchoolEntry.setWebsite(this.getWebsite());
    xjSchoolEntry.setEmail(this.getEmail());
    xjSchoolEntry.setSchoolMaster(this.getSchoolMaster());
    xjSchoolEntry.setMobie(this.getMobie());
    xjSchoolEntry.setLearnyear(this.getLearnyear());
    xjSchoolEntry.setAreaId(this.getAreaId());
    xjSchoolEntry.setSection(this.getSection());
    xjSchoolEntry.setCreateTime(this.getCreateTime());
    xjSchoolEntry.setAdcEcCode(this.getAdcEcCode());
    xjSchoolEntry.setSchCode(this.getSchCode());
    xjSchoolEntry.setShortName(this.getShortName());
    xjSchoolEntry.setIsLong(this.getIsLong());
    XjSchoolMapper xjSchoolMapper =
        SpringUtil.getSpringBean(XjSchoolMapper.class, "xjSchoolMapper");
    xjSchoolMapper.updateXjSchool(xjSchoolEntry);
    xjSchoolEntry = null;
  }
示例#2
0
 /**
  * 根据主键(id)返回单条记录
  *
  * @param id
  * @return XjSchoolInfo
  */
 public XjSchoolInfo findOne(long id) throws BusinessException {
   XjSchoolMapper xjSchoolMapper =
       SpringUtil.getSpringBean(XjSchoolMapper.class, "xjSchoolMapper");
   XjSchoolEntry entry = xjSchoolMapper.findOne(this.getDaoAbb(), id);
   if (entry != null) {
     this.setId(entry.getId());
     this.setTownId(entry.getTownId());
     this.setSchoolName(entry.getSchoolName());
     this.setSchoolType(entry.getSchoolType());
     this.setEstablishDate(entry.getEstablishDate());
     this.setSchoolMode(entry.getSchoolMode());
     this.setAddress(entry.getAddress());
     this.setSchoolClass(entry.getSchoolClass());
     this.setSchoolBank(entry.getSchoolBank());
     this.setSchoolAddr(entry.getSchoolAddr());
     this.setPostCode(entry.getPostCode());
     this.setPhone(entry.getPhone());
     this.setWebsite(entry.getWebsite());
     this.setEmail(entry.getEmail());
     this.setSchoolMaster(entry.getSchoolMaster());
     this.setMobie(entry.getMobie());
     this.setLearnyear(entry.getLearnyear());
     this.setAreaId(entry.getAreaId());
     this.setSection(entry.getSection());
     this.setCreateTime(entry.getCreateTime());
     this.setAdcEcCode(entry.getAdcEcCode());
     this.setSchCode(entry.getSchCode());
     this.setShortName(entry.getShortName());
     this.setIsLong(entry.getIsLong());
     this.setSiId(entry.getSiId());
     this.setSiName(entry.getSiName());
     this.setTownName(entry.getTownName());
     this.setAreaName(entry.getAreaName());
     this.setAreaCode(entry.getAreaCode());
     this.setAreaAbb(entry.getAreaAbb());
     entry = null;
   } else {
     this.xjSchoolEntry = new XjSchoolEntry();
   }
   return this;
 }