Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
B
BackEnd-V2
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
JIRA
JIRA
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Joel Andres Molina Velez
BackEnd-V2
Commits
4732c2d6
Commit
4732c2d6
authored
May 28, 2023
by
Joel Andres Molina Velez
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
se agregan dos querys para los registros de la tabla ConParaEva
parent
445b9b5f
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
43 additions
and
0 deletions
+43
-0
UzyTavConparaEvaController.java
...ad/MovilidadWS/controller/UzyTavConparaEvaController.java
+12
-0
DaoUzyTavConparaEva.java
...u/espe/movilidad/MovilidadWS/dao/DaoUzyTavConparaEva.java
+15
-0
IServiceUzyTavConparaEva.java
...dWS/service/UzyTaConparaEva/IServiceUzyTavConparaEva.java
+3
-0
ServiceUzyTavConparaEva.java
...adWS/service/UzyTaConparaEva/ServiceUzyTavConparaEva.java
+13
-0
No files found.
src/main/java/ec/edu/espe/movilidad/MovilidadWS/controller/UzyTavConparaEvaController.java
View file @
4732c2d6
...
@@ -29,6 +29,18 @@ public class UzyTavConparaEvaController {
...
@@ -29,6 +29,18 @@ public class UzyTavConparaEvaController {
}
}
@GetMapping
(
"/registrosActivos"
)
public
ResponseEntity
<
List
<
ModelUzyTaConparaEva
>>
ListarRegistrosActivos
()
{
return
new
ResponseEntity
<>(
serviceUzyTavConparaEva
.
ListarRegistrosActivos
(),
HttpStatus
.
OK
);
}
@GetMapping
(
"/registrosInactivos"
)
public
ResponseEntity
<
List
<
ModelUzyTaConparaEva
>>
ListarRegistrosInactivos
()
{
return
new
ResponseEntity
<>(
serviceUzyTavConparaEva
.
ListarRegistrosInactivos
(),
HttpStatus
.
OK
);
}
@PostMapping
(
"/guardar"
)
@PostMapping
(
"/guardar"
)
public
ResponseEntity
<
ModelUzyTaConparaEva
>
guardar
(
@RequestBody
ModelUzyTaConparaEva
modelUzyTaConparaEva
)
{
public
ResponseEntity
<
ModelUzyTaConparaEva
>
guardar
(
@RequestBody
ModelUzyTaConparaEva
modelUzyTaConparaEva
)
{
return
new
ResponseEntity
<>(
serviceUzyTavConparaEva
.
guardar
(
modelUzyTaConparaEva
),
HttpStatus
.
OK
);
return
new
ResponseEntity
<>(
serviceUzyTavConparaEva
.
guardar
(
modelUzyTaConparaEva
),
HttpStatus
.
OK
);
...
...
src/main/java/ec/edu/espe/movilidad/MovilidadWS/dao/DaoUzyTavConparaEva.java
View file @
4732c2d6
...
@@ -2,6 +2,21 @@ package ec.edu.espe.movilidad.MovilidadWS.dao;
...
@@ -2,6 +2,21 @@ package ec.edu.espe.movilidad.MovilidadWS.dao;
import
ec.edu.espe.movilidad.MovilidadWS.model.ModelUzyTaConparaEva
;
import
ec.edu.espe.movilidad.MovilidadWS.model.ModelUzyTaConparaEva
;
import
org.springframework.data.jpa.repository.JpaRepository
;
import
org.springframework.data.jpa.repository.JpaRepository
;
import
org.springframework.data.jpa.repository.Query
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Optional
;
public
interface
DaoUzyTavConparaEva
extends
JpaRepository
<
ModelUzyTaConparaEva
,
Long
>
{
public
interface
DaoUzyTavConparaEva
extends
JpaRepository
<
ModelUzyTaConparaEva
,
Long
>
{
@Query
(
value
=
"SELECT a FROM ModelUzyTaConparaEva a WHERE a.uzytavconparaeva_tipo = 1 "
)
public
Optional
<
List
<
ModelUzyTaConparaEva
>>
findAllEnable
();
@Query
(
value
=
"SELECT i FROM ModelUzyTaConparaEva i WHERE i.uzytavconparaeva_tipo = 2 "
)
public
Optional
<
List
<
ModelUzyTaConparaEva
>>
noActivo
();
}
}
src/main/java/ec/edu/espe/movilidad/MovilidadWS/service/UzyTaConparaEva/IServiceUzyTavConparaEva.java
View file @
4732c2d6
...
@@ -9,6 +9,9 @@ public interface IServiceUzyTavConparaEva {
...
@@ -9,6 +9,9 @@ public interface IServiceUzyTavConparaEva {
public
ModelUzyTaConparaEva
ListarPorID
(
Long
id
);
public
ModelUzyTaConparaEva
ListarPorID
(
Long
id
);
public
List
<
ModelUzyTaConparaEva
>
ListarRegistros
();
public
List
<
ModelUzyTaConparaEva
>
ListarRegistros
();
public
List
<
ModelUzyTaConparaEva
>
ListarRegistrosActivos
();
public
List
<
ModelUzyTaConparaEva
>
ListarRegistrosInactivos
();
public
ModelUzyTaConparaEva
guardar
(
ModelUzyTaConparaEva
modelUzyTaConparaEva
);
public
ModelUzyTaConparaEva
guardar
(
ModelUzyTaConparaEva
modelUzyTaConparaEva
);
...
...
src/main/java/ec/edu/espe/movilidad/MovilidadWS/service/UzyTaConparaEva/ServiceUzyTavConparaEva.java
View file @
4732c2d6
...
@@ -6,6 +6,7 @@ import org.springframework.beans.factory.annotation.Autowired;
...
@@ -6,6 +6,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
org.springframework.web.bind.annotation.PathVariable
;
import
org.springframework.web.bind.annotation.PathVariable
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.List
;
@Service
@Service
...
@@ -23,6 +24,18 @@ public class ServiceUzyTavConparaEva implements IServiceUzyTavConparaEva {
...
@@ -23,6 +24,18 @@ public class ServiceUzyTavConparaEva implements IServiceUzyTavConparaEva {
return
daoUzyTavConparaEva
.
findAll
();
return
daoUzyTavConparaEva
.
findAll
();
}
}
@Override
public
List
<
ModelUzyTaConparaEva
>
ListarRegistrosActivos
()
{
return
daoUzyTavConparaEva
.
findAllEnable
().
orElse
(
new
ArrayList
<>());
}
@Override
public
List
<
ModelUzyTaConparaEva
>
ListarRegistrosInactivos
()
{
return
daoUzyTavConparaEva
.
noActivo
().
orElse
(
new
ArrayList
<>());
}
@Override
@Override
public
ModelUzyTaConparaEva
guardar
(
ModelUzyTaConparaEva
modelUzyTaConparaEva
)
{
public
ModelUzyTaConparaEva
guardar
(
ModelUzyTaConparaEva
modelUzyTaConparaEva
)
{
return
daoUzyTavConparaEva
.
save
(
modelUzyTaConparaEva
);
return
daoUzyTavConparaEva
.
save
(
modelUzyTaConparaEva
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment