Exemplo n.º 1
0
 @Override
 public void edit(JbAssets jbAssets) {
   TjbAssets t = jbAssetsDao.get(TjbAssets.class, jbAssets.getId());
   if (t != null) {
     MyBeanUtils.copyProperties(jbAssets, t, new String[] {"id", "createdatetime"}, true);
   }
 }
Exemplo n.º 2
0
  protected String whereHql(JbAssets jbAssets, Map<String, Object> params) {
    String whereHql = "";
    if (jbAssets != null) {
      whereHql += " where 1=1 ";
      if (!F.empty(jbAssets.getAssetNumber())) {
        whereHql += " and t.assetNumber = :assetNumber";
        params.put("assetNumber", jbAssets.getAssetNumber());
      }
      if (!F.empty(jbAssets.getFirstCategory())) {
        whereHql += " and t.firstCategory = :firstCategory";
        params.put("firstCategory", jbAssets.getFirstCategory());
      }
      if (!F.empty(jbAssets.getSecondCategory())) {
        whereHql += " and t.secondCategory = :secondCategory";
        params.put("secondCategory", jbAssets.getSecondCategory());
      }
      if (!F.empty(jbAssets.getDescription())) {
        whereHql += " and t.description = :description";
        params.put("description", jbAssets.getDescription());
      }
      if (!F.empty(jbAssets.getFactory())) {
        whereHql += " and t.factory = :factory";
        params.put("factory", jbAssets.getFactory());
      }
      if (!F.empty(jbAssets.getAssetType())) {
        whereHql += " and t.assetType = :assetType";
        params.put("assetType", jbAssets.getAssetType());
      }
      if (!F.empty(jbAssets.getSerialNumber())) {
        whereHql += " and t.serialNumber = :serialNumber";
        params.put("serialNumber", jbAssets.getSerialNumber());
      }
      if (!F.empty(jbAssets.getLocation())) {
        whereHql += " and t.location = :location";
        params.put("location", jbAssets.getLocation());
      }
      if (!F.empty(jbAssets.getDeptId())) {
        whereHql += " and t.deptId = :deptId";
        params.put("deptId", jbAssets.getDeptId());
      }
      if (!F.empty(jbAssets.getPrincipal())) {
        whereHql += " and t.principal = :principal";
        params.put("principal", jbAssets.getPrincipal());
      }
      if (!F.empty(jbAssets.getSupplier())) {
        whereHql += " and t.supplier = :supplier";
        params.put("supplier", jbAssets.getSupplier());
      }
      if (!F.empty(jbAssets.getSupplierPhone())) {
        whereHql += " and t.supplierPhone = :supplierPhone";
        params.put("supplierPhone", jbAssets.getSupplierPhone());
      }
      if (!F.empty(jbAssets.getMeasure())) {
        whereHql += " and t.measure = :measure";
        params.put("measure", jbAssets.getMeasure());
      }

      if (!F.empty(jbAssets.getIcon())) {
        whereHql += " and t.icon = :icon";
        params.put("icon", jbAssets.getIcon());
      }
      if (!F.empty(jbAssets.getParentId())) {
        whereHql += " and t.parentId = :parentId";
        params.put("parentId", jbAssets.getParentId());
      }
      if (!F.empty(jbAssets.getRoomAreaId())) {
        whereHql += " and t.roomAreaId = :roomAreaId";
        params.put("roomAreaId", jbAssets.getRoomAreaId());
      }
      if (!F.empty(jbAssets.getScope())) {
        whereHql += " and t.scope = :scope";
        params.put("scope", jbAssets.getScope());
      }

      if (!F.empty(jbAssets.getUid())) {
        whereHql += " and t.uid = :uid";
        params.put("uid", jbAssets.getUid());
      }
    }
    return whereHql;
  }