package
romancist.ibatis3.sample;
import
org.apache.ibatis.annotations.Delete;
import
org.apache.ibatis.annotations.Insert;
import
org.apache.ibatis.annotations.Select;
import
org.apache.ibatis.annotations.Update;
import
romancist.ibatis3.sample.data.StudentData;
import
romancist.ibatis3.sample.data.StudentKey;
public
interface
StudentDao {
@Insert
(
"insert into STUDENT(SNO,NAME,BIRTHDAY,SEX,TEL,ADDRESS,UPDATEMAN,UPDATETIME)VALUES(#{sno},#{name},#{birthday,jdbcType=VARCHAR},#{sex,jdbcType=VARCHAR},#{tel,jdbcType=VARCHAR},#{address,jdbcType=VARCHAR},#{updateman,jdbcType=VARCHAR},#{updatetime})"
)
public
int
insertStudent(StudentData entity);
@Select
(
"select SNO,NAME,BIRTHDAY,SEX,TEL,ADDRESS,UPDATEMAN,UPDATETIME from STUDENT where SNO = #{VALUE}"
)
public
StudentData getStudent(String sno);
@Update
(
"update STUDENT SET NAME = #{name} where sno = #{sno}"
)
public
int
updateStudent(StudentData entity);
@
Delete
(
"delete from STUDENT where SNO = #{sno}"
)
public
int
Student(StudentKey key);
@Update
(
"CREATE TABLE STUDENT ( SNO varchar(10) NOT NULL, NAME varchar(50) NOT NULL, BIRTHDAY varchar(8) NULL, SEX nchar(1) NULL, TEL nchar(10) NULL, ADDRESS varchar(50) NULL, UPDATEMAN varchar(50) NULL, UPDATETIME datetime NULL, CONSTRAINT STUDENT_pk PRIMARY KEY CLUSTERED (SNO)) "
)
void
createTable();
@Update
(
"drop table STUDENT"
)
void
dropTable();
}