Mybatis insert후 키값 반환하기
쿼리 SELECT to_char(current_timestamp,'yyyymmdd')||lpad(nextval('seq_test')::TEXT, 3, '0') INSERT INTO test( id, name ) VALUES ( #{id}, #{name} )서비스public String create(Map attach) { testMapper.create(attach); return attach.get("id").toString(); // Retrieve pre-generated ID}
2024.12.27