Exemplo n.º 1
0
 public static ListData<QueryFormItem> getAll(
     QueryFormItem vo, String start, String offset, String orderBy, String order) {
   // 指定值对象类型(VOClass)。例子VOClass=User
   // 指定插入表名称(tableName)。例子:如user表,tableName=user
   // 指定O-R映射规则对象。默认mapping
   return SimpleDaoTemplate.query(
       "SELECT * FROM app_queryform_item WHERE 1 = 1 and tableId = " + vo.getTableId() + " ",
       new DymaticCondition()
           .addSimpleCondition(vo, "name", "showName")
           .addCondition("ORDER BY {0} {1}", orderBy, order),
       mapping,
       QueryFormItem.class,
       start,
       offset);
 }
Exemplo n.º 2
0
  public static int sort(String id) {
    QueryFormItem vo = get(id);
    String sort = vo.getSort();

    if ("boolean.true".equals(sort)) {
      vo.setSort("boolean.false");
      vo.setSortName("否");
    } else {
      vo.setSort("boolean.true");
      vo.setSortName("是");
    }

    return edit(vo);
  }
Exemplo n.º 3
0
  public static int condition(String id) {
    QueryFormItem vo = get(id);
    String condtion = vo.getCondition();

    if ("boolean.true".equals(condtion)) {
      vo.setCondition("boolean.false");
      vo.setConditionName("否");
    } else {
      vo.setCondition("boolean.true");
      vo.setConditionName("是");
    }

    return edit(vo);
  }
Exemplo n.º 4
0
  public static int hidden(String id) {
    QueryFormItem vo = get(id);
    String hidden = vo.getHidden();

    if ("visible.true".equals(hidden)) {
      vo.setHidden("visible.false");
      vo.setHiddenName("隐藏");
    } else {
      vo.setHidden("visible.true");
      vo.setHiddenName("显示");
    }

    return edit(vo);
  }
Exemplo n.º 5
0
 public static int edit(QueryFormItem vo) {
   // 指定值对象类型(VOClass)。例子:User
   // 指定插入表名称(tableName)。例子:如user表3个列,tableName=user
   // 指定修改列信息(modify)。例子:name=?, value=?
   // 根据修改列的顺序获取值对象的属性值。例子:vo.getName(), vo.getValue(), vo.getId()
   return SimpleDaoTemplate.update(
       "UPDATE app_queryform_item SET name = ?, showName = ?, tableId = ?, `condition` = ?, conditionName = ?, hidden = ?, hiddenName = ?, sort = ?, sortName = ?, width = ?, format = ?, dict = ?, type = ?, typeName = ? WHERE id = ?",
       vo.getName(),
       vo.getShowName(),
       vo.getTableId(),
       vo.getCondition(),
       vo.getConditionName(),
       vo.getHidden(),
       vo.getHiddenName(),
       vo.getSort(),
       vo.getSortName(),
       vo.getWidth(),
       vo.getFormat(),
       vo.getDict(),
       vo.getType(),
       vo.getTypeName(),
       vo.getId());
 }
Exemplo n.º 6
0
  public static int add(QueryFormItem vo) {
    // 指定值对象类型(VOClass)。例子:User
    // 指定插入表名称(tableName)。例子:如user表3个列,tableName=user(id, name, gender)
    // 根据列的顺序获取值对象的属性值。例子:vo.getId(), vo.getName(), vo.getGender()

    if (getByName(vo.getName(), vo.getTableId()) != null) {
      return 0;
    }

    return SimpleDaoTemplate.update(
        "INSERT INTO app_queryform_item(name, showName, tableId, `condition`, conditionName, hidden, hiddenName, sort, sortName, width, format, dict, type, typeName) VALUES(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)",
        vo.getName(),
        vo.getShowName(),
        vo.getTableId(),
        vo.getCondition(),
        vo.getConditionName(),
        vo.getHidden(),
        vo.getHiddenName(),
        vo.getSort(),
        vo.getSortName(),
        vo.getWidth(),
        vo.getFormat(),
        vo.getDict(),
        vo.getType(),
        vo.getTypeName());
  }