61 lines
865 B
SQL
61 lines
865 B
SQL
-- << Create
|
|
insert into company ( clid
|
|
, code
|
|
, title
|
|
, is_active
|
|
, notes
|
|
, tmpl)
|
|
values ( @clid
|
|
, @code
|
|
, @title
|
|
, @is_active
|
|
, @notes
|
|
, @tmpl)
|
|
returning id
|
|
-- Create >>
|
|
|
|
-- << Read
|
|
select clid
|
|
, id
|
|
, code
|
|
, title
|
|
, is_active
|
|
, notes
|
|
, tmpl
|
|
|
|
from company
|
|
where id = $1
|
|
-- Read >>
|
|
|
|
-- << Update
|
|
update company
|
|
set clid = @clid
|
|
, code = @code
|
|
, title = @title
|
|
, is_active = @is_active
|
|
, notes = @notes
|
|
, tmpl = @tmpl
|
|
|
|
where id = @id
|
|
-- Update >>
|
|
|
|
-- << Delete
|
|
delete
|
|
from company
|
|
where id = $1
|
|
-- Delete >>
|
|
|
|
-- << List
|
|
select clid
|
|
, id
|
|
, code
|
|
, title
|
|
, is_active
|
|
, notes
|
|
, tmpl
|
|
|
|
from company {{.Where}}
|
|
{{.OrderBy}}
|
|
{{.Rows}}
|
|
-- List >>
|