示例#1
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());
  }
示例#2
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);
 }
示例#3
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());
 }