Skip to content

Commit

Permalink
abstract service
Browse files Browse the repository at this point in the history
  • Loading branch information
westxixia committed Dec 31, 2015
1 parent 9075969 commit 9713ec7
Show file tree
Hide file tree
Showing 39 changed files with 631 additions and 120 deletions.
30 changes: 15 additions & 15 deletions .settings/org.eclipse.jdt.core.prefs
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,14 @@ org.eclipse.jdt.core.formatter.alignment_for_enum_constants=0
org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer=16
org.eclipse.jdt.core.formatter.alignment_for_method_declaration=0
org.eclipse.jdt.core.formatter.alignment_for_multiple_fields=16
org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration=16
org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration=0
org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration=16
org.eclipse.jdt.core.formatter.alignment_for_resources_in_try=80
org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation=80
org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration=16
org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration=16
org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration=16
org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration=37
org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration=5
org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration=37
org.eclipse.jdt.core.formatter.alignment_for_union_type_in_multicatch=16
org.eclipse.jdt.core.formatter.blank_lines_after_imports=1
Expand Down Expand Up @@ -64,7 +64,7 @@ org.eclipse.jdt.core.formatter.comment.format_line_comments=true
org.eclipse.jdt.core.formatter.comment.format_source_code=true
org.eclipse.jdt.core.formatter.comment.indent_parameter_description=true
org.eclipse.jdt.core.formatter.comment.indent_root_tags=true
org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags=insert
org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags=do not insert
org.eclipse.jdt.core.formatter.comment.insert_new_line_for_parameter=do not insert
org.eclipse.jdt.core.formatter.comment.line_length=120
org.eclipse.jdt.core.formatter.comment.new_lines_at_block_boundaries=true
Expand Down Expand Up @@ -94,22 +94,22 @@ org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_method=insert
org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_package=insert
org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_parameter=insert
org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_type=insert
org.eclipse.jdt.core.formatter.insert_new_line_after_label=do not insert
org.eclipse.jdt.core.formatter.insert_new_line_after_label=insert
org.eclipse.jdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer=do not insert
org.eclipse.jdt.core.formatter.insert_new_line_after_type_annotation=do not insert
org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing=do not insert
org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement=insert
org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing=insert
org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement=do not insert
org.eclipse.jdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer=do not insert
org.eclipse.jdt.core.formatter.insert_new_line_before_else_in_if_statement=insert
org.eclipse.jdt.core.formatter.insert_new_line_before_finally_in_try_statement=insert
org.eclipse.jdt.core.formatter.insert_new_line_before_else_in_if_statement=do not insert
org.eclipse.jdt.core.formatter.insert_new_line_before_finally_in_try_statement=do not insert
org.eclipse.jdt.core.formatter.insert_new_line_before_while_in_do_statement=do not insert
org.eclipse.jdt.core.formatter.insert_new_line_in_empty_annotation_declaration=do not insert
org.eclipse.jdt.core.formatter.insert_new_line_in_empty_anonymous_type_declaration=do not insert
org.eclipse.jdt.core.formatter.insert_new_line_in_empty_block=do not insert
org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_constant=do not insert
org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_declaration=do not insert
org.eclipse.jdt.core.formatter.insert_new_line_in_empty_method_body=do not insert
org.eclipse.jdt.core.formatter.insert_new_line_in_empty_type_declaration=do not insert
org.eclipse.jdt.core.formatter.insert_new_line_in_empty_annotation_declaration=insert
org.eclipse.jdt.core.formatter.insert_new_line_in_empty_anonymous_type_declaration=insert
org.eclipse.jdt.core.formatter.insert_new_line_in_empty_block=insert
org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_constant=insert
org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_declaration=insert
org.eclipse.jdt.core.formatter.insert_new_line_in_empty_method_body=insert
org.eclipse.jdt.core.formatter.insert_new_line_in_empty_type_declaration=insert
org.eclipse.jdt.core.formatter.insert_space_after_and_in_type_parameter=insert
org.eclipse.jdt.core.formatter.insert_space_after_assignment_operator=insert
org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation=do not insert
Expand Down
91 changes: 91 additions & 0 deletions src/main/java/com/ssmssm/core/dao/BaseDao.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
package com.ssmssm.core.dao;

import java.util.List;

import org.apache.ibatis.annotations.Param;

import com.ssmssm.core.entity.BaseCriteria;
import com.ssmssm.core.entity.BaseEntity;

public interface BaseDao {

/**
* 根据条件检索数据件数
* @param example
* @return
*/
int countByExample(BaseCriteria example);

/**
* 根据主键检索数据
* @param key
* @return
*/
BaseEntity selectByPrimaryKey(BaseEntity key);

/**
* 根据条件检索数据
* @param example
* @return
*/
List<BaseEntity> selectByExample(BaseCriteria example);

/**
* 新增数据
* @param record
* @return
*/
int insert(BaseEntity record);

/**
* 根据条件新增数据(null不处理)
* @param record
* @return
*/
int insertSelective(BaseEntity record);

/**
* 根据主键更新数据
* @param record
* @return
*/
int updateByPrimaryKey(BaseEntity record);

/**
* 根据主键更新数据(null不处理)
* @param record
* @return
*/
int updateByPrimaryKeySelective(BaseEntity record);

/**
* 根据条件更新数据
* @param record
* @param example
* @return
*/
int updateByExample(@Param("record") BaseEntity record, @Param("example") BaseCriteria example);

/**
* 根据条件更新数据(null不处理)
* @param record
* @param example
* @return
*/
int updateByExampleSelective(@Param("record") BaseEntity record, @Param("example") BaseCriteria example);

/**
* 根据主键删除数据
* @param key
* @return
*/
int deleteByPrimaryKey(BaseEntity key);

/**
* 根据条件删除数据
* @param example
* @return
*/
int deleteByExample(BaseCriteria example);

}
27 changes: 27 additions & 0 deletions src/main/java/com/ssmssm/core/entity/BaseCriteria.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
package com.ssmssm.core.entity;



public abstract class BaseCriteria {
/**
* This field was generated by MyBatis Generator. This field corresponds to the database table t_auth_user
* @mbggenerated
*/
protected Page page;

/**
* This method was generated by MyBatis Generator. This method corresponds to the database table t_auth_user
* @mbggenerated
*/
public void setPage(Page page) {
this.page = page;
}

/**
* This method was generated by MyBatis Generator. This method corresponds to the database table t_auth_user
* @mbggenerated
*/
public Page getPage() {
return page;
}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.ssmssm.entity;
package com.ssmssm.core.entity;

import java.io.Serializable;
import java.util.Date;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.ssmssm.entity;
package com.ssmssm.core.entity;

import java.math.BigDecimal;

Expand Down
Loading

0 comments on commit 9713ec7

Please sign in to comment.