| | |
| | | if (type.equalsIgnoreCase("Date")) { |
| | | String tempProperty = "min" + property.substring(0, 1).toUpperCase() + property.substring(1); |
| | | buffer.append(String.format("\tpublic %s %s;", type, tempProperty)); |
| | | queryColumnData.add(new MybatisColumnData(columnName, tempProperty, type)); |
| | | queryColumnData.add(new MybatisColumnData(columnName, tempProperty, type,ColumnParseUtil.getJDBCType(genericType))); |
| | | buffer.append("\n\t"); |
| | | tempProperty = "max" + property.substring(0, 1).toUpperCase() + property.substring(1); |
| | | buffer.append(String.format("\tpublic %s %s;", type, tempProperty)); |
| | | queryColumnData.add(new MybatisColumnData(columnName, tempProperty, type)); |
| | | queryColumnData.add(new MybatisColumnData(columnName, tempProperty, type,ColumnParseUtil.getJDBCType(genericType))); |
| | | buffer.append("\n\t"); |
| | | } else { |
| | | buffer.append(String.format("\tpublic %s %s;", type, property)); |
| | | queryColumnData.add(new MybatisColumnData(columnName, property, type)); |
| | | queryColumnData.add(new MybatisColumnData(columnName, property, type,ColumnParseUtil.getJDBCType(genericType))); |
| | | buffer.append("\n\t"); |
| | | } |
| | | } |
| | |
| | | return queryColumnData; |
| | | } |
| | | |
| | | |
| | | |
| | | public static void createMapper(Class<?> clz) { |
| | | // 生成mapper java文件 |
| | | String pks = getDaoPackageName(clz); |
| | |
| | | buffer.append("\n\n\t"); |
| | | |
| | | //TODO 确定ID类型 |
| | | buffer.append(String.format("%s selectByPrimaryKeyForUpdate(@Param(\"id\") Long id);",clz.getSimpleName())); |
| | | 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\") DaoQuery query);", clz.getSimpleName())); |