type TA struct { Id int64 `db:"id"` } type TB struct { Id int64 `db:"id"` } type TC struct { TA TB } 如上的sql和结构体, 当查询sql,用TC结构体封装时, 有两个id字段, 那么数据库中id的值是在TB的id中 如果TC的结构体是 type TC struct { TB TA } 这样, 那么id的值就是在TA中…
() UNION () UNION (select i.create_time as time,i.investment_amount as amount,i.invest_state as state, b.bid_name as type from invest i INNER JOIN bid b on i.bid_id=b.bid_id ) UNION (select r.exact_repayment_time as time,r.should_repayment_amount as…