update sqlc gen
This commit is contained in:
parent
0343a1093a
commit
c6d6e8c09c
@ -20,6 +20,16 @@ type Account struct {
|
|||||||
Deleted sql.NullBool `db:"deleted" json:"deleted"`
|
Deleted sql.NullBool `db:"deleted" json:"deleted"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type Amocrmstatus struct {
|
||||||
|
ID int64 `db:"id" json:"id"`
|
||||||
|
Accountid int32 `db:"accountid" json:"accountid"`
|
||||||
|
Questionid int64 `db:"questionid" json:"questionid"`
|
||||||
|
Answerid int64 `db:"answerid" json:"answerid"`
|
||||||
|
Fieldid int32 `db:"fieldid" json:"fieldid"`
|
||||||
|
Status string `db:"status" json:"status"`
|
||||||
|
Createdat sql.NullTime `db:"createdat" json:"createdat"`
|
||||||
|
}
|
||||||
|
|
||||||
type Answer struct {
|
type Answer struct {
|
||||||
ID int64 `db:"id" json:"id"`
|
ID int64 `db:"id" json:"id"`
|
||||||
Content sql.NullString `db:"content" json:"content"`
|
Content sql.NullString `db:"content" json:"content"`
|
||||||
|
@ -2522,6 +2522,102 @@ func (q *Queries) GetUtmsByID(ctx context.Context, dollar_1 []int32) ([]GetUtmsB
|
|||||||
return items, nil
|
return items, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const gettingAmoUsersTrueResults = `-- name: GettingAmoUsersTrueResults :many
|
||||||
|
SELECT a.id, a.content, a.quiz_id, a.question_id, a.fingerprint, a.session, a.created_at, a.result, a.new, a.deleted, a.email, a.device_type, a.device, a.os, a.browser, a.ip, a.start,t.accesstoken,r.id, r.accountid, r.quizid, r.performerid, r.pipelineid, r.stepid, r.utms, r.fieldsrule, r.deleted, r.createdat
|
||||||
|
FROM answer a
|
||||||
|
INNER JOIN quiz q ON a.quiz_id = q.id
|
||||||
|
LEFT JOIN amoCRMStatuses s ON a.id = s.AnswerID
|
||||||
|
INNER JOIN rules r ON q.id = r.QuizID
|
||||||
|
INNER JOIN tokens t ON q.accountid = t.AccountID
|
||||||
|
INNER JOIN users u ON q.accountid = u.accountid AND u.amoid = r.accountid
|
||||||
|
WHERE a.result = true
|
||||||
|
AND s.id IS NULL
|
||||||
|
AND r.deleted = false
|
||||||
|
`
|
||||||
|
|
||||||
|
type GettingAmoUsersTrueResultsRow struct {
|
||||||
|
ID int64 `db:"id" json:"id"`
|
||||||
|
Content sql.NullString `db:"content" json:"content"`
|
||||||
|
QuizID int64 `db:"quiz_id" json:"quiz_id"`
|
||||||
|
QuestionID int64 `db:"question_id" json:"question_id"`
|
||||||
|
Fingerprint sql.NullString `db:"fingerprint" json:"fingerprint"`
|
||||||
|
Session sql.NullString `db:"session" json:"session"`
|
||||||
|
CreatedAt sql.NullTime `db:"created_at" json:"created_at"`
|
||||||
|
Result sql.NullBool `db:"result" json:"result"`
|
||||||
|
New sql.NullBool `db:"new" json:"new"`
|
||||||
|
Deleted sql.NullBool `db:"deleted" json:"deleted"`
|
||||||
|
Email string `db:"email" json:"email"`
|
||||||
|
DeviceType string `db:"device_type" json:"device_type"`
|
||||||
|
Device string `db:"device" json:"device"`
|
||||||
|
Os string `db:"os" json:"os"`
|
||||||
|
Browser string `db:"browser" json:"browser"`
|
||||||
|
Ip string `db:"ip" json:"ip"`
|
||||||
|
Start bool `db:"start" json:"start"`
|
||||||
|
Accesstoken string `db:"accesstoken" json:"accesstoken"`
|
||||||
|
ID_2 int64 `db:"id_2" json:"id_2"`
|
||||||
|
Accountid int32 `db:"accountid" json:"accountid"`
|
||||||
|
Quizid int32 `db:"quizid" json:"quizid"`
|
||||||
|
Performerid int32 `db:"performerid" json:"performerid"`
|
||||||
|
Pipelineid int32 `db:"pipelineid" json:"pipelineid"`
|
||||||
|
Stepid int32 `db:"stepid" json:"stepid"`
|
||||||
|
Utms []int32 `db:"utms" json:"utms"`
|
||||||
|
Fieldsrule json.RawMessage `db:"fieldsrule" json:"fieldsrule"`
|
||||||
|
Deleted_2 bool `db:"deleted_2" json:"deleted_2"`
|
||||||
|
Createdat sql.NullTime `db:"createdat" json:"createdat"`
|
||||||
|
}
|
||||||
|
|
||||||
|
func (q *Queries) GettingAmoUsersTrueResults(ctx context.Context) ([]GettingAmoUsersTrueResultsRow, error) {
|
||||||
|
rows, err := q.db.QueryContext(ctx, gettingAmoUsersTrueResults)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
defer rows.Close()
|
||||||
|
var items []GettingAmoUsersTrueResultsRow
|
||||||
|
for rows.Next() {
|
||||||
|
var i GettingAmoUsersTrueResultsRow
|
||||||
|
if err := rows.Scan(
|
||||||
|
&i.ID,
|
||||||
|
&i.Content,
|
||||||
|
&i.QuizID,
|
||||||
|
&i.QuestionID,
|
||||||
|
&i.Fingerprint,
|
||||||
|
&i.Session,
|
||||||
|
&i.CreatedAt,
|
||||||
|
&i.Result,
|
||||||
|
&i.New,
|
||||||
|
&i.Deleted,
|
||||||
|
&i.Email,
|
||||||
|
&i.DeviceType,
|
||||||
|
&i.Device,
|
||||||
|
&i.Os,
|
||||||
|
&i.Browser,
|
||||||
|
&i.Ip,
|
||||||
|
&i.Start,
|
||||||
|
&i.Accesstoken,
|
||||||
|
&i.ID_2,
|
||||||
|
&i.Accountid,
|
||||||
|
&i.Quizid,
|
||||||
|
&i.Performerid,
|
||||||
|
&i.Pipelineid,
|
||||||
|
&i.Stepid,
|
||||||
|
pq.Array(&i.Utms),
|
||||||
|
&i.Fieldsrule,
|
||||||
|
&i.Deleted_2,
|
||||||
|
&i.Createdat,
|
||||||
|
); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
items = append(items, i)
|
||||||
|
}
|
||||||
|
if err := rows.Close(); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
if err := rows.Err(); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return items, nil
|
||||||
|
}
|
||||||
|
|
||||||
const insertAnswers = `-- name: InsertAnswers :exec
|
const insertAnswers = `-- name: InsertAnswers :exec
|
||||||
INSERT INTO answer(
|
INSERT INTO answer(
|
||||||
content,
|
content,
|
||||||
|
Loading…
Reference in New Issue
Block a user