| | |
| | | } |
| | | if (type.equalsIgnoreCase("Date")) { |
| | | String tempProperty = "min" + property.substring(0, 1).toUpperCase() + property.substring(1); |
| | | buffer.append(String.format("\tpublic %s %s", type, tempProperty)); |
| | | buffer.append(String.format("\tpublic %s %s;", type, tempProperty)); |
| | | queryColumnData.add(new MybatisColumnData(columnName, tempProperty, type)); |
| | | buffer.append("\n\t"); |
| | | tempProperty = "max" + property.substring(0, 1).toUpperCase() + property.substring(1); |
| | | buffer.append(String.format("\tpublic %s %s", type, tempProperty)); |
| | | buffer.append(String.format("\tpublic %s %s;", type, tempProperty)); |
| | | queryColumnData.add(new MybatisColumnData(columnName, tempProperty, type)); |
| | | buffer.append("\n\t"); |
| | | } else { |
| | | buffer.append(String.format("\tpublic %s %s", type, property)); |
| | | buffer.append(String.format("\tpublic %s %s;", type, property)); |
| | | queryColumnData.add(new MybatisColumnData(columnName, property, type)); |
| | | buffer.append("\n\t"); |
| | | } |
| | |
| | | buffer.append(String.format("public interface %sMapper extends BaseMapper<%s> {", clz.getSimpleName(), clz.getSimpleName())); |
| | | buffer.append("\n\n\t"); |
| | | |
| | | buffer.append(String.format("%s selectByPrimaryKeyForUpdate(@Param(\"id\") id);",clz.getSimpleName())); |
| | | //TODO 确定ID类型 |
| | | buffer.append(String.format("%s selectByPrimaryKeyForUpdate(@Param(\"id\") Long id);",clz.getSimpleName())); |
| | | buffer.append("\n\n\t"); |
| | | |
| | | buffer.append(String.format("List<%s> list(@Param(\"query\") query);", clz.getSimpleName())); |
| | | buffer.append(String.format("List<%s> list(@Param(\"query\") DaoQuery query);", clz.getSimpleName())); |
| | | buffer.append("\n\n\t"); |
| | | buffer.append("long count(@Param(\"query\") query);"); |
| | | buffer.append("long count(@Param(\"query\") DaoQuery query);"); |
| | | buffer.append("\n\n\t"); |
| | | |
| | | List<MybatisColumnData> queryColumnData = createMapperDaoQuery(importPosition, buffer, clz); |