Merge remote-tracking branch 'origin/master'
| | |
| | | */ |
| | | <T extends Serializable> int insert(Class<?> mapperClass, T entity); |
| | | |
| | | /**新增,返回主键 |
| | | * @param mapperClass mapper类 |
| | | * @param entity 实体类 |
| | | * @return 条数 |
| | | */ |
| | | <T extends Serializable> int insertById(Class<?> mapperClass, T entity); |
| | | |
| | | /**查询条数 |
| | | * @param mapperClass mapper类 |
| | | * @param sqlSentence 查询参数类 |
| | |
| | | */ |
| | | <T extends Serializable> int insert(Class<?> mapperClass, T entity); |
| | | |
| | | /**新增,返回主键 |
| | | * @param mapperClass mapper类 |
| | | * @param entity 实体类 |
| | | * @return 条数 |
| | | */ |
| | | <T extends Serializable> int insertById(Class<?> mapperClass, T entity); |
| | | |
| | | /**查询条数 |
| | | * @param mapperClass mapper类 |
| | | * @param sqlSentence 查询参数类 |
| | |
| | | return sqlSessionFactory.openSession().insert(getStatement(mapperClass,"insert"),entity); |
| | | } |
| | | |
| | | @Override |
| | | public <T extends Serializable> int insertById(Class<?> mapperClass, T entity) { |
| | | return sqlSessionFactory.openSession().insert(getStatement(mapperClass,"insertById"),entity); |
| | | } |
| | | |
| | | /**获取条数 |
| | | * @return*/ |
| | | @Override |
| | |
| | | return commonDao.insert(mapperClass,entity); |
| | | } |
| | | |
| | | @Override |
| | | public <T extends Serializable> int insertById(Class<?> mapperClass, T entity) { |
| | | return commonDao.insertById(mapperClass,entity); |
| | | } |
| | | |
| | | /**获取条数*/ |
| | | @Override |
| | | public <T extends Serializable> int selectCount(Class<?> mapperClass,SqlSentence sqlSentence) { |
| | |
| | | * endTime比startTime多的天数 |
| | | * @param startTime 最小时间 |
| | | * @param endTime 最大时间 |
| | | * @return |
| | | * @return 返回 |
| | | */ |
| | | public static Integer differDay(Date startTime,Date endTime){ |
| | | Calendar cal1 = Calendar.getInstance(); |
| | |
| | | } |
| | | |
| | | /**把秒转换成X天X时X分X秒*/ |
| | | public static String getChineseStr(Integer second) |
| | | { |
| | | public static String getChineseStr(Integer second) { |
| | | int day = 24 * 60 * 60; |
| | | int hour = 60 * 60; |
| | | int min = 60; |
| | |
| | | cal.roll(Calendar.DATE, -1); |
| | | return cal.getActualMaximum(Calendar.DATE); |
| | | } |
| | | |
| | | /**获取月份的天数 |
| | | * @param year 年份 |
| | | * @param month 月份 |
| | |
| | | /**获取月份的天数 |
| | | * @param yearMonth 年月 |
| | | * @param format 时间格式 |
| | | * @return |
| | | * @return 返回 |
| | | */ |
| | | public static int getMonthDays(String yearMonth,String format) { |
| | | SimpleDateFormat sdf = new SimpleDateFormat(format); |