|
|
@@ -146,14 +146,18 @@ func (this *OilSupplierCertAppendController) GetEntityById() {
|
|
|
// @Title 获取公司信息
|
|
|
// @Description 根据创建用户Id和增项类别号获取公司信息
|
|
|
// @Success 200 {object} []suppliercertappend.OilSupplierCertAppend
|
|
|
-// @router /getsupplier/:id [get]
|
|
|
+// @router /getsupplier [get]
|
|
|
func (this *OilSupplierCertAppendController) GetSupplier() {
|
|
|
- Id := this.Ctx.Input.Param(":id")
|
|
|
- where := " WHERE b.Id is NOT NULL AND a.SupplierTypeCode = '" + Id + "' and a.InFlag='1'"
|
|
|
+ SuppTypeCode := this.GetString("SuppTypeCode")
|
|
|
+ where := "1=1 "
|
|
|
+ if SuppTypeCode != "" {
|
|
|
+ where = " WHERE b.Id is NOT NULL AND a.SupplierTypeCode = '" + SuppTypeCode + "' and a.InFlag='1'"
|
|
|
+ }else {
|
|
|
+ where = " WHERE b.Id is NOT NULL AND a.InFlag='1'"
|
|
|
+ }
|
|
|
if this.User.IsCompanyUser == 1 {
|
|
|
where = where + " and b.CreateUserId = '" + this.User.Id + "'"
|
|
|
}
|
|
|
-
|
|
|
svc := suppliercertappend.GetOilSupplierCertAppendService(utils.DBE)
|
|
|
sqlStr := "SELECT b.Id AS SupplierId, a.Id AS SupplierCertId, b.SupplierName AS SupplierName FROM OilSupplierCert AS a LEFT JOIN OilSupplier AS b ON a.SupplierId = b.Id "
|
|
|
sqlStr = sqlStr + where
|