SELECT count (*) from DC_Bill a left join DC_doctorService_type b on a.serviceId = b.typeId left join sys_org_account c on a.doctorUid = c.resId and c.roleId =4 where a.state =1 and b.state =1 and c.status =1 @condition 0 then 1 else 2 end) isIncome,b.typeName,insertime,a.doctorPrice,currentBalance from DC_Bill a left join DC_doctorService_type b on a.serviceId = b.typeId left join sys_org_account c on a.doctorUid = c.resId and c.roleId =4 where a.state =1 and b.state =1 and c.status =1 @condition ) as a where 1=1 @page ]]> select typeId,typeName from DC_doctorService_type where state =1 order by typeId