|
@@ -480,6 +480,8 @@ type LongzhongSurveyProduct struct {
|
|
|
QuotaSampleId int64
|
|
|
StartDate string
|
|
|
EndDate string
|
|
|
+ ModifyTime time.Time
|
|
|
+ LzCode string
|
|
|
}
|
|
|
|
|
|
//判断指标数据是否已经录入
|
|
@@ -491,10 +493,10 @@ func GetLongzhongSurveyProductCount(quotaSampleId int64) (count int, err error)
|
|
|
return
|
|
|
}
|
|
|
|
|
|
-func AddLongzhongSurveyProduct(item *LongzhongSurveyProduct) (err error) {
|
|
|
+func AddLongzhongSurveyProduct(item *LongzhongSurveyProduct) (lastId int64, err error) {
|
|
|
o := orm.NewOrm()
|
|
|
o.Using("edb")
|
|
|
- _, err = o.Insert(item)
|
|
|
+ lastId, err = o.Insert(item)
|
|
|
return
|
|
|
}
|
|
|
|
|
@@ -640,3 +642,22 @@ func ModifyLzSurveyMaxAndMinInfo(item *LzSurveyMaxAndMinInfo, surveyProductId in
|
|
|
_, err = o.Raw(sql, item.MinDate, item.MaxDate, item.MinValue, item.MaxValue, surveyProductId).Exec()
|
|
|
return
|
|
|
}
|
|
|
+
|
|
|
+func ModifLongzhongSurveyProductCode(lzCode string, surveyProductId int) (err error) {
|
|
|
+ o := orm.NewOrm()
|
|
|
+ o.Using("edb")
|
|
|
+ sql := `UPDATE longzhong_survey_product
|
|
|
+ SET lz_code= ?
|
|
|
+ WHERE survey_product_id = ? `
|
|
|
+ _, err = o.Raw(sql, lzCode, surveyProductId).Exec()
|
|
|
+ return
|
|
|
+}
|
|
|
+
|
|
|
+//判断指标数据是否已经录入
|
|
|
+func GetLongzhongSurveyProductItem(quotaSampleId int64) (item *LongzhongSurveyProduct, err error) {
|
|
|
+ o := orm.NewOrm()
|
|
|
+ o.Using("edb")
|
|
|
+ sql := `SELECT * FROM longzhong_survey_product WHERE quota_sample_id=? `
|
|
|
+ err = o.Raw(sql, quotaSampleId).QueryRow(&item)
|
|
|
+ return
|
|
|
+}
|