一、通过使用@Options注解,将数据库的自增字段id中的值写到eemLeader对象的id字段,之后在其他地方使用
@Options(useGeneratedKeys = true, keyColumn = "id" , keyProperty = "id")
@Insert("insert into eem_leader(code,dept_id,name,gender,birthday,nation,politics_status,education,hire_date,working_state," +
"del_flag,create_by,create_time,update_by,update_time,remark) " +
"values(#{code},#{deptId},#{name},#{gender},#{birthday},#{nation},#{politicsStatus},#{education},#{hireDate},#{workingState}," +
"#{delFlag},#{createBy},null,null,null,remark)")
int addLeaderBasicInfo(EemLeader eemLeader);
二、通过动态SQL写入List类型的数据
@Insert("")
int addLeaderDutyInfo(@Param("leaderId") long leaderId,@Param("eemLeaderDutyList") List<EemLeaderDuty> eemLeaderDutyList);
三、通过动态SQL查询数据
@Select("")
List<Map<String,Object>> getLeaderListByQueryCondition(QueryCondition queryCondition);
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)