mirror of
https://github.com/geekgeekrun/geekgeekrun.git
synced 2026-06-01 21:50:02 +08:00
add the view of BossLibrary、CompanyLibrary、JobLibrary
This commit is contained in:
30
packages/sqlite-plugin/src/entity/VBossLibrary.ts
Normal file
30
packages/sqlite-plugin/src/entity/VBossLibrary.ts
Normal file
@@ -0,0 +1,30 @@
|
||||
import { requireTypeorm } from "../utils/module-loader";
|
||||
const { ViewEntity, ViewColumn } = requireTypeorm();
|
||||
@ViewEntity({
|
||||
expression: `SELECT
|
||||
boss_info.encryptBossId,
|
||||
boss_info.name,
|
||||
boss_info.title,
|
||||
company_info.name as companyName,
|
||||
company_info.encryptCompanyId as encryptCompanyId
|
||||
FROM
|
||||
boss_info
|
||||
LEFT JOIN company_info ON company_info.encryptCompanyId = boss_info.encryptCompanyId
|
||||
`,
|
||||
})
|
||||
export class VBossLibrary {
|
||||
@ViewColumn()
|
||||
encryptBossId: number;
|
||||
|
||||
@ViewColumn()
|
||||
name: string;
|
||||
|
||||
@ViewColumn()
|
||||
title: string;
|
||||
|
||||
@ViewColumn()
|
||||
companyName: number | null;
|
||||
|
||||
@ViewColumn()
|
||||
encryptCompanyId: number | null;
|
||||
}
|
||||
Reference in New Issue
Block a user