|
|
@@ -84,6 +84,13 @@ type ErmcpGoods struct {
|
|
|
func GetErmcpGoodses(lastUpdateTime string) ([]ErmcpGoods, error) {
|
|
|
engine := db.GetEngine()
|
|
|
|
|
|
+ // 对比数据库与终端的更新时间戳
|
|
|
+ ermcpGoods := make([]ErmcpGoods, 0)
|
|
|
+ engine.Table("GOODS G").Where(fmt.Sprintf("G.MODIFYTIME > to_date('%s','yyyy-MM-dd hh24:mi:ss')", lastUpdateTime)).Find(&ermcpGoods)
|
|
|
+ if len(ermcpGoods) == 0 {
|
|
|
+ return make([]ErmcpGoods, 0), nil
|
|
|
+ }
|
|
|
+
|
|
|
goodses := make([]ErmcpGoods, 0)
|
|
|
session := engine.Table("GOODS G").
|
|
|
Select("G.*, P.RELATEDGOODSID, M.TRADEMODE").
|
|
|
@@ -94,9 +101,9 @@ func GetErmcpGoodses(lastUpdateTime string) ([]ErmcpGoods, error) {
|
|
|
// session = session.And("GOODSID > ?", lastID)
|
|
|
// }
|
|
|
// session = session.Asc("GOODSID")
|
|
|
- if len(lastUpdateTime) != 0 {
|
|
|
- session = session.And(fmt.Sprintf("G.MODIFYTIME > to_date('%s','yyyy-MM-dd hh24:mi:ss')", lastUpdateTime))
|
|
|
- }
|
|
|
+ // if len(lastUpdateTime) != 0 {
|
|
|
+ // session = session.And(fmt.Sprintf("G.MODIFYTIME > to_date('%s','yyyy-MM-dd hh24:mi:ss')", lastUpdateTime))
|
|
|
+ // }
|
|
|
if err := session.Find(&goodses); err != nil {
|
|
|
return nil, err
|
|
|
}
|