Browse Source

feature(未出账单): 添加若干搜索条件

likai 4 years ago
parent
commit
d9a2d0bb58

+ 6 - 0
model/account/settle_account_main.go

@@ -15,11 +15,17 @@ type SettleAccountMain internal2.SettleAccountMain
 
 type SettleAccountMainReq struct {
 	MainUserId  int `json:"mainUserId"`
+	MainUser  string `json:"mainUser"`
 	AttachUserId int `json:"attachUserId"`
+	AttachUser string `json:"attachUser"`
 	InstrumentId int `json:"instrumentId"`
+	AppointUserId int `json:"appointUserId"`
+	AppointUser      string `json:"appointUser"`
 	Status      string `json:"status"`
 	SettleStatus      string `json:"settleStatus"`
 	FeeType   string `json:"feeType"`
+	AppointStartDate string `json:"appointStartDate"`
+	AppointEndDate string `json:"appointEndDate"`
 }
 
 type AccountMainConfirmReq struct {

+ 15 - 0
service/settle_account_main/settle_account_main.go

@@ -36,12 +36,24 @@ func (s Service) List(req model.ListReq) ([]accountModel.SettleAccountMain, int,
 		if entity.MainUserId != 0 {
 			where += fmt.Sprintf(" AND MainUserId='%v'", entity.MainUserId)
 		}
+		if entity.MainUser != "" {
+			where += fmt.Sprintf(" AND MainUser LIKE '%%%v%%'", entity.MainUser)
+		}
 		if entity.AttachUserId != 0 {
 			where += fmt.Sprintf(" AND AttachUserId='%v'", entity.AttachUserId)
 		}
+		if entity.AttachUser != "" {
+			where += fmt.Sprintf(" AND AttachUser LIKE '%%%v%%'", entity.AttachUser)
+		}
 		if entity.InstrumentId != 0 {
 			where += fmt.Sprintf(" AND InstrumentId='%v'", entity.InstrumentId)
 		}
+		if entity.AppointUserId != 0 {
+			where += fmt.Sprintf(" AND AppointUserId='%v'", entity.AppointUserId)
+		}
+		if entity.AppointUser != "" {
+			where += fmt.Sprintf(" AND AppointUser LIKE '%%%v%%'", entity.AppointUser)
+		}
 		if entity.Status != "" {
 			where += fmt.Sprintf(" AND Status='%v'", entity.Status)
 		}
@@ -51,6 +63,9 @@ func (s Service) List(req model.ListReq) ([]accountModel.SettleAccountMain, int,
 		if entity.FeeType != "" {
 			where += fmt.Sprintf(" AND FeeType='%v'", entity.FeeType)
 		}
+		if entity.AppointStartDate != "" && entity.AppointEndDate != "" {
+			where += fmt.Sprintf(" AND AppointStartDate>'%v' AND AppointEndDate<'%v'", entity.AppointStartDate, entity.AppointEndDate)
+		}
 	}
 	entityModel = entityModel.Where(where)
 	total, err := entityModel.Count()