Yes, miimum jail sentences have been an effective tool in the war on drugs, because they disable drug dealers. If a drug dealer will not learn from a first offense, putting them in jail is an effective way to keep them drom dealing drugs, because they are not out on the streets. Mandatory minimum sentences also act as a deterrent for people who do not want to go to jail.
When drug dealers go to jail new dealers just take their place. Even when the supply of a given drug is temporarily suppressed users just switch to something else, usually something more dangerous.
And in practice the longer they are in jail the more likely they are to just turn right back to dealing drugs. The criminal record doesn't help their employment prospects either and so that's yet more incentive for them to keep dealing drugs given their options for legitimate employment are limited.
And from a justice standpoint it's overblown. Drug dealers are not generally evil people despite portrayals from Hollywood and the media's focus on violent kingpins. Most drug dealers are street-level dealers who themselves do not engage in violence and do not engage in drug dealing with any malice in mind. They see a possible way to make a lot of money and rationalize that what ever drugs they are selling aren't really "that bad", that people just want to party and have fun, that people who die or go crazy should've "Watched their dose". Or sometimes drug dealers start as users and wind up selling just to afford their next fix.
I disagree with the rationalizations but people don't usually deal drugs thinking "I'm going to ruin people's lives with drugs and get rich in the process." If a person really did think that way and that came out in court then the judge will probably impose the highest possible sentence and he should. But that's why we shouldn't have mandatory minimums. It should be up to the judge's discretion. A drug dealer who got to that point trying to afford their own addiction or a drug dealer who thought of it as just making some money helping people "have fun" should be treated more leniently, and should receive education on the effects of drugs while incarcerated or in the case of the addict turned dealer even offered drug rehab in lieu of incarceration.
The War on Drugs has been a failure and mandatory minimum jail sentences has put many non-violent law breakers into systems they don't belong in. It has become apparent that abolishing drugs is absolutely impossible, just as the prohibition for alcohol was impossible. Requiring drug offenders to serve mandatory sentences, has led to overcrowded prisons.