Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @Entity
- @Table(name = "formation")
- public class Formation {
- @Id
- @GeneratedValue(strategy = GenerationType.AUTO)
- private Long id;
- private String cursus;
- private String groupeaction;
- private String module;
- private String formateur;
- @Temporal(TemporalType.DATE)
- private Date date;
- private Long nbrappart;
- private Long nbrabsent;
- private Long hf;
- private Long jf;
- private Long nbrheures;
- private Long tauxh;
- private Long ristourneprevis;
- private Long couthebergttc;
- private Long coutpausecafttc;
- @Entity
- @Table(name = "tablef")
- public class Tablef {
- @Id
- @GeneratedValue(strategy = GenerationType.AUTO)
- private Long id;
- private String cursus;
- private Long nbrappart;
- private Long Sumnbrheures;
- private Long Sumjf;
- private Long jhf;
- private String groupeaction;
- public Boolean InserIntoTableF(Tablef tf) {
- Long id = ThreadLocalRandom.current().nextLong();
- tf.setId(id);
- jdbc.execute("insert into tablef (id,cursus,groupeaction
- ,nbrappart,sumnbrheures,sumjf,jhf)rn" +
- "select id,cursus,groupeaction,nbrappart,sum(nbrheures),sum(jf)
- ,sum(jf)*nbrappartrn" +
- " from formation rn" +
- "group by cursus ;");
- return true;
- }
- @PostMapping(value = "/test")
- public Boolean AddTf(Tablef tf) {
- return formationservice.InserIntoTableF(tf);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement