master
huanghai 5 years ago
parent da805ede04
commit 9bd7728cce

@ -41,6 +41,7 @@ var IncrSqlDict = []tableStruct{
{TableName: "t_base_teacher", PrimaryKey: "teacher_id", DataSource: "user_teacher"},
{TableName: "t_base_student", PrimaryKey: "student_id", DataSource: "user_student"},
{TableName: "t_sys_loginperson_log", PrimaryKey: "id_int", DataSource: "log_login"},
{TableName: "t_base_teacher_org", PrimaryKey: "id", DataSource: "user_teacher_org"},
}
// 全量数据上报
@ -387,7 +388,7 @@ func getRecordEq(eqSql string, lastUpdatedTime string, idInt int64, limit int) (
*/
func getRecordGt(gtSql string, lastUpdatedTime string, idInt int64, limit int) (string, int64, []map[string]interface{}) {
rs, err := db.SQL(gtSql, lastUpdatedTime, limit).Query().List()
if err!=nil{
if err != nil {
fmt.Println(err.Error())
}
if rs != nil && len(rs) > 0 {

@ -0,0 +1,17 @@
SELECT
t1.`id` AS `id`,
t1.`id_int` AS `id_int`,
t1.`person_id` AS `person_id`,
t1.`bureau_id` AS `bureau_id`,
t1.`org_id` AS `org_id`,
t1.`province_code` AS `province_code`,
t1.`city_code` AS `city_code`,
cast( t1.`b_use` AS signed ) AS `b_use`,
t1.`district_code` as district_code,
t1.`main_school_id` as main_school_id,
t1.`sort_id` as sort_id,
t1.`is_main` as is_main,
case t1.`b_use` when -2 then 1 else 0 end AS `del_flag`,
DATE_FORMAT(t1.`last_updated_time`,'%Y/%m/%d %H:%i:%s') AS `last_updated_time`
FROM
`t_base_teacher_org` as t1
Loading…
Cancel
Save